Count Selected Shuttle Items

Apex 3.2
I have a shuttle item and a text box.
As the user moves items from the left of the shuttle to the right, I would like to display a count (in the text box) of the number
of items he has chosen.
I know that his will probably have to be done with an onclick javascript function, but I have no idea how to do it.
I cannot use dynamic actions, as this is an Apex 3.2 application.
Please have a look at my workspace
Workspace: GUSCRIGHTON
Username: [email protected]
Password: terminator
App Id: 25851
Page: 5
Thanks
Gus

I was kind of hoping to capture the change event on the shuttle fieldset, but can't, for some reason. I'm too rusty in my js-fu. If that'd even work in 3.2, no clue.
Binding to the controls like Jari suggested works though.
function setShuttleSelectedAmount(pShuttleId, pAmount){
  var lAmount = document.getElementById(pShuttleId+"_RIGHT").children.length;
  document.getElementById("P5_DESCRIPTION").value = lAmount;
function attachShuttleEvents(pShuttleId){
  document.getElementById(pShuttleId+"_RESET").addEventListener("click", function(){
    setShuttleSelectedAmount(pShuttleId);
  }, false);
  document.getElementById(pShuttleId+"_MOVE").addEventListener("click", function(){
    setShuttleSelectedAmount(pShuttleId);
  }, false);
  document.getElementById(pShuttleId+"_MOVE_ALL").addEventListener("click", function(){
    setShuttleSelectedAmount(pShuttleId);
  }, false);
  document.getElementById(pShuttleId+"_REMOVE").addEventListener("click", function(){
    setShuttleSelectedAmount(pShuttleId);
  }, false);
  document.getElementById(pShuttleId+"_REMOVE_ALL").addEventListener("click", function(){
    setShuttleSelectedAmount(pShuttleId);
  }, false);
  document.getElementById(pShuttleId+"_LEFT").addEventListener("dblclick", function(){
    setShuttleSelectedAmount(pShuttleId);
  }, false);
  document.getElementById(pShuttleId+"_RIGHT").addEventListener("dblclick", function(){
    setShuttleSelectedAmount(pShuttleId);
  }, false);
attachShuttleEvents("P5_SHUTTLE");
PS: I also want to mention that this may be browser dependant, especially for IE<9 where you would need to use attachEvent instead of addEventListener...
Edit: maybe Paul knows more!

Similar Messages

  • Create a collection from Shuttle or Multiple Select List items

    Hi all, this may be a dumb question, but I cannot find how to create a collection using the values stored shuttle item? I just want to assign the values of the shuttle which are usually delimited by a colon (ex. 11:22:33:44:55) into a collection that stores each of these values separately so later I can select * from table where id IN(select * from collectionname) --- is this possible?
    I am running into a problem where users want to select more than 1000 items in a shuttle to do a search.... and the IN operator cannot handle more than 1000 instances. I was told to try to use a temporary table to house the values of the shuttle, but temporary tables pose a problem with APEX. I read on the forums to try using a collection instead. Any thoughts?
    Thanks.

    Would this be a good start?? I found this here... Re: Search on a typed in list of values
    Not sure how the View would work though??
    A much easier way of doing all this is to create a collection, create a view off that collection and then do your select from the view. No custom functions or types involved. An example is:
    DECLARE
    l_vc_arr2 HTMLDB_APPLICATION_GLOBAL.VC_ARR2;
    BEGIN
    l_vc_arr2 := HTMLDB_UTIL.STRING_TO_TABLE(:P13_MULTISELECT);
    htmldb_collection.create_or_truncate_collection( p_collection_name => 'MULTISELECTCOL');
    FOR i IN 1..l_vc_arr2.count LOOP
    htmldb_collection.add_member(
    p_collection_name => 'MULTISELECTCOL',
    p_c001 => l_vc_arr2(i));
    END LOOP;
    END;
    where your view looks something like:
    CREATE OR REPLACE FORCE VIEW "WS"."TEMP_MULTISELECT_VIEW" ("MULTISELECTID") AS
    (SELECT c001 FROM htmldb_collections WHERE collection_name = 'MULTISELECTCOL');
    and finally for your report you use something like:
    SELECT t.a
    FROM tablea t
    WHERE t.b IN
    (SELECT roleid FROM temp_multiselect_view)
    This way is simple and works... so by KISS standards its good.
    Hope this helps some other unfortunate....

  • A dynamic select statement as source for a shuttle item: use xmlagg

    Here is a suggestion:
    If you want to create a dynamic string of values for the source of a shuttle item, you can use the xmlagg trick.
    For example:
    select rtrim (xmlagg (xmlelement (n, e.ename|| ':') order by e.ename ).extract ('//text()'), ':') employee_name
    from emp e
    It will return s string of names: ADAMS:ALLEN:BLAKE:CLARK:FORD:JAMES:JONES:KING:MARTIN:MILLER:SCOTT:SMITH:TURNER:WARD
    Important is not to forget the "order by" clause inside the xmlagg.
    If you have installed the STRAGG function, you could use that one also.
    For example:
    select replace(stragg(e.ename),',',':') employee_name
    from (select ename
    from emp
    order by ename) e
    From Oracle 11gR2 there is another way: the LISTAGG function
    For example:
    select listagg(e.ename, ':') within group (order by e.ename) employee_name
    from emp e
    regards,
    Mathieu

    Hi Michael
    Check out this posting and KM;
    https://blogs.oracle.com/warehousebuilder/entry/odi_11g_simple_flexible_powerful
    Cheers
    David

  • Passing Shuttle Item results to Database Colomn

    Hi There,
    Building my first database using APEX and am stuck with how I go about storing the results selected in a Shuttle Item to a database column...
    Can anyone please point me in the direction of resolving this issue ?
    Regards
    Jes

    Hmm, I'm not exactly sure how that works ... the process they said to use is:
    DECLARE
    BEGIN
    FOR z in 1..htmldb_application.g_f01.count loop
    UPDATE "SHUTTLE_DEMO_CATEGORY" SET "CATEGORY" = 1, "ORDER" = z WHERE "SHUTTLE_DEMO_CATEGORY"."ID" = htmldb_application.g_f01(z);
    END LOOP;
    FOR z in 1..htmldb_application.g_f02.count loop
    UPDATE "SHUTTLE_DEMO_CATEGORY" SET "CATEGORY" = 2, "ORDER" = z WHERE "SHUTTLE_DEMO_CATEGORY"."ID" = htmldb_application.g_f02(z);
    END LOOP;
    END;
    But it's not grabbing anything. At least I want to be able to see the colon delimited items that I selected.
    Maybe I am not doing it right ...
    All I really want is the "Copy" Functionality from here: http://apex.oracle.com/pls/otn/f?p=35253:2:3896988266043617::NO
    If I could use the existing Shuttle Item APEX provides, and somehow mimic the "Copy" portion when clicking the move() > arrow. That would be great. There must be some sort of javascript that I can overload in the header, but I am not sure how to do it.
    If anyone has any insight that would be great! I'd appreciate it! I know there's an easier way to do this!!
    Thanks in advance!!

  • Shuttle Item problem in Apex 3.1.2

    Hi
    I created application based on shuttle items in apex earlier version.
    The same is not working fine in Apex 3.1.2 version.
    I'm not doing any process on shuttle items.
    Just created a shuttle item contains a list of values.
    whenever i refresh the page,(or say when i press Cancel button to go back to previous page)
    shuttle item selects all the values in the list, (i.e values in shuttle items are rolling).
    I somehow tried to replicate the same application in demo environment :
    http://apex.oracle.com/pls/otn/f?p=12822:4
    workspace: vsanthanam
    userid: vijay
    password: apex_demo
    If you see above application, whenever we press button submit. it selects all the values in
    Shuttle (actually rolling in my developement instance and not processing further).
    Is there anything that we have to take care while using shuttle in newer version?
    Thanks
    Vijay
    Edited by: Vijay Santhanam on Jan 26, 2009 9:39 PM

    Hi Arie
    Thanks for your valuable inputs.
    While analyzing the issue on two versions: 3.1.2 & 3.0.x ,I noticed few things:
    1) Limitation of 2000 values
    Had raised SR with Oracle, They have treated this as bug some time back and have temporary resolution as per BUG ID 7326899.
    This got temporarily resolved by setting higher value for PlsqlMaxParameters.
    As per my understanding: Shuttles never used to refer to this variable value In earlier version. We are on earlier version on one of the instance, where the value for this parameter is still 2000, and despite having more number of values in shuttles on page it never throws error. That shows its a change in new version and behavior is not same.
    2) Looping/ Going through all values in left box and then right box of shuttle when page submits.
    I am pretty sure at-least about the visual part that it never happened in earlier version what I see on my application on earlier version. But I am not sure about the page rendering / functionality part as this would need regression testing.
    So this is second change in shuttle behavior.
    Since Business users need all values to be present in the shuttle even after submit for resubmission i.e. again creating the records, so I have not put yet the java script suggested by you to put restriction on length so that it doesn’t loops through values.
    I went though the thread where Carl and You have discussed the issue:
    Shuttle Item in 3.1
    Thanks again Arie!
    I am also following with Oracle to get some solution other than following you :-)
    Regards
    Ravijeet

  • How to select line items in recording(BDC)

    Hi All,
    we are trying to Recording QP02 transaction ,we have inputs like material,plant,Group,Group Counter.
    after entering these inputs we will get multiful line items(inspection characteristics).we need to check one field for each item.
    How can we get this?
    Please help me?
    Thanks,
    Peddi reddy.

    Hi Kamesh,
    Thanks.
    After selecting line items i am selecting control indicators Tab.
    then Pop up screen called as (Edit characteristic control indicators) will open ,..then just pressing enter..the it will show another pop up ..here i am selecting one field(Long term Inspection)..the process has to do for all line items.
    In My program i have copied BDC performs which i got from Recording.
    Do i need to change tha performs or will it work?
    i tested in foreground with another material .... upto 3 or 4 line items its working fine.after that sytem does.t say anything.
    if i need to chage performs please help me .

  • Shuttle Item Properties in Apex 3.0

    Hi,
    Hoping someone can assist with the new Shuttle item in Apex 3.0.
    Basically, can someone please let me know how I can perform the following:
    a) change the width of the shuttle as when I make a change to the width property, it doesn't seem to make any difference?
    b) Am I still able to place headings on each of the shuttle cells like I could when using Carl's example?
    c) Based on Carl's original Shuttle implementation, is there any undocumented information relating to the new Shuttle item?
    Thanks.
    Tony.

    Hi Tony,
    <p>
    a) under Elements>HTML Form Element Attributes, use style="width:200px" to set the width for the item<p>
    b) I have not found a way to do that, although others may have<p>
    c) Check out the Apex 3.0 documentation for the shuttle item--you basically treat it like a multi-select list, with the source of the item returning a colon-delimited string of values.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to keep sort order in Shuttle item's source and destination boxes?

    I have defined a shuttle item on a page and the list of values in the source box is populated by a SQL with sort order specified. In the Settings of the shuttle item, Show Controls value is set to Moving Only instead of All. When a user moves selected values from the source box to the destination box or vice versa, the list of values does not maintain the original sort order. For example, if I have 26 values A through Z, a user can put value Z before A in the destination box. And when a user move A from the destination box to the source box, A is the last item in the source box. The reset button clears everything in the destination box and resets the source box to the original sorted list. This is not the solution that I am looking for. I would like to see the items in the source and destination boxes to maintain their original sort order all the time.
    Is it possible?
    APEX v4.0.1.00.03
    Oracle 11g (v11.2.0.1.0)

    Hi,
    See if this post help
    Re: Sort Shuttle Right
    Regards,
    Jari

  • How to populate table rows with selected listbox items?

    Hello,
    I am trying to populate a table with selected listbox items. Each item should be a new row in the table. The picture below is the listbox and table I am using. I need to get the selected name to populate the Attendee column of the table when the user clicks the Add button. How do you do this with mutltiple attendees selected?
    Thank you,
    Angie

    So you're considering the fact the if the user clicks the button twice, the name will appear twice and you don't want this, right?
    Then you must check if any value is the same than the one you are about to add in the row..
    for (var i = 0 ; i < ListBox1.length; i++){
         if (ListBox1.getItemState(i) == true){
              for (var x = 0 ; x < Table1._Row1.count; x++){
                   var boNewAttendee = true;
                   var strAttendee = Table1.resolveNode("Row1[" + x.toString() + "]").txtAttendee;
                   var newAttendee = ListBox1.getDisplayItem(i);
                   if (strAttendee.rawValue == newAttendee){
                        boNewAttendee = false;
                        break;
              if (boNewAttendee){
                   txtAttendee.rawValue = ListBox1.getDisplayItem(i);

  • How to pass the whole set of values of a shuttle item in AJAX

    Hi,
    I am trying to pass the value of shuttle item to a dynamic process using Ajax. But if I use shuttle_right, I am able to get only the first selected value. If I simply give shuttle it returns null.
    Please let me know How I can get the whole set of values separated by ':'
    Thanks,
    Vikas

    Vikas,
    Here's a little snippet that should get you going:
    var shtVals = '';
    var shuttle = new dhtml_ShuttleObject("PXX_SHUTTLE_LEFT","PXX_SHUTTLE_RIGHT");
    for (x=0; x<shuttle.Op1Init.length; x++) {
       shtVals += shuttle.Op1Init[x].value + ':'; //Op1 = left & Op2 = right
    shtVals = shtVals.replace(/:$/,'');
    alert(shtVals);Regards,
    Dan

  • Searching a Table field with multiple values using a shuttle item

    Hello All,
    I have a shuttle item whhich of course users can select multiple values:
    eg: Orange:Pear:Banana
    Now I have a table where I want to get the Crate Numbers where these fruit items reside.
    The Fruit field has multiple stored values
    eg:
    Crate Fruits
    === ====
    12487 Apple:Orange:Pear:Banana
    17653 Orange:Pear:Grapes
    12874 Apple:Banana
    13655 Grapes:Watermelon:Pineapple
    87643 Pear:Banana
    53626 Strawberries:Apple
    I would like to see a final report similiar to this
    Crate Fruit
    === ===
    12487 Orange
    12487 Pear
    12487 Banana
    17653 Orange
    17653 Pear
    12874 Banana
    87643 Pear
    87643 Banana
    I thought maybe this needs to be done using collections but I am not familiar with this function, if their is another way I would appreciate it
    Hope u can help
    Frank

    Hi Frank,
    I find that in this sort of case, it is easier to create a link table containing the individual values rather than lumping them into one column.
    so the data is stored in the 'Crate, Fruit' format, rather then the 'Crate Fruits' format.
    It is a bit more work maintaining the link table when the values are amended and populating the shuttle, but it is a 'proper' relational table then.
    Regards
    Michael

  • Set Session State with Shuttle items

    Is it possible to have session state set with each item selected in a shuttle? You have a shuttle with 4 possible options, you select item 2 from the left portion of shuttle and it is moved to the right.. Can you set the session state at that point?
    What I am trying to do is take the session state after change in the control and use it to populate a text field below. The returned values are used in a sql select to populate the text box with a looked up value...
    Thank you,
    Tony Miller
    Ruckersville, VA

    TexasApexDeveloper wrote:
    Won't this just push the last items value in, as apposed to appending the value?
    Tony,
    No. Because for shuttle items the return value is stored as colon delimited string.
    Means after each change you will have a colon delimited string in the session state with selected values(moved to right).
    See this http://apex.oracle.com/pls/apex/f?p=46417:47

  • How to validate a shuttle item in oracle apex

    Hello,
    I am having a shuttle item in the page . I want to validate the shuttle . am using oracle apex 3.2.1 on oracle 11g.
    I want to raise an alert if the user not selected value from shuttle else display the selected value in alert .
    please help me in resolving this issue.
    thanks
    Edited by: kumar73 on Apr 17, 2010 2:15 PM

    Hi,
    This might help
    http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/bldr_pgs.htm#sthref565
    Create item level validation Item Not Null
    Br,Jari

  • Shuttle Item in 3.1

    I noticed that since the last update I have problems with the shuttle item receiving an error
    Bad Request
    Your browser sent a request that this server could not understand.
    mod_plsql: /pls/otn/wwv_flow.accept HTTP-400 Too many arguments passed in. Got 4175 parameters. Upper limit is 2000
    Oracle-Application-Server-10g/10.1.3.0.0 Oracle-HTTP-Server Server at htmldb.oracle.com Port 80
    See this example and try to click the button "Save"
    http://htmldb.oracle.com/pls/otn/f?p=31517:166
    This example was set up under version 3.0.1 and every click was collecting the values
    shown in the table on the right side. However, since the last update this doesn't work
    any more. Is there really a limit of 2000 records per select list?
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

    Hi Carl,
    >> … it probably won't happen till next full version, since it does effect js css as well as the HTML source
    Yes, I figured as much, and next version will be fine. Thanks.
    >> Confusing is bad enough but is there an actual functional difference?
    As far as the IDs for the select list goes, If you are aware of the issue, it’s only confusing, but it will work without any changes. With the IMGs it’s a bit more complicated, and can impair functionality. In RTL mode, the ‘Move’ icon is actually pointing from the destination to the source. In the same manner, the ‘Remove’ icon is pointing from source to destination. The user, relaying on the arrow direction, can press the Remove icon, in order to select an option, and will not understand why nothing happen (or, if one of the selected options was highlighted, it will be removed). This can be worst for the user if you didn’t translate the img ‘title’ to a native language. The same effect, of course, is with the ‘Remove’ icon.
    You can check the behavior of a regular shuttle item in a RTL page in here - http://htmldb.oracle.com/pls/otn/f?p=22710:260 .
    >> just shows that listening to Scott is usually the best course of action
    I learned that a long time ago, so no argument here :-)
    Regards,
    Arie.

  • Select Unused Items Selects Too Much

    I am attempting to use Select Unused Items to delete unused
    items in my library. I am using Flash Basic 8.0.
    I have objects in my library which are Exported for run time
    sharing. These objects contain textures. Despite the fact that
    these are exported when I do Select Unused Items, it selects many
    of these "Used" textures and deletes them. If I expand the related
    movie clips and then do it again, sometimes it will stop selecting
    those items.
    I have tried "Keep Use Counts Updated". I have also tried
    "Update Use Counts Now". The same results in either case. Why would
    it be unable to maintain my Use Counts accurately?

    Well, it is definitely not working. It seems to not be able
    to tell if an item that is Exported for Runtime Sharing is used or
    not. I know for sure that it is deleting things that it shouldn't
    because:
    a) The swf size changes
    b) On some files it deletes all of the textures just leaving
    behind empty movie clips. Those movie clips are all marked as
    Export for Runtime Sharing.
    c) Some of the items that it selects actually have a Use
    Count greater than zero.
    Though the size of the flash file doesn't matter, the
    complexity does. I have inherited these files and I am trying to
    clean them up so that they will be easier to work with in the long
    run. If I have to clean them up manually it is going to be a lot
    more time consuming.

Maybe you are looking for