Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Select All Region

jwellsnhSep 3 2013 — edited Sep 4 2013

Looking for a solution to select all rows of a report region.  The region will contain a list of email addresses.  Have tried implementing this functionality via a dynamic action triggered by a button.  A demo of my latest attempt can be viewed at http://apex.oracle.com/pls/apex/f?p=57067:1

Dynamic Action is defined as follows:

Event: Click

Selection Type: Button

True Action:

Action: Execute JavaScript Code

Fire When Event Result Is: True

Fire On Page Load: Unchecked

Selection Type: Region

Code: document.getElementById('TEXT').select();

TEXT is the Static ID of the Region.

Jeff

Comments

Hi,

Can you explain your req?

To my understanding, you need to select all the email addresses from the report region. The report also consists of one report column.

You need to get all the email addresses once the button is clicked.

Is that correct?

If not please explain.

jwellsnh

Hi Ramesh,

Your understanding of my requirements is correct.

Jeff

If you want to select all the emails from that column once the button is clicked, I can get it.

We need to create a hidden page item and once the button is clicked we can call a javascript and get the data into page item.

Go to your report attributes and

click pencil icon next to column

In Column Attributes ==> Element Attributes  ==> enter the following   class="emailAttr"


<script type=text/javascript">

var emailAddr='',emails='';
function getemails(){

$('.emailAttr').each(function(){

    emailAddr = emailAddr+','+this.text;

});

emails = emailAddr.substring(1);

$("#P1_HIDDEN_EMAIL").val(emails);

}

</script>

jwellsnh

HI Ramesh,

In my case your solution will not work.  Let me restate how the page would work and what the user would do.

Region would populate with a list of email addresses; in the case of my sample application, employee names are listed.  When the user clicks on the button, Select All, the entire contents of the region needs to be highlighted so that the user could then Ctrl-C copy the contents of the region and Ctl-V paste them into an email address To field.

Jeff

Yes, you can do.

Now provide additional button to user copy the selected emails to email field. on click of that button set the hidden item values to email field.

If at all, if the users can only select few email from the report, then give them a check box report with names, Once the users selects check all, all will be checked and user can click copy button to get all the values into email field with comma or whatever separator.

As its in check box, the  user can uncheck some of the emails he doesn't want, so more comfort for the user.

That will be an ideal solution

Have a report with checkbox and name

jwellsnh

Ramesh,

Still not the solution I am looking for; one button to highlight the list is all that is required.  Maybe you could develop a prototype on your workspace to convince me differently.

Jeff

jwellsnh

Thanks for your reply VC but that is still not my requirement.  I want to replicate the functionality of this link against a column within a report.

http://www.w3schools.com/jsref/met_text_select.asp

Jeff

jwellsnh

Anyone interested in accessing my workspace to get this working is welcome.

Workspace - flatrock

Username - demo

Password - demo

Application 57067 Select All Text

Functionality Required.

  1. Click the Select All button
  2. Highlight (Select All) the contents of the report region

I have an export of the application; so have at it.

Thanks in advance.

Jeff

Invalid credentials

jwellsnh

Try it now.

demo

demo

VC

I don't think you can achieve that because it only works for text fields

Alternatively you can try to capture the values into an read-only text-area and highlight it so that users can do a Ctrl+C

For that simply do:

$('#P1_EMAILS').val($('td[headers="ENAME"] div').text());

$x('P1_EMAILS').select();


jwellsnh

Thanks VC,

That is what is what I was expecting to hear.  It will just look ugly in a text field.  I will give your method a go and get back to you.

Your alternative method is what I believe Ramesh is trying to get working.  That may work but it is not a very clean solution for the user.

Jeff

jwellsnh

Thanks all.  Ideally not the solution I desired but realize now the limitations.

Jeff

Jeff E

You might be able to put the values into a hidden item and then incorporate some javascript to save the contents of the hidden field to the clipboard, bypassing the need for the user to type CTRL-C.  The ability to use javaScript to add text to the clipboard will have some limitations (browser specific) but you might find something that will work in your case..

1 - 16
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 2 2013
Added on Sep 3 2013
16 comments
491 views