Problem with APEX_ITEM.DATE_POPUP

Hi All,
I have a date column in IR,
APEX_ITEM.DATE_POPUP (12,1,null,'DD-Mon-YYYY','','','id="sdate'||rownum||'"') "ISSUE_DATE",
When I use this syntax the date which I already has is not displaying in the date field, and when I trying to click the icon the date is not get selected
Anybody is having any idea?
Thanks,
Suma.

Hello,
Check this for usage of the function :- http://www.utoug.org/i/doc/api085.htm#CHDFDDEI
This is an example of the usage.
SELECT
  empno,
  APEX_ITEM.HIDDEN(1,empno)||
  APEX_ITEM.TEXT(2,ename) ename,
  APEX_ITEM.TEXT(3,job) job,
  mgr,
  APEX_ITEM.DATE_POPUP(4,rownum,hiredate,'dd-mon-yyyy') hd,
  APEX_ITEM.TEXT(5,sal) sal,
  APEX_ITEM.TEXT(6,comm) comm,
  deptno
FROM emp
ORDER BY 1As you can see <b>HIREDATE</b> is a column of the table <b>EMP</b> Also, please note Usage of <i>rownum</i> has no purpose, as the argument is deprecated.
Don't think you are calling the function properly. you can try the function call intially from SQL Developer /SQL Plus and see if it generates the correct HTML Code.
If you still have problems, try updating your thread with more Information like TABLE structure and the complete query you have put in the report,some one can help.
Hope this helps.
Thanks,
Chaitu.

