This discussion is archived
11 Replies Latest reply: Nov 1, 2009 1:23 AM by ATD RSS

Javascript error on List Manager (Popup LOV)

690572 Newbie
Currently Being Moderated
Hi all,
I have a problem with checkboxes and list managers (based on popup LOV).
I have a form containing several checkboxes and list managers; in a region of the form (the one before the last one) I have 10 checkboxes but just the first one work, the other ones give me this error when I tried to insert a record:
ORA-20001: Errore in DML: p_rowid=21, p_alt_rowid=ID, p_rowid2=, p_alt_rowid2=. ORA-20001: Valore numerico :1 non valido per la colonna EDUCATION (it's italian, the translation for the last part is "numerical value :1 not valid for the EDUCATION column).
Furthermoe, I have problems with list managers too: when I open the popup for some of them and choose the value from the popup window, I get a Javascript error: "Obejct doesn't support this property or method"; some (just some) of the list managers works.

The strange thing is that if I delete a list manager or a checkbox, another list manager or checkbox starts to work, as if it was a rule about the max total number of list manager/checkboxes.
I want to highlight that the total number of items in the form is less than 100.
Thanks a lot in advance for your help.

Cheers,
Matteo
  • 1. Re: Javascript error on List Manager (Popup LOV)
    690572 Newbie
    Currently Being Moderated
    Hi,
    anybody can help me?

    Matteo
  • 2. Re: Javascript error on List Manager (Popup LOV)
    ATD Guru
    Currently Being Moderated
    Hi,

    "numerical value :1 not valid for the EDUCATION column" could mean that EDUCATION is a foreign key pointing to a table that does not have that value as a primary key value?

    "Object doesn't support this property or method" usually means that javascript has not found the object that a variable has been set to and, therefore, it has no properties or methods available for use in the code. Does your page show any javascript errors?

    Andy
  • 3. Re: Javascript error on List Manager (Popup LOV)
    690572 Newbie
    Currently Being Moderated
    Hi Andy,
    first of all thank you for your answer!
    About the EDUCATION column problem I didn't tell you that this field is a Checkbox and didn't point to another table. The LOV of this field is "STATIC2: ;1". The typology of this field in the table is "NUMERIC".

    Thank you very much.
    Matteo
  • 4. Re: Javascript error on List Manager (Popup LOV)
    ATD Guru
    Currently Being Moderated
    Hi,

    What values do you expect the checkbox to return if ticked or unticked? Given your Source, these would either be NULL (unticked) or 1 (ticked). Are these values OK for what you are trying to do?

    For the javascript error, if this is refering to any of the checkboxes, you should note that the ID is not the same as the page item name - Apex adds a sequence number (starting from 0) to each checkbox for an item. So, item "P1_CHECKBOX1" should have an ID of "P1_CHECKBOX1_0" and for "P1_CHECKBOX2" you would get "P1_CHECKBOX2_0". If "P1_CHECKBOX3" has two checkboxes, these would be "P1_CHECKBOX3_0" and "P1_CHECKBOX3_1". If your code was referencing just "P1_CHECKBOX1", for example, it would actually find a FIELDSET tag instead (all checkboxes for an item are enclosed within a FIELDSET tag) and this would not have the same properties as a checkbox - so that could explain the error message

    Andy
  • 5. Re: Javascript error on List Manager (Popup LOV)
    690572 Newbie
    Currently Being Moderated
    For the first question it's OK the return values.
    Null unticket e '1' ticket.
    For the second part you say "your code", I actually didn't write any javascript code, I just used the APEX automatic form creation and I had the javascript problem with List Manager PopUp.

    Matteo
  • 6. Re: Javascript error on List Manager (Popup LOV)
    ATD Guru
    Currently Being Moderated
    Hi,

    How many List Manager items do you have on your page? How many checkbox page items and how many checkboxes are shown for each item?

    I think I would have to set up an example so that I can see what may be happening.

    Andy
  • 7. Re: Javascript error on List Manager (Popup LOV)
    690572 Newbie
    Currently Being Moderated
    21 List Manager item and 17 single CheckBoxes. All the checkboxes are single, so one checkboxes per Item.

    Matteo
  • 8. Re: Javascript error on List Manager (Popup LOV)
    ATD Guru
    Currently Being Moderated
    Hi,

    OK - I've set up a page with all those items on it - it's a bit crowded, but here it is: [http://apex.oracle.com/pls/otn/f?p=33642:222]

    This is based on a very simple table that has a primary key, 21 VARCHAR2(1000) items called LMnn for each List Manager and 17 NUMBER items called CBnn for each Checkbox. The List manager is just based on my EMP table and the checkboxes are all based on your STATIC2: ;1 setting.

    As far as I can see, everything works and saves correctly. I have only one record on my table, so the page loads and saves to that record.

    So, there doesn't seem to be a problem with having that many List Managers and/or checkboxes on the page. This makes me think that it's the actual data that may be a problem. Do any of your List Manager items return data that includes characters that are not numbers or letters? What is the longest page item name you have and are all page item names letters, numbers and/or underscores only?

    Andy
  • 9. Re: Javascript error on List Manager (Popup LOV)
    690572 Newbie
    Currently Being Moderated
    Hy Andy,
    I apologise if I answer only now but I was unable to connect to internet in these weeks.
    I'm going to answer to your question:
    - Every one of my list manager item return a numeric values.
    - The longest item that I have in my page is this: P58_MEAS_PARAMETERS_PEST_TXT
    - All of my item name are only letters, number and underscore, nothing else.

    Thank you again
    Matteo
  • 10. Re: Javascript error on List Manager (Popup LOV)
    ATD Guru
    Currently Being Moderated
    Hi,

    OK - it sounds as though there is something on your page that is not being rendered correctly either by Apex or by the browser. Most likely, given the javascript error you got, there is an ID that is not being found. As my example page works without a problem, it would seem that one or more of the List Manager items is being corrupted in some way. Without being able to see your page it would be very difficult for me to spot what is happening. Probably the easiest thing would be to load the page and do a View Source on it. Save the source as a text file and then email that to me at .......................

    Andy
  • 11. Re: Javascript error on List Manager (Popup LOV)
    ATD Guru
    Currently Being Moderated
    Hi,

    The issue is because Apex actually generates TWO items for each List Manager items and both of these count towards the maximum of 100 items per page. As an example - this is ONE list manager item from my test page:
    <fieldset id="P222_LM1" class="listmanager">
    <table cellspacing="0" cellpadding="0" border="0" summary="">
    <tbody>
    <tr>
    <td>
    <noscript>
    JavaScript not supported
    
    </noscript>
    
    <script type="text/javascript">
    
    <!-- 
    
     function filter_escape(in_value) {
                out_value = escape( in_value );
                return out_value;
            }
            function genList0_p_v99_()
             {
               w = open("wwv_flow_utilities.gen_popup_list" +
                           "?p_filter="  +
                           "&p_name=" + escape('p_v99') +
                           "&p_element_index=" + escape('') +
                           "&p_form_index=" + escape('0') +
                           "&p_max_elements=" + escape('') +
                           "&p_escape_html=" + escape('') +
                           "&p_ok_to_query=" + escape('YES') +
                           "&p_flow_id=" + escape('33642') +
                           "&p_page_id=" + escape('222') +
                           "&p_session_id=" + escape('2926501920944144') +
                           "&p_eval_value=" + escape('') +
                           "&p_translation=" + escape('NO') +
                           "&p_item_id=" + escape('6753181500127769527') +
                           "&p_lov=" + filter_escape('6753181500127769527') +
                           "&p_lov_checksum=5D6157CA388C164818106815D15EFFC6",
                           "winLovList",
                           "Scrollbars=1,resizable=1,width=400,height=450");
               if (w.opener == null)
                 w.opener = self;
               w.focus();
             }
    //-->
    
    </script>
    <fieldset id="P222_LM1_ADD_fieldset" class="lov">
    <table cellspacing="0" cellpadding="0" border="0" id="P222_LM1_ADD_holder" class="lov" summary="">
    <tbody>
    <tr>
    <td class="lov">
    <input type="text" id="P222_LM1_ADD" value="" maxlength="2000" size="27" name="p_v99"/>
    </td>
    <td>
    <a href="javascript:genList0_p_v99_()">
    <img width="13" height="13" alt="Popup Lov" src="/i/list_gray.gif"/>
    </a>
    </td>
    </tr>
    </tbody>
    </table>
    </fieldset>
    
    </td>
    <td>
    <input type="button" onclick="appendToList(document.forms[0].p_v99.value.toUpperCase(), document.forms[0].p_v02);document.forms[0].p_v99.value=''" value="Add" name=""/>
    <input type="button" onclick="deleteListElement(document.forms[0].p_v02)" value="Remove" name=""/>
    </td>
    </tr>
    <tr>
    <td colspan="2">
    
    <select id="P222_LM1_LISTMGRDATA" width="225" multiple="multiple" size="10" prompt="" name="p_v02">
    <option>8021
    </option>
    <option>8001
    </option>
    </select>
    <script type="text/javascript">
    
    <!-- 
    gUtil.select.clean(document.forms[0].p_v02);
    //-->
    
    </script>
    </td>
    </tr>
    </tbody>
    </table>
    </fieldset>
    Note that the popup item is p_v99 and the list item is p_v02.

    Question to the Apex developers:

    Given that the popup item does not really need to be submitted with the page, could this not use a different naming convention?

    Andy

Legend

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