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

Similar Messages

  • Cross browser issue using ajax report pull

    Hi,
    I have an application working using ajax report pull.
    Entire application is based on ajax and its currently released.
    Its performance is good. It works fine with mozilla but in ie,
    links and buttons are not working.
    my code is as follows:
    var container = document.getElementById("divlayer");
         container.innerHTML="";
         var l_Val = document.getElementById('P15_ID').value;
         var l_Val1 = document.getElementById('P15_REGION').value;
         var l_Val2 = document.getElementById('P15_COUNTRY').value;
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,null,10);
         get.add('P15_GSI_PARTY_ID',l_Val);
         get.add('P10_ID',l_Val);
         get.add('P10_REGION',l_Val1);
         get.add('P10_COUNTRY',l_Val2);
         get.add('P10_ROWS',l_Val3);
         get.add('P15_REGION',l_Val1);
         get.add('P15_COUNTRY',l_Val2);
         get.add('P15_ROWS',l_Val3);
         gReturn = get.get(null,'<htmldb:BOX_BODY>','</htmldb:BOX_BODY>');
         get = null;
    document.getElementById("divlayer").style.visibility='visible';
    document.getElementById("divlayer").style.display='block';
    var elem = document.createElement('div');
         elem.id='d1';
    elem.innerHTML=gReturn;
         container.appendChild(elem);
    The links with doSubmit is not submitting to the same page in ie.
    Please help me.
    Thanks,
    Niveditha

    Hello Niveditha,
    There're some differences in browsers... so yes it's possible that it doesn't work with the same code in another browser. The good news is that most of time there're workaround.
    When I look at your code, you could already change document.getElementById() by $x(), which is doing the same, but comes from the APEX framework.
    Do you have an idea where it fails in IE? Are you using the Developer Toolbar? Maybe that gives you more insights. You could also put some alert('hello 1'); in your code to see what's happening and how far it comes.
    If you put it on apex.oracle.com we can have a look into more detail.
    Dimitri
    -- http://dgielis.blogspot.com
    -- http://apex-evangelists.com

  • Ajax Report Pull from another Page Pagination override

    We are on a time crunch and need to get this application working in a timely manner, any help would greatly be appreciated..
    *[History leading up to problem]*
    We followed the code from this example http://apex.oracle.com/pls/otn/f?p=11933:48:4441142106394445 which pulls a report from another page using AJAX so we could update a report (in this case a tabular form). Since Tabular Forms cannot update past 30-40 records we had to turn on pagination to prevent errors when trying to submit it.
    Since Pagination on the bottom of the report/tabular form links to the other page the report is on, I decided to attempt to override next> href link to instead call a javascript with the url from next> (Report/Tabular Form Pagination) with Jquery the following code {the override is working} {comments added here for clarification}...
    var oldhref =$("a.t20pagination").attr("href"); //get Apex Pagination a href link location
    $("a.t20pagination").attr('href', "javascript:return false"); // change the Apex Pagination a href llink location to do nothing
    $("a.t20pagination").click(function () {   // Create an onclick for Apex Pagination a href that calls a javascript function
    get_report_page(oldhref); // This function is needed because I am grabbing the report from another page, I hope to
    }); // get this javascript working [the reason why I am asking this question here]
    $("a.t20pagination").removeClass("t20pagination"); // Removed the pagination class just in case it was causing issues.
    The function I am working on below... {I figured I have to do the htmldb_get function {I am still new to Apex so I am not totally clear on it, but learning}, to get the report again from the other page, but I need to add pagination.. So I figured I could split the link location based on the : and go through the array for the parts I need to pass in the htmldb_get}, with alerts to help diagnose the problem...
    function get_report_page(curUrl) {
    alert ('Hello how are you today?');
    var temp = new Array();
    temp = curUrl.split(':');
    alert ('I like the number '+temp.length);
    for ( var i=0, len=temp.length; i<len; ++i ){
    alert (i+":"+temp); // Square brackets actually used, changed to squiggly here to show
    var get = new htmldb_Get(null,$x('pFlowId').value,null,205,null, null, temp{4}); // Square brackets actually used, changed to squiggly here to show
    gReturn = get.get(null,'<htmldb:BOX_BODY>','</htmldb:BOX_BODY>');
    get = null;
    $x('ReportDrop').innerHTML = gReturn;
    *[Actual Problem]*
    Since the report is on another page (in this case 205) and is being pulled onto Page 200 where the user is, when the user clicks on the Next> for the report/tabluar form pagination, the user is automatically thrown to page 205 {I want to keep the user on page 200 and pass the pagination, then pull the report/tabular form again}
    I looked at the link http://apex.oracle.com/pls/otn/f?p=11620:63:834860992188521::NO::: but I am not sure where to stick the report pagination{I thought it would be queryString {above you see I am setting temp[4] in the queryString parameter}..
    I know the function is working since I get the alert messages, after that where the report would be it gives the following error...
    Bad Request
    Your browser sent a request that this server could not understand.
    mod_plsql: /pls/apex/wwv_flow.show HTTP-400 Signature Mismatch or Missing '='
    Oracle-Application-Server-10g/10.1.2.0.2 Oracle-HTTP-Server Server at nysastst.senate.state.ny.us Port 7778
    Can I simply splice the url like I am doing above and pass it to htmldb_get (or is there anyway to pass the report pagination using htmldb_get)?
    If so, what am I doing wrong?
    Also, does this seem like a decent solution or is there a better solution for this issue?
    - Thanks in advance,
    - Brian
    Edited by: brheitner on Dec 10, 2009 8:09 AM
    Edited by: brheitner on Dec 10, 2009 8:11 AM
    Edited by: brheitner on Dec 10, 2009 8:13 AM

    Thanks cb... it worked like a charm..
    but at first, I Could not get it to work because in my report that was being pulled from another page did not have Enable Partial Refresh set to Yes under Report Attributes > Layout and Pagination.. When it was off the a href link of the pagination was showing a standard link. Once Enable Partial Refresh was set to Yes, the pagination then showed a link to javascript:$a_report(...); which meant you can now override it with the javascript function.
    Here is the thread I found it in
    Call Process Through AJAX

  • Browser hanging when using AJAX report pull.

    Any particular reason why a browser would hang while its pulling data off?
    What debugging can I do to try and find what is causing the problem.

    Hi Carl,
    Merry Xmas & happy new year. Thanks again for another year of great support.
    Sorry I should have put more details into my original query.
    When I said hangs I meant it hangs and after an extremely long time i get the following error message:
    Error Code 1460: Timeout
    Background: The gateway could not receive a timely response from the website you are trying to access, a DNS server, or another gateway server. This might indicate that the network is congested or that the website is experiencing technical difficulties.
    The page is working with the other AJAX calls I have except when it is calling the shadow page.

  • 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 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 ...]

  • 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 ?

  • 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.

  • Apex_item.date_popup 3.1 bug?

    In an updateable report region, I have a date picker item. However, on my app, when I pick the date, it always populates the first row.
    This does not work:
    select gl_rpt_item_id, description, act_flag, apex_item.hidden(1, gl_rpt_item_id) as item_id,
    apex_item.date_popup(6,rownum, decode(client.get_gl_date(:f102_client_centric_id, gl_rpt_item_id),'NULL','',to_char(client.get_gl_date(:f102_client_centric_id, gl_rpt_item_id))),'DD-MON-YYYY',11,11,decode(act_flag,'I','"DISABLED"'))
    new_gl_dt
    from gl_rpt_item where is_clinical = 'Y' and act_flag <> 'I'
    However, this does populate the right item, I'm just not sure how to handle the save.
    select gl_rpt_item_id, description, act_flag, apex_item.hidden(1, gl_rpt_item_id) as item_id,
    apex_item.date_popup(rownum,rownum, decode(client.get_gl_date(:f102_client_centric_id, gl_rpt_item_id),'NULL','',to_char(client.get_gl_date(:f102_client_centric_id, gl_rpt_item_id))),'DD-MON-YYYY',11,11,decode(act_flag,'I','"DISABLED"'))
    new_gl_dt
    from gl_rpt_item where is_clinical = 'Y' and act_flag <> 'I'

    Scott,
    even the java script wht i use to call in date picker in old version that is not working here in new version
    example :
    select
    HTMLDB_ITEM.DATE_POPUP(3,1,null,'DD-Mon-YYYY',10,15,
    ' 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
    thanks
    Sudhir

  • 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')

  • Ajax Region Pull - Javascript errors

    Hi All,
    I have tried implementing Carl Backstrom's excellent example Ajax region pull.... http://htmldb.oracle.com/pls/otn/f?p=11933:48:2576101578276736 and have been unable to get it to work. I have gone through it step by step but i still get a Javascript error relating to the function dhtml_GetReport(pThis). The error is "Object Expected on line 13" => var l_Val = html_SelectValue(pThis);
    I have also included the files htmldb_html_elements.js and htmldb_get.js just in case you were wondering. We are using HTMLDB 1.6.1.00.02 if that could be the issue here.
    Anyone come across this before?
    Thanks.

    Hello,
    All those examples have been built for 2.0 and above.
    Carl

  • 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

  • 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

Maybe you are looking for

  • White screen or green screen question

    hi i have a series of interviews coming up...will shoot 1080.  I like the nice clean look of white for the background. Question is whether to shoot with white backdrop or green screen and key white in post.  Here is my issue: I want to use part of th

  • Mailbox Database Copy Status Failed

    We have 2 Exchange 2010 servers.  We run a DAG.  Recently I have noticed that database copy DB2 which is located on Exch-1 is showing "Failed".  Database copy DB1 which is located on Exch-2 is showing Healthy.  I searched online for information regar

  • Group Calendar Error in UWC

    Hi, We are having a problem in view Group Calendar, After creating group calendar and adding members, when we try to view it in UWC, it gives following error: Calendar Not Available* Could Not Display View* The selected calendar(s) was either deleted

  • Not allow users to disable startup script

    I have written a User Login script for indesign and have successfully implemented in Indesign CS3. However, anyone can disable the login script that I have put in the Startup script by modifying the Preference setting of the Indesign.  I would be ver

  • SOLVED: about:crashes yields "address not valid" message

    i have been having frequent random crashes. When I try about:crashes, I get the message that it is not a valid url. I don't understand why th is would be Am using FF 15, on x86_64 system, with Linux OS Thank you.