Similar Messages

  • Problem with apex_item.date_popup in APEX 3.1

    Hi,
    I encountered a problem with the date_popup item after installing APEX3.1, probably someone can tell me if I am doing something wrong or if it is a sequel bug of 3.0.
    I have a form with a manually generated region displaying a row with different kinds of input fields for every entry in a look up table. So there may be 5 rows to enter values or 30.
    There are two date_popup fields in each row (id x and y), therefore it is not possible to give each of these popup-fields a unique id as it would exceed the limit of 50.
    The problem is the same as in version 3.0 and before: when I select a date, let's say in the popup with id x row 6, it will allways show up in the first date_popup-field with id ix. The same for the fields with id y.
    I solved the problem in 3.0 by adding an id-attribute with a unique name in html and replacing some values in the html-output. This helped distinguishing the different fields.
    But with 3.1 there ist already an id-attribute (apex_date_11, 11 representing the column)
    <input type="text" name="f11" size="15" maxlength="10" value="" id="P4_foo_2" style="margin-right:5px;" id="apex_date_11" />
    which is referenced by the javascript-function of the popup.
    Every popup either has the value apex_date_11 or apex_date_12.
    This disrupts my work around from version 3.0.
    The only solution that I see to get it working again is to replace or add a unique identifier to the input-id as well as to the function call, like apex_date_11_i.
    Maybe there is another solution to distinguish the different date-fields, like setting the row attribute, which does not work.
    Thanks in advance,
    Alex

    Hello,
    Can you put an example on apex.oracle.com , see if we can help you out.
    What has happened is we have tried to make items and their outputs more consistent across the product. This includes things like auto generation of ID's based on item names, fieldset's around compound items etc, looks like the auto generation of ID's is getting you here.
    Sorry for the trouble.
    Regards,
    Carl
    blog : http://carlback.blogspot.com//
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • Possible bug with APEX_ITEM.DATE_POPUP

    Hello,
    APEX 3.1 (and maybe even some previous versions).
    It seems like APEX_ITEM.DATE_POPUP creates all the cells in the corresponding column with the same ID. The result is that the dates returned by every date picker, in all the rows of the column, are being placed only in the first row cell.
    I searched the forum, and found couple threads describing the problem, but nothing from the APEX team acknowledging a bug. Is it a bug? If so, and if it’s not already logged, can someone from the APEX team log it as one?
    Thanks,
    Arie.

    Hi Arie,
    Thanks for you reply i dont get any error msg here in date picker the only problem wht i am facing here is when i deploy the java script date picker is not working
    Please suggest me how to modify the existing code
    this is function wht i am calling in the date picker
    <script type="text/javascript">
    function checkdates_baseline(pStartDateItem,pEndDateItem)
    var sdate = document.getElementById(pStartDateItem).value;
    var edate = document.getElementById(pEndDateItem).value;
    if(sdate != "" & edate != "")
    var m2int = {
    Jan: 0,
    Feb: 1,
    Mar: 2,
    Apr: 3,
    May: 4,
    Jun: 5,
    Jul: 6,
    Aug: 7,
    Sep: 8,
    Oct: 9,
    Nov: 10,
    Dec: 11 };
    var start_year = sdate.substring(7,11);
    var start_month = sdate.substring(3,6);
    var start_day = sdate.substring(0,2);
    var start_date = new Date(start_year, m2int[start_month], start_day);
    var end_year = edate.substring(7,11);
    var end_month = edate.substring(3,6);
    var end_day = edate.substring(0,2);
    var end_date = new Date(end_year, m2int[end_month], end_day);
    if( end_date <= start_date )
    alert('The End date must be after the Start Date Baseline');
    document.getElementById(pEndDateItem).value = "";
    </script>
    and this is the SQL query where i am using and deployed the java script
    SELECT
    HTMLDB_ITEM.DATE_POPUP(3,1,null,''DD-Mon-YYYY'',10,8,
    '' id="sdate''||rownum||''" readonly="yes"
    onchange="checkdates_baseline(''''sdate''||rownum||'''''',''''edate''||rownum||'''''');"'')
    "Baseline Start",
    HTMLDB_ITEM.DATE_POPUP(4,2,null,''DD-Mon-YYYY'',10,15,
    '' id="edate''||rownum||''" readonly="yes" onchange="checkdates_baseline(''''sdate''||rownum||'''''',''''edate''||rownum||'''''');"'') "Baseline End"
    FROM
    DUAL
    please suggest with a code or a example how to change this, in apex 3.1
    thanks
    Sudhir

  • Subject: Problem with apex_item.POPUPKEY_FROM_QUERY

    Hi,
    Im using apex_item.POPUPKEY_FROM_QUERY in manual tabular form,but facing problem with return value.Return value from popup always reflects in first row,not in the active row where popup window is pressed.
    My query is like this :
    ===============
    apex_item.POPUPKEY_FROM_QUERY(3,Ename,'Select Ename display,Ename return from Emp',
    15,30,0,null,null,'disabled="disabled"','YES')
    ===============
    When modified as bleow, the value is returned randomly between rows
    apex_item.POPUPKEY_FROM_QUERY(3,Ename,'Select Ename display,Ename return from Emp',
    15,30,0,'Emp_Picker'||rownum,null,'disabled="disabled"','YES')
    How can I resolve this ?
    Regards,
    Benz

    Benz - Are you using column sorting also in the report? That will cause this problem.
    Scott

  • Apex_item.date_popup giving ORA-01403: no data found

    Hi,
    I'm having a problem with apex_item.date_popup(). We're using apex 4.0.2.
    The apex_item.text and apex_item.select_list_from_query are working fine.
    I have a table "dba_comp_veld". Querying this table it gives:
    select COMP_VELD_ID, COMP_VELD_NAAM, COMP_VELD_TYPE, COMP_VELD_TYPE_POPUP, COMP_VELD_TYPE_DATE from dba_comp_veld where comp_id = 81;
    COMP_VELD_ID COMP_VELD_NAAM COMP_VELD_TYPE COMP_VELD_TYPE_DATE
    81 SID T
    82 Poort T
    85 Owner T
    83 Server P
    84 Alias T
    86 Rdbms T
    101 Datum D 20-APR-11
    So, when the COMP_VELD_TYPE = D then I want to user apex_item.date_popup.
    In the page-region (PL/SQL) the source is:
    declare
    nServer number;
    BEGIN
    select min(server_nummer) into nServer from dba_servers;
    for rec in (select COMP_VELD_ID, COMP_VELD_NAAM, COMP_VELD_TYPE, COMP_VELD_TYPE_POPUP, COMP_VELD_TYPE_DATE from dba_comp_veld where comp_id = 81)
    LOOP
    htp.prn(rec.comp_veld_naam||' :');
    case rec.comp_veld_type
    when 'T' then
    htp.prn(APEX_ITEM.TEXT(rec.comp_veld_id, ' ') );
    when 'D' then
    htp.prn(APEX_ITEM.DATE_POPUP(rec.comp_veld_id,'',rec.COMP_VELD_TYPE_DATE,'DD-MON-YY') );
    when 'P' then
    case rec.COMP_VELD_TYPE_POPUP
    when 'DBA_SERVERS' then
    htp.prn(APEX_ITEM.SELECT_LIST_FROM_QUERY(rec.comp_veld_id,nServer,'SELECT NAAM d, server_nummer r FROM dba_servers order by 1',null,'NO'));
    else null;
    end case;
    else null;
    end case;
    htp.prn('
    END LOOP;
    END;
    All the items are displayed ok, except the DATE_POPUP(). I'm getting a ORA-01403: no data found.
    Why? the field rec.COMP_VELD_TYPE_DATE is having a date-value.
    reg.
    Chris
    Edited by: J3v16 on 20-apr-2011 23:43

    Hi Hari,
    I'm just checking my Ayuthentication Scheme (instead of my Authorization scheme) and it seems to be the origin of the "no_data_found" message.
    The thing is that we make a Validation against one internal user table wich defines the office where the user work. That table had the username in lowercases and even the user wrote its username in the login page, using lowercases, the SELECT returned an "no_data_found".
    If the username field in our table is un UPPERCASE, the same function, typing the username in lowercase, returns OK.
    Thanks a lot for your interest
    Agustin

  • APEX_ITEM.DATE_POPUP problems in 3.1 (already visible in 3.0)

    Hello Everybody,
    I'm completely new to the forum and not sure if you discussed that before... Sorry and please ignore my message if that is the case.
    My development using SQL reports based on collections is blocked because of problems with a date picker generated by apex_item.date_popup call.
    I created a small application illustrating the problem:
    http://apex.oracle.com/pls/otn/f?p=21782:1
    The first two reports presented there are based on sql based on the collection:
    select apex_item.display_and_save(1,c001) name
    ,apex_item.date_popup(2,rownum,to_date(c002,'DD-MM-YYYY HH24:MI:SS'),'DD-MM-YYYY HH24:MI:SS',20,19) hiredate
    from apex_collections
    where collection_name = 'TESTCOL'
    In the first case date popup allows to open a new window but you cannot return value to the field.
    I discovered (second case) that when you change format to 'DD-MM-YYYY' and call API like follows : apex_item.date_popup(2,rownum,to_date(c002,'DD-MM-YYYY HH24:MI:SS'),'DD-MM-YYYY',20,19)
    then the value is returned to the field. However in this case it is returned to the wrong row !!!!!! It looks like it is confused by sorting.
    I explained the steps in the application itself to illustrate it.
    Can anybody help ?
    Piotr

    Scott, Thanks for you kind answer. I had a look at the application that you indicated: 19508.
    Unfortunately I cannot use the solution.
    You propose to define a date picker at the report level. Of course it works in this simple
    application, however my real application generates (depending on data) different item types
    for the same column. For example one row of that column can have apex_item.date_popup and
    the other has apex_item.display_and_save.
    Performing sorting during "create_collection_from_query_b" is not good for me neither (in my
    application I have possibility of adding rows which I commit afterwards). In that case I tried to sort the collection using APEX_COLLECTION.SORT_MEMBERS but then .... I could
    sort only on one column and I need of course more than one ...
    For a moment a can see only one solution: to write my own calendar (and other POPUP functions) returning value to the APEX_ITEM.TEXT. Of course it's a lot of work .... for a workaround.
    Are there any plans at Oracle to fix that "long-standing" issue ?

  • APEX_ITEM.date_popup does not update proper row with column sorting on

    I have the following example sql report query on a page:
    select rownum rowno, object_name
    , object_type
    ,APEX_ITEM.date_popup(43, null, created, 'DD-MON-RR',9) date_created
    from user_objects
    This works fine when I tried to update the date if no sorting is involved. If I allow sorting in APEX by clicking the column headings, the row numbers no longer match up with the the displayed rows. So in order words, if I had the following
    Row MyCol Date
    1 Z
    2 B
    3 K
    If I enabled sorting and click the MyCol column heading, then the following would result:
    Row MyCol Date
    2 B
    3 K
    1 Z
    If I then enter a date for the first displayed row, MyCol=B, then it will update the MyCol=K row because it goes by rownum and it thnks it is rownum=2 where MyCol=B.
    This use to work by putting in a unique id column instead of null for the 2nd parameter to the API. The latest doc says that parameter is depracated and this no longer works. It seems to always go by rownum, and therefore won't work with sorting.
    Any workaround or suggestions?
    We need to have a query similar to above, with sorting enabled on a number of columns and then have a custom PL/SQL process called when the submit button is pressed. It would reference the date column as APEX_APPLICATION.G_F43(I) in this example.
    It used to work. Has this functionality been removed?

    rwessa,
    Right now, there is no reasonable workaround for this immediate issue of using APEX_ITEM.DATE_POPUP in your query and sorting via PPR. The problem is that the generated JavaScript as part of APEX_ITEM.DATE_POPUP is generated at query execution time and then sorted by the reporting engine afterwards (via AJAX/Partial Page Refresh).
    About the only workarounds I can suggest are to disable column-heading sorting for the SQL-based report. If you want sorting, implement sorting via a select list and then use a region type of PL/SQL function returning query, where you append the ORDER BY clause to the SELECT statement. You may also wish to investigate using regular reports (and changing the Display As of the column) or using tabular forms, which would not exhibit this behavior.
    I hope this helps.
    Joel

  • Error (ORA-01403) saveing data form a report with apex_item items

    Hi all,
    I've a problem saveing data that's inserted into a report which I created using apex_item items. Reproducing the exact issue on apex.oracle.com will take me a lot of time, and I don't know if I really can reproduce this matter... So I hope I can explain my problem clearly enough, here...
    The global story of the application is that its an application used for measureing objects. For these objects there are templates, with default properties. When measureing an object, the user must fill in those properties for the object. The report is build dynamicly, becouse each object has different properties and each property could be of an other kind (number, text, list, counter [=number field with add and substract buttons], and date). Depending on the type of the property, the report has to show an other item to fill.
    The query for constructing this report is like this:
    select defprop.proptyp_id,
    apex_item.hidden(41,defprop.id) defprop_id,
    defprop.nam,
    decode(proptyp.id,
                    1, apex_item.text(p_idx=>42,p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
                     ||'' ,p_attributes=>'class=case5_num'),
                    2, apex_item.text(p_idx=>42,p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
                     ||''),
                    3, apex_item.select_list_from_query(p_idx=>42,p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
                     ||'', p_query=> 'select wrd, id from property_typewrd where proptyp_id = ' || proptyp.id ||' order by vlgnum', p_show_null=> 'NO'),
                    4, apex_item.text(p_idx=>42,p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
                     ||'',p_attributes=>'class=case5_num')
                    || '<a name="add_f02" href="#"><img alt="add" src="#WORKSPACE_IMAGES#plusBig.gif"/></a>    '
                    || '<a name="sub_f02" href="#"><img alt="sub" src="#WORKSPACE_IMAGES#minusBig.gif"/></a>',
                    5, apex_item.date_popup(p_idx=>42, p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
                     ||''),
                    oms
                ) waarde
    from default_property defprop,
    object_instance obj,
    property_type proptyp
    where defprop.stdobjver_id = obj.stdobjver_id
    and defprop.proptyp_id = proptyp.id
    and obj.id = :P2200_ID_INVThis report works fine. Depending on the type of the property it shows a numberic field, text field, selectlist (with right values), counter field or date field.
    If the default property is set to a 'CONSTANT' value, the last known value is filled in.
    With a javascript I check the numberic field value and achieve the counterfield to add or substract values when 'plus' or 'minus' is clicked.
    This javascript is placed in the field 'Execute when Page Loads' in the page properties in APEX. Here is the code:
    /*Execute when page loads*/
    /*Allow only numbers */
    number_elem = $('input[name=f42].case5_num');
    number_elem.keypress(function(event) {
      if (event.which && (event.which < 46 || event.which > 57 || event.which == 47) && event.keyCode != 8) {
          event.preventDefault();
      if (event.which == 46 && $(this).val().indexOf('.') != -1) {
          event.preventDefault();
    //for mouse events, remove any non numeric characters
    number_elem.bind('mouseup mousedown mouseleave', function(event) {
       this.value = this.value.replace(/[^0-9]/g, '');
    /* Subtract Button */
    $('a[name="sub_f42"]').click( function() {
      number_elem = $(this).siblings('input[name=f42].case5_num');
      currVal = number_elem.val();
    if ( isNaN( currVal) ){
       elemVal = 0;
    else {
       elemVal = Number(currVal);
    if (elemVal > 0)
         number_elem.val(elemVal-1);
    else
    { elemVal = 0; }
    /* Add Button */
    $('a[name="add_f02"]').click( function() {
      number_elem = $(this).siblings('input[name=f42].case5_num');
      currVal = number_elem.val();
    if ( isNaN( currVal) ){
       elemVal = 0;
    else {
       elemVal = Number(currVal);
    number_elem.val(elemVal+1);
    });Those two codes makes my report works fine. So far I'm happy. But now I want the data, which the user fills in the items, to be saved.
    So I created a process that should do this for me (it wil run after the user hits a button), here is the code:
    declare
         v_objmet_id number := 0;     
    begin
         select measurment_seq.nextval
         into v_objmet_id
         from dual;
         insert into measurment
         ( id
         , obj_id
         , dat
         values
         ( v_objmet_id
         , :P2200_ID_INV
         , :P2200_METDAT_INV
         /*Loop trough the values (g_f42 holds the value of the property)*/     
         for i in 1 .. apex_application.g_f42.count loop
              /*g_f41 holds the key to the default property*/
              if apex_application.g_f41(i) is not null and
                   apex_application.g_f41(i) > 0 then
                   insert into measurment_prop
                   ( measrument_id
                   , defprop_id
                   , wrd)
                   values
                   ( v_objmet_id
                   , apex_application.g_f41(i)
                   , apex_application.g_f42(i)
              end if;
         end loop;
    end;After running this process, the application branches back to the page, clearing the cache and set some items I use for filtering an other report with their own values.
    Both the process and the branche have a 'when button pressed' condition, where the same button is filled in. The branche fires on submit: after processing.
    When I hit the button to save the data, I get an error: ORA-01403: no data found
    In the debug info I can find there is encountered an unhandeled exception in the process, but I don't know what's going wrong...
    I thought it could be something with the date field, I want to save, so I put it in a to_date() with the right format, but I still got the error...
    I've also checked if the query which fetches the nextval of the sequence is correct, and it is, no typeing error in the sequence name, or something.
    I'm using APEX 4.0.2
    Edited by: Mir on 28-jun-2011 10:25
    Changed some code of the javascript, it directed to the wrong item ID, now its correct

    My problem is solved. The error occured when application item g_f41 was accessed, so my application couldn't find the data, the user putted in there. I now pasted this part of the sql, to the other apex_item field, so it became one field and now it works correctly:
    select [...]
    apex_item.hidden(41,defprop.id) ||
    decode(proptyp.id,
                    1, apex_item.text(p_idx=>42,p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
    [... etc ...]

  • Ajax Report Pull APEX_ITEM.DATE_POPUP  issue

    Hi all,
    I am trying to use something similar to Carl's Ajax Region Pull
    http://htmldb.oracle.com/pls/otn/f?p=11933:48:1222899842354681::NO:::
    So I have 2 pages. My LOV on Page 4 has an onchange event to trigger an Ajax call to page 5 which then displays the results in a region on Page 4.
    Now I am using apex_item calls to allow entry into the report on page 5. Problem is, when I have a date entry item where I have to use apex_item.date_popup then I get a javascript error similar to "genCalf01_0 is not defined" when I click on the date icon to popup the calendar.
    On my instance at work this error is only with the second date field but the first is fine. However on apex.oracle.com, both date icons trigger the problem.
    Any ideas? I have put a sample on http://apex.oracle.com/pls/otn/f?p=38748:4:2006073124664781:::::
    workspace: abots
    username: test
    password: apex_test.
    Cheers
    Kofi

    Hello,
    Using the built in form items pulled from ajax can cause alot of problems and is discouraged. In most cases when you pull a form item from one page into another page it will break your page when you try and submit it.
    Now with the date pickers there is an even bigger issue because there is also embedded individual javascript's associated with each datepicker and when you pull them into the page the page DOM will not pick them up.
    Regards,
    Carl
    blog : http://carlback.blogspot.com/
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • Problems with customizing select lists and popup LOVs

    Hi
    I have 2 problems about select lists and popup LOVs.
    The first one is about a select list in a tabular form.
    It should be created with APEX_ITEM.SELECT_LIST_FROM_LOV or similar and take its values from a named LOV.
    This worked fine but now it should also have the possibility to enter a free value.
    I tried to accomplish that by creating a APEX_ITEM.POPUP_FROM_LOV, but there is a problem with the function that is called by the arrow icon right to the input field (for eg. genList_f11_5()).
    If the row is added by addRow, then it works fine, but if the row is is not empty
    then the function call is like genList_f11_$_row() and the input field gets no value, when a LOV option is selected.
    The other problem is about a select list which should have the possibility to enter a custom value and
    also there should be the possibility to select several values. I tried to implement this by a text area containing the selected values and a multiple select list, with an event handler in each option. The user could click options and they would be copied to the text area. The problem is that I couldn't make the event handler work in IE.
    I would appreciate any ideas about either of these problems.
    Tiina

    Hi,
    If you download application you can see source.
    I have not write any instructions, sorry.
    If you are on Apex 4 you can just load jQuery UI autocomplete library and take ideas from my app.
    If you download my sample in zip there is uncompressed htmldbQuery library.
    You can see that and take only function htmldbAutocomplete.
    Then check jQuery UI document
    http://jqueryui.com/demos/autocomplete/#method-search
    There is method search that you can use open list just by click of input.
    I hope this helps at start.
    Regards,
    Jari

  • APEX_ITEM.DATE_POPUP javascript error

    Hi there
    I have a dynamic report I have built where the date popup has stopped working.
    The date popup works fine for other form fields in other regions on the page but within my dynamic sql report region the javascript is erroring when clicing on the calendar image.
    The Apex version is 2.2.
    The code in the dynamic report is: APEX_ITEM.DATE_POPUP(5,rownum,action_date_time,'dd-MON-RR',9) action_date_time
    The Jscript error is basically: document.forms.0.f05.length is null or not an object.
    The input object in the HTML source is: <input type="text" name="f05" size="9" maxlength="2000" value="03-OCT-06" style="padding-right:5px;" />
    And the Jscript which refers to it is immediately after:
    function genCalf05_0()
    elemArrLen = 0;
    if (document.forms[0].f05.length) {
    elemArrLen = document.forms[0].f05.length;
    ... etc...

    I have discovered why the calendar control is not working -
    As a customisation I included another <form> tag in the menu which is interfering with the popup (forms[0]).
    I may need to look into either doing my customisation a different way (it is above the standard form tag in the menu) or see if I can write some type of custom calendar popup.
    When the calendar control in the actions region is built - some javascript is written by APEX which I have no control over - it looks like
    " if (document.forms[0].f05.length) {
    elemArrLen = document.forms[0].f05.length;
    }"

  • APEX_ITEM.DATE_POPUP  and ORA-01830: date format picture ends before conver

    Hi,
    I am using apex_item.date_popup for a custom tabular form.
    When I load the form with the default sysdate it works ok. However when the user submits an invalid date I get: ORA-01830: date format picture ends before converting entire input string.
    Ex: apex_item.date_popup (2, NULL, ac.my_date, :f_date_format, LENGTH (:f_date_format), LENGTH (:f_date_format),NULL)
    Where f_date_format is 'DD-MON-YYYY'...
    If I enter 'abc' in this field and click submit, my validations find that it is an invalid date, so I reload the page with ac.my_date is the value that the user entered (ex: 'abc'). This will cause the error...
    I understand why the error occurs, but is it correct that it does happen? Any ways around this?
    Thank you.

    Hi Scott,
    I found the work around. I'll try to make this code more readable later on.
    1: Create a HTML region with the following code:
    Note: F02 is the "Column" for my date field:
    <script type="text/javascript">
    function genCalF02(pRowNum,pYyyy,pMm,pSecurityGroupId)
    elemArrLen = 0;
    if (document.forms[0].f02.length) {
    elemArrLen = document.forms[0].f02.length;
    elemArrLen = '&F_DATE_FORMAT.'.length;
    pMm = '' + pMm;
    if (pMm.length == 1)
    pMm = '0' + pMm;
    w = open("wwv_flow_utilities.show_as_popup_calendar" +
    "?p_element_index=" + escape('f02' + '['.substr(0,elemArrLen) + pRowNum + ']'.substr(0,elemArrLen)) +
    "&p_form_index=" + escape('0') +
    "&p_date_format=" + escape('&F_DATE_FORMAT.') +
    "&p_application_format=" + escape('Y') +
    "&p_bgcolor=" + escape('#666666') +
    "&p_dd=" + escape('') +
    "&p_hh=" + escape('') +
    "&p_mi=" + escape('') +
    "&p_pm=" + escape('') +
    "&p_yyyy=" + escape(pYyyy) +
    "&p_lang=" + escape('') +
    "&p_application_id=" + escape('&APP_ID.') +
    "&p_security_group_id=" + escape(pSecurityGroupId) +
    "&p_mm=" + escape(pMm),
    "winLov",
    "Scrollbars=no,resizable=no,width=258,height=210");
    // TODO "?p_element_index=" + escape('f02' + '['.substr(0,elemArrLen) + pRowNum.substr(0,elemArrLen) + ']'.substr(0,elemArrLen)) +
    if (w.opener == null)
    w.opener = self;
    w.focus();
    </script>
    In you're query (or how ever else you are calling apex_item.date_popup)... use something like this instead:
    WHEN is_valid_date(my_date) = 'Y' THEN
    apex_item.text (2,
    my_date,
    LENGTH (:f_date_format),
    LENGTH (:f_date_format),
    NULL,
    NULL,
    NULL
    ) || '<a href="javascript:genCalF02(' || (ROWNUM - 1) || ',' || TO_CHAR (TO_DATE (my_date, :f_date_format), 'YYYY') || ','
    || TO_CHAR (TO_DATE (my_date, :f_date_format), 'MM') || ',' || apex_custom_auth.get_security_group_id
    || ')"><img src="/i/asfdcldr.gif" align="middle" alt="Calendar"/></a>'
    ELSE
    apex_item.text (2,
    my_date,
    LENGTH (:f_date_format),
    LENGTH (:f_date_format),
    NULL,
    NULL,
    NULL
    ) || '<a href="javascript:genCalF02(' || (ROWNUM - 1) || ',' || TO_CHAR (SYSDATE, 'YYYY') || ','
    || TO_CHAR (SYSDATE, 'MM') || ',' || apex_custom_auth.get_security_group_id
    || ')"><img src="/i/asfdcldr.gif" align="middle" alt="Calendar"/></a>'
    END as xxx
    This creates the text box with a date popup window beside it.
    Again, this is not pretty code which can probably be done in a function etc.
    Hope this helps anyone else who has the same issue.
    Martin

  • Question about APEX_ITEM.DATE_POPUP

    I have simple question that perhaps some one can help me with.
    I'm using a APEX_ITEM.DATE_POPUP to create a date field in a row of data. according to the documentation it says that p_value in the function call is a varchar2. but if I pass it a date in varchar2 format it throws an error.
    so I figure I need to convert the varchar2 with a to_date function. that fails too.
    so now I'm stuck.. date fails, varchar2 fails.. what the heck does it want. right now I have it set to null so it the popup works fine, it just does not have the default date I want from the table that builds it. the date is stored as varchar2.
    what am I missing with this?

    When you say "take out the value put in null it works fine.", do you mean you replace only the l_fcrst_date in the APEX_ITEM.DATE_POPUP line or you take out all the lines that have l_fcrst_date?
    Are you using this code in a report region? If so, and you need to use pl/sql, then you will need to change the type from "SQL Query" to "SQL Query(PL/SQL function body returning SQL query)" and code accordingly.
    i.e.
    DECLARE
    l_fcrst_date varchar2(20);
    BEGIN
    l_fcrst_date := '13-FEB-12';
    RETURN 'SELECT empno,
           apex_item.text(1,ename) ENAME,
           apex_item.date_popup(2,0, '''||l_fcrst_date||''') HIREDATE
      FROM emp';
    ENDDoes it work if you include the function calls inside of the APEX_ITEM.DATE_POPUP call?
    APEX_ITEM.DATE_POPUP(39,0, upper(get_user_preference(p_emplid,'FRCST_DATE')),'DD-MON-RR',12,2000,'class="forecast-data" STYLE="background-color:#EFF5FB;"','frcst_date_blank')

  • APEX - Problem with column attributes - Simple Checkbox

    Hi,
    I've a problem with one of my report.
    select * from (
    SELECT
    APEX_ITEM.CHECKBOX(2,audsid,'UNCHECKED') KILL,
    INST_ID,
    AUDSID,
    SID,
    I changed the attributes one of the column in report to Simple Checkbox. Display is working fine and I see correctly checkbox inside the column, but when I trying to trigger process which is based on that column, I'm getting below error:
    wwv_flow.accept: SIGNATURE (parameter names) MISMATCH
    VARIABLES IN FORM NOT IN PROCEDURE: F01_NOSUBMIT
    NON-DEFAULT VARIABLES IN PROCEDURE NOT IN FORM:
    Process code looks like below:
    BEGIN
    FOR i IN 1..APEX_APPLICATION.G_F02.count
    LOOP
    rec_audsid := APEX_APPLICATION.G_F02(i);
    stmt...
    stmt...
    Could you pls help me with this? How I can submit correctly data to my process from that Simple Checkbox item?
    Thank in advance for help.
    Regards
    Mariusz
    Edited by: user8763881 on 17-Aug-2010 08:12
    Edited by: user8763881 on 17-Aug-2010 08:12
    Edited by: user8763881 on 17-Aug-2010 08:12

    Hi Marc,
    I am trying to use this simple check box to update records in a tabular form that is created through tabular form wizard.
    Now as what you said I included one more column in the tabular form sql query for my check box column.
    Lets say, if my table column name is sent_msg_ind then I have this included as below
    select sent_msg_ind, --hidden
             sent_msg_ind as sent_msg_ind_no_submit --simple check box
    from table_x;Now how to propogate the value of simple check box(1 - checked and 0 - unchecked) value into hidden field.
    I am using this tabular form to just update the records based on what is being fetched using the primary key from the previous page.
    Any example or demo would be highly appreciated here.
    Thanks,
    Teku
    Edited by: Teku on May 19, 2011 10:05 AM

  • Using the AddRow() BuiltIn with  APEX_ITEM

    Hello to all
    I'm using APEX 4.0 and tried to use the addRow() Builtin.
    I have created a report based on a function returning a query with apex_item.display_and_save,select_list_from_query,popup_from_lov,text,date_popup and hidden.
    The report layout is standard-report and the REGION_STATIC_ID is named detail.
    Then I created a ADD_ROW Button with the action redirect to URL and the target javascript:addRow('detail');
    When I Click the button firebug displays the error message: gTabFormReportID is not defined.
    So I tried to create my own ADD ROW Button. The first Row of the report is cloned. I can set default values and a new id for the select list,popup_from_lov,date_popup and for the
    text item, but I can not change the values of the display_and_save items.
    When I choose another option for the select list, it works, when I choose another option for the popup_from_lov or date_popup then
    the first row changes not the added row.
    So what else can I do. What can I do with the addRow() Builtin to define the gTabFormReportID (preferred),
    or for my own ADD ROW Button how to change the default value and id
    of display_and_save items and to change the right row after popup_from_lov or date_popup?
    In this forum I saw a lot of examples for text items or select lists, but I didn't found any examples for display_and_safe or popup items.
    Thanks
    meyero

    Hello Apex-Gurus,
    Because I didn't get any answer, I tried to find out, how to create my own addRow-function and I need some explanation.
    I found out, how to reset the value of the display_and_safe items. You must search for an input item with type=hidden
    and undefined id in the cloned row. If the next sibling is a span - tag with the expected id of the cloned input item, then you can change the
    value with span_object.innerHTML = "".( I hope this will never change)
    Next I tried to change the cloned popup_from_lov.
    First I search an input item with the id fnn_0000 in the cloned_row, change the id to fnn_0002. The new row is the third row. I tried to change
    the value and the id of the input item, but only the id changes.
    Then I search for the Javascript function genList0_f21_$_row() and replace the name with genList0_fnn_2, the parameter
    &p_element_index=" + escape ('0') to &p_element_index=" + escape ('2') and p_elem_id=" + escape('fnn_0002').
    At last I change the call of the function to "javascript:genList0_fnn_2()".
    When I try to call the function, firebug shows an error function genList0_fnn_2 id not defined, but I can see it in the source code. Are there any rights missing?
    So I build a tabular report and use the addRow() builtin and compare the results:
    First thing to mention is, that the ids start with fnn_0001 in the tabular report and not with fnn_0000.
    The JS-functions of the first two rows named in the tabular report are genList0_fnn_1 and genList0_fnn_2.
    The JS-functions of the first two rows named in the apex_item report are genList0_f21_$_row and genList0_fnn_1
    After calling the bulitin addRow function in the tabular report ,a new input item with the id fnn_0003 and a link javascript:genList0_fnn_3(),
    but no new JS-funtion are created, but it works. Where is the function?
    After calling my own add_row function in the apex_item report ,a new input item with the id fnn_0002 and a link javascript:genList0_fnn_2() and
    the new JS-funtion named genList0_fnn_2 (see above) are created, but the function is not known.
    What does the apex engine do, where can I search errors or how can I get this working????
    Please help
    meyero

Maybe you are looking for

  • Hp color laserjet MFP M476dw

    Hi, My printer was working earlier this morning but now none of the office computers are able to print any  jobs. I ran a Wireless Network Test report and everything is fine. I also ran a configuration report and nothing shows up as an issue. 

  • Process Chain Failed

    Hi Process chain for FIGL Extractor has been failed. the Status is showing Red in Load monitor of info package , No Data came till PSA. But the Job in R3 system is still running, it seems IDocs have been stuck in Trfc queue. i informed Basis team abo

  • Where is the payload saved

    I guess this is the most silliest question I've asked so far... I'm familar with all tables related to messages id within SAP. I do wonder about the actual payload. Where is this stored. Is it in the database. Can the payload be accessed from ABAP si

  • Problems with publishing on Flash CS6

    I just started having problems with my Flash CS6 program. Any thing I have designed in the last two days I publish but the html file will not run the flash. I know that my flash on my laptop recently updated but the html file will not open and run on

  • Cache issue coming in Start Process for Employee iView under MSS

    Hi, Navigate to MSS -> Team -> HCM Process and Forms -> Start Process for Employee In Start Process for Employee iView, when I clicks on Refresh link at the bottom right of the table the Direct Reports got removed from the table (which is correct) bu