0 Replies Latest reply: Apr 23, 2013 7:01 PM by Gor_Mahia RSS

    shuttle filter - help

    Gor_Mahia
      All,
      I ve tried to create a shuttle with filter text field so as you type values in the text fields it filters the content of the shuttle on the left side but its not working. Below is what i did.
      JS:
      function populateShuttle(filter,shuttleName)
      {
        var left = $x(shuttleName+"_LEFT");
        var right = $x(shuttleName+"_RIGHT");
      
        for ( var i=0;i<right.length; i++ )
          right.options.selected = true;

      var req = new htmldb_Get( null, &APP_ID.,
      'APPLICATION_PROCESS=populateShuttle', 0 );

      req.addParam( 'x01', $v(right) );
      req.addParam( 'x02', $v(filter) );

      var resp = eval(req.get());

      left.length=0;

      if (resp)
      for ( var i=0; i<resp.length; i++ )
      left.options[i] = new Option(resp[i].data, resp[i].id);

      req = null;
      }

      then ON-DEMAND PROC:
      declare
      l_selected long := wwv_flow.g_x01;
      l_search long := wwv_flow.g_x02;
      begin
      htp.prn('[');
      for c in (
      select ename, empno, rownum r
      from emp
      where regexp_like( ename, nvl(l_search,ename), 'i' )
      and nvl(instr(':'||l_selected||':',':'||empno||':'),0)=0 )
      loop
      htp.prn( case when c.r>1 then',' else null end ||
      '{ id: ' || c.empno ||
      ', data: "' || c.ename || '"}' );
      end loop;
      htp.prn(']');
      end;

      then in the item, i called JS function like--> onKeyUp="populateShuttle( this,'P10_SHUTTLE');"
      using apex 4.1.1 and 4.2 , 
      
      where could i be wrong?  any help on this please.....thanks and regards.