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

Similar Messages

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

  • 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

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

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

  • 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

  • Small bug in Apex 3.1

    Apex 3.0 (I believe it was) introduced the "Calendar Icon Details" settings, so that the calendar icon could be customized for each theme. (I like to think of this as my own little contribution to Apex, since I suggested it in the 3.0 beta testing... :-)
    Anyway, if you use the apex_item.date_popup function to generate datepickers for tabular forms, it still uses the (fixed) default datepicker icon ("/i/asfdcldr.gif"), ignoring the Calendar Icon Details settings.
    For consistency, the API function should return an icon based on the theme setting...

    Hi, what's your first name?
    I will file a bug for this observation.
    As a workaround, when using the function, you can specify an alternate image with something like:
    select replace(apex_item.date_popup (1,null,sysdate,'DD-MON-YYYY'),'asfdcldr.gif','people.gif')
    ...for example.
    Scott

  • Apex_item.hidden does not appear to be working correctly

    Hi,
    I am trying to build a manual MRU form based on the How to tutorial by Christina Cho.
    The differences are that I am using Apex 2.2 and thus apex_item functions and that I am putting the insertion row first before the existing rows (I want most recent records first).
    To simplify testing I removed the select for the existing records (there are none so far). I have the following select:
    select x.problem_id,
    x.person_id,
    x.probcode,
    x.resolved,
    x.diag_date,
    x.resolved_date,
    x.record_status
    from (
    select apex_item.hidden(1,null) problem_id,
    apex_item.hidden(2,:p235_person_id) person_id,
    apex_item.popupkey_from_query(3,null,
    'select probcode||'' - ''||description d,
    probcode from problist',75,75) probcode,
    apex_item.select_list(5, '1','-;1, Yes;2') resolved,
    apex_item.date_popup(6, null, null, :pick_date_format_mask, null, 12) diag_date,
    apex_item.date_popup(7, null, null, :pick_date_format_mask, null, 12) resolved_date,
    apex_item.hidden(8, 'ACT') record_status,
    apex_item.md5_checksum(null, null, null, null, null, null) cks
    from dual
    ) x
    With the apex_item.hidden, the counts apex_application.g_f01, apex_application.g_f02, and apex_application.g_f08 are equal to zero(0) when I submit the data entered. If I change the hidden functions to text functions then the counts are equal to one(1).
    The bad counts appear to be screwing up the collection creation procedure too; I expect it has to do with having a null for a loop end point..
    I expect that I can create a work-around with the text fields and not showing them in the report, but does the hidden function have a real bug?
    Also, for the collection creation routine, what can be done when there is nothing in the arrays? What is the value of the count?
    thanks,
    Peter

    Unchecking the Show checkbox in Report Attributes means you are asking the Apex reporting engine to not render that column on the report.
    If the column in question is a apex_item.hidden() call and it is shown (Show checkbox checked), it will display a "empty" column on the report, but the values will be posted to the g_fNN array you specify.
    I agree it is a little non-intuitive, that is why I always "piggyback" the apex_item.hidden() API call with a column that is going to be rendered on the report.
    Something like
    select
    apex_item.hidden(...)||apex_item.select_list...()
    ...

  • 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: Store Values of fields which are created dynamically(Using APEX_ITEM)

    Hello All,
    I am creating one application in which i create one report with dynamic fields(using APEX_ITEM Package) and non-dynamic fields(Taking from table). Now i want to store the value of the dynamic fields into table. So please help me on that.
    I want to store value of APEX_ITEM.TEXT fields in a table, but i don't have names of it so how to store value in table?
    select APEX_ITEM.CHECKBOX2(1,HC.S_ID) "SELECT",
    HC.ACT_NAME,HC.REBOOT_DATE,
    APEX_ITEM.TEXT(2,00) "Start Time",
    APEX_ITEM.TEXT(3,00) "End Time",
    APEX_ITEM.TEXTAREA(4,'Enter Remarks',2,40) "Remarks" FROM HWC_CHK_SCHEDUELE HC;
    Thanks,
    Jiten

    Let me clarify a finer point. The APEX_ITEM API provides for value , which can come from a table.
    You need to add APEX_ITEM to your columns selected from the table as well.
    Once you have done that then the p_idx value , the first numeric, in the APEX_ITEM, is accessing in DOM as well as PL/SQL.
    In DOM, for JavaScritps, the p_idx 1 becomes f01, 2 becomes f02 ,etc.
    In PLSQL the same are APEX_APPLICATION.G_F01, APEX_APPLICATION.G_F02, etc.
    Hope that explains what you need to do.
    select APEX_ITEM.CHECKBOX2(1,HC.S_ID) "SELECT",
    APEX_ITEM.TEXT(2,HC.ACT_NAME) "ACT_NAME",
    APEX_ITEM.DATE_POPUP(3,HC.REBOOT_DATE) "REBOOT_DATE",
    APEX_ITEM.DATE_POPUP(4,SYSDATE) "Start Time",
    APEX_ITEM.DATE_POPUP(5,SYSDATE) "End Time",
    APEX_ITEM.TEXTAREA(4,'Enter Remarks',2,40) "Remarks"
    FROM HWC_CHK_SCHEDUELE HC  /* no semi colon in SQL; */In the OnSubmit process
    FOR I IN APEX_APPLICATION.G_F02.COUNT LOOP
      -- LOGIC HERE.
    END LOOP;Note I have not used Check box F01 in the above code. Look up the documentation for checkbox in Referencing Arrays. Checkbox behaves different as compared to other item types.
    BTW, why are you not using Tabular form for this?
    Regards,
    Edited by: Prabodh on May 9, 2012 5:32 PM

Maybe you are looking for

  • Need help with Report Generation Toolkit: Excel Set Cell Format.vi

    Hi people, I've been searching and found this old thread of someone asking what is the input parameter "Number format". And I dont know what should I put in there. I've tried so many possibilities, but nothing works so far, such as: 0,0 0,? 0,# #,0 ?

  • Photosmart 7520: Scan to Email

    Hi,  I have created my email adr on the printer, and veryfied my mail adr. with the PIN code, that was send to me from HP But when I start the process by cliking (on the printer), "Scan" --> "Scan to Email" --> Select my Email Account --> Select type

  • I cannot back up-get message that "Organizer has stopped working".  Is there anyone to help me????

    I cannot back up - get message that "organizer has stopped working-a problem caused the program to stop working".  Is there anyone I can talk to at Adobe???

  • Intercompany billing IDOc issue

    Hi, I am intercomapny purchase billing documents and intercomapny sales billing documents thropugh IDOC posting to generate automatic invocies. All IDOCs for intercomapny purchase billing documents are going into error. Error is : Enter a tax code in

  • Capturing Screen using java

    Hi, Is there anyway I can do a printscreen using java and then send the image over the network? axlrose82