3 Replies Latest reply: Jul 24, 2012 8:59 AM by Becky RSS

    Shuttle Extender

    Becky
      I am using the following
      Apex 4.1.1
      Oracle 10.2

      The requirement is to add POCs on the Fly to the shuttle.
      When I enter text and press the green plus sign the text disappears but is not displayed anywhere (left or right side of the shuttle).

      I installed the Shuttle Extender from http://www.apex-plugin.com/oracle-apex-plugins/item-plugin/shuttle-extender_145.html.
      It imported just fine.
      I created a page item P2_NEW_POC and selected Shuttle Extender [Plug-in] for the Display As
      I selected Shuttle Item P2_POC.
      The item P2_POC does not contain an LOV.
      What am I doing wrong?

      Thanks,
      Becky
        • 1. Re: Shuttle Extender
          Becky
          Since no one has answered I decided to write some javascript to populate the right side and need some help.
          Shuttle item is P2_POC
          Text field is P2_NEW_POC

          I created the following javascript function to insert the new POC into the table
          function addPocShuttle(pThis,pShuttle);
          {
             lThis = $v(pThis);
             lShuttle = pShuttle
             //Insert new value into the POC_CODE table
             var get = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=addPocShuttle',2);
             get.addParam('x01',lThis);
             gReturn = get.get();
          
             //Populate the right side of the shuttle
             $x_Value(lShuttle,lThis);
               
          }
          The on-demand code is
          Declare
             l_poc poc_code.poc%Type;
          Begin
             owa_util.mime_header('text/html',FALSE);
             Htp.p('Cache-Contol: no-cache');
             Htp.p('pragma: no-cache');
             owa_util.http_header_close;
             l_poc := wwv_flow.g_x01;
             Insert Into poc_code(poc)
             Values(l_poc);
             Commit;
             Htp.p(l_poc);
          End;
          The on-demard process does insert the value into the table, but there is nothing on the right side of the shuttle. I also need help to preserve any prior selections in the shuttle.

          In the P2_NEW_POC Element --> HTML Form element Attributes contains the following:
          onchange="addPocShuttle(this,'P2_POC_RIGHT');"
          • 2. Re: Shuttle Extender
            evrm
            Hi,
            //Populate the right side of the shuttle
            $x_Value(lShuttle,lThis);
            >

            the $x_Value function does set the value of some item but this isn't working on a select list because it has no real value.
            You have to add an extra option element to the select list like this:
            $('#' + lShuttle).append($('<option>', { value : lThis}).text(lThis))
            regards,
            Erik-jan
            • 3. Re: Shuttle Extender
              Becky
              Erik-jan,

              I would have never figured that out!! It worked!! Thanks so much!
              Becky