This discussion is archived
12 Replies Latest reply: Aug 8, 2013 1:50 PM by Nicolette RSS

Issue with a Select List in a manually created Tabbed Form

Joe R Explorer
Currently Being Moderated

Version 4.1.1.00.23

 

Hello,

 

I have a manually created Tabbed Form with a Select List to display Users. When a selection is made javascript fires to populate another Select List to show the type of User (Employee or Consultant).

 

The problem is that there can be 7,000+ active Users, which won't fit into a Select List and the Popup LOV's won't fire javascript even when using onfocus instead of onchange (I found that suggestion on some other post).

 

So, what can I do to:

1) populate a Select List with that many potential records

2)Fire the javascript to cascade the User Type to return Employee or Consultant

 

Thanks,

Joe

  • 1. Re: Issue with a Select List in a manually created Tabbed Form
    Joe Upshaw Journeyer
    Currently Being Moderated

    Well, actually, the Popup LOV does fire java script when a selection is made. It calls a method named passBack and sends in the index of the option that was clicked on. Within this passBack method, the popup window maintains a reference to the window from which it was popped up named "opener." It uses this reference to opener to set the item value in the associated column and row. For example, if I were on row one and column three, I would find the following in the passBack method:

     

    function passBack(x){

      var l_display_field = opener.$x('f03_0001');

      opener.$s('f03_0001',x);

      window.close();

      if(!(l_display_field.disabled || l_display_field.type == 'HIDDEN')){l_display_field.focus();}

    }

     

    So, in short, if you are using the built-in APEX method to make that popup, genList, then you shouldn't have to do anything special to get the item value returned to your page.

     

    The Select list has a hard 32K size limit. No way to work around that one.

     

    -Joe

  • 2. Re: Issue with a Select List in a manually created Tabbed Form
    Joe Upshaw Journeyer
    Currently Being Moderated

    You would need to explicitly construct the gentList method for each row and column for which you are suing a popup. You'd need to set this as the href for the anchor tag on the image that pops up the window. The snippet below is again for row 1 column 3.

     

     

    <a href="javascript:genList0_f03_1()"><img src="/i/f_spacer.gif"

     

     

    -Joe

  • 3. Re: Issue with a Select List in a manually created Tabbed Form
    Joe R Explorer
    Currently Being Moderated

    Joe,

     

    Thank you for replying!

     

    I'm trying to follow...I have the popup in the 4th column:

    SELECT

    ...

    || APEX_ITEM.POPUPKEY_FROM_LOV ( 4

    ,c001

    ,'LOV_RESOURCE' --Named LOV

    ,'50'

    ,'50'

    ,0

    ,NULL

    ,NULL

    ,<a href="javascript:genList0_f04_1()"><img src="/i/f_spacer.gif"

    ,'YES'

    ,NULL

    ,NULL

    ) "RESOURCE_ID"

    ...

    FROM

    ...

     

    Then in the Javascript region in the page definition:

    function passBack(x){

      var l_display_field = opener.$x('f04_0001');

      opener.$s('f04_0001',x);

      window.close();

      if(!(l_display_field.disabled || l_display_field.type == 'HIDDEN')){l_display_field.focus();}

    }

     

    How do call the passBack function and pass the row that is being modified/inserted?

    How do I create this genList for each row?

     

    Thanks,

    Joe

  • 4. Re: Issue with a Select List in a manually created Tabbed Form
    Joe Upshaw Journeyer
    Currently Being Moderated

    Hey, sorry to change gears on you but, I just noticed this...

     

    Have you seen:

     

    APEX_ITEM.SELECT_LIST_FROM_LOV_XL

     

    I think this will do exactly what you want without any popup!

     

    -Joe

  • 5. Re: Issue with a Select List in a manually created Tabbed Form
    Joe Upshaw Journeyer
    Currently Being Moderated

    To answer you question though, you can simply use rownum to generate the number for genList, e.g.


     

    'genList0_f03_' || rownum

     

     

    -Joe

  • 6. Re: Issue with a Select List in a manually created Tabbed Form
    Joe R Explorer
    Currently Being Moderated

    Joe,

     

    Thanks for the lead on the item. I'm looking into putting that into the report.

    I'll let you know how it goes.

     

    Thanks,

    Joe

  • 7. Re: Issue with a Select List in a manually created Tabbed Form
    Nicolette Expert
    Currently Being Moderated

    Joe

     

    This might also intrest you

    Modular lov for tabular form which a extention of Skillbuilders Super LOV.

     

    And something to look out for is that apex_item.popup_lov actually uses 2 fXX columns. One for the display value and one for the return value.

    It could very well be that an onchange is fired on the return value only and not on the display value.

     

    Also check if there is a gap between the fXX of the popup lov and the next item.

     

    Nicolette

  • 8. Re: Issue with a Select List in a manually created Tabbed Form
    Joe R Explorer
    Currently Being Moderated

    Nicolette,

     

    Thanks for the lead. I tried to download the update to that plug-in because it contains cascading functionality but when I tried to open it I got a message that the file is invalid. Figures...

     

    Thanks,

    Joe

  • 9. Re: Issue with a Select List in a manually created Tabbed Form
    Joe R Explorer
    Currently Being Moderated

    Joe,

     

    No luck with the APEX_ITEM.SELECT_LIST_FROM_LOV_XL.

     

    I still got: report error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small

     

    Back to trying to figure out your first suggestion.

     

    Thanks,

    Joe

  • 10. Re: Issue with a Select List in a manually created Tabbed Form
    Joe Upshaw Journeyer
    Currently Being Moderated

    I'm starting to think that the error that you see is not related to the popup LOV. Out of curiosity, if you coment out that column only, does the page load normally?

     

    I've seen this happen before when I had some back end PL/SQL that gets called form the page. Within that PL/SQL, I do something like:

     

    DECLARE

       ls_MyTooShort VARCHAR2(3);

    BEGIN

    ...

       ls_MyTooShort := 'TooLong';

     

    END;

     

    This doesn't fail until runtime.

  • 11. Re: Issue with a Select List in a manually created Tabbed Form
    Joe R Explorer
    Currently Being Moderated

    Joe,

     

    When I use a Popup LOV the values are displayed, but there's no javascript tie in for onchange. The problem is using a Select List.

     

    If I'm understanding this correctly the APEX_ITEM.SELECT_LIST_FROM_LOV_XL and other SELECT_LIST_FROM_something_XL are for columns with VALUES larger than 4000 where my problem is the quantity of rows returned. This table has 5852 rows being returned which is why, I think, I'm getting this error.

     

    I've trying to use your example with the passback, but I my javascript isn't too good and I'm having issues with using it.

     

    Thanks,

    Joe

  • 12. Re: Issue with a Select List in a manually created Tabbed Form
    Nicolette Expert
    Currently Being Moderated

    Joe

    JoeR wrote:

     

    When I use a Popup LOV the values are displayed, but there's no javascript tie in for onchange. The problem is using a Select List.

    Exactly how did you come to this conclusion?

     

    I finally found the time to set up a demonstration on apex.oracle.com.

    Demonstrating that using apex_item.popup_from_query and apex_item.popupkey_from_query do trigger the onchange event.

     

    The demonstration makes use of dynamic actions that are bind to the report columns using a jQuery selector and all fire on the onchange event.

    On the onchange of the popup values there is an alert displayed. Notice that the alert may be hidden behind the popup.

     

    Nicolette

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points