{"id":174,"date":"2020-08-20T11:43:32","date_gmt":"2020-08-20T16:43:32","guid":{"rendered":"http:\/\/gabrielguzman.com\/blog\/?p=174"},"modified":"2020-08-20T12:18:47","modified_gmt":"2020-08-20T17:18:47","slug":"bug-apex_item-date_popup2-calendars-button-disappear-when-you-have-more-than-100-rows-on-a-report","status":"publish","type":"post","link":"https:\/\/gabrielguzman.com\/blog\/en\/bug-apex_item-date_popup2-calendars-button-disappear-when-you-have-more-than-100-rows-on-a-report\/","title":{"rendered":"Bug: APEX_ITEM.DATE_POPUP2 calendar&#8217;s button disappear when you have more than 100 rows on a report"},"content":{"rendered":"<p>This has been tested on APEX 5.0.0.00.31 and 20.1.0.00.13 as of August 20th, 2020, so it has been around for some time.<\/p>\n<p>If you add a date_popup APEX item to a report without setting the p_item_id parameter, like this:<\/p>\n<pre>apex_item.date_popup2( p_idx =&gt;1\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , p_value =&gt; sysdate + n)<\/pre>\n<p>APEX will assign a generic ID for the input in the form of apex_date_<em>idx<\/em>_<em>row. <\/em>So for the example above you will have apex_date_01_00, apex_date_01_01, apex_date_01_02, and so on. When you reach row number 101, it assigns apex_date_01_10 (instead of _01_101) and stays like that until row 111 where it changes to apex_date_01_11 (instead of _01_110). This makes APEX fail to be able to render the calendar box to the side, so the popup is unusable for that row.<\/p>\n<p>You can see a quick example of the issue here, moving in the pagination until you reach N &gt; 100: <a title=\"https:\/\/apex.oracle.com\/pls\/apex\/f?p=28213:5\" href=\"https:\/\/apex.oracle.com\/pls\/apex\/f?p=28213:5\">https:\/\/apex.oracle.com\/pls\/apex\/f?p=28213:5<\/a><\/p>\n<p>APEX seems to cap the length of that string and this causes the missing extra numbers at the end. I would check any of your reports that use popups to validate the correct rendering of the extra elements of the inputs.<\/p>\n<p><strong>The quick solution is to specify p_item_id when creating your apex_item to avoid using the generated ID.<\/strong><\/p>\n<p>I just wanted to put this up here, in case someone finds this useful in the future.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you add a date_popup APEX item to a report without setting the p_item_id parameter, APEX will assign a generic ID for the input in the form of apex_date_idx_row. When you reach row number 101, it assigns apex_date_01_10 (instead of _01_101) and stays like that until row 111 where it changes to apex_date_01_11 (instead of _01_110). This makes APEX fail to be able to render the calendar box to the side, so the popup is unusable for that row.<\/p>\n","protected":false},"author":1,"featured_media":183,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[108,124],"tags":[141,150,152,154],"class_list":["post-174","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oracle-en","category-oracle-apex-en","tag-apex-en","tag-apex_item-en","tag-bug-en","tag-report-en"],"_links":{"self":[{"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/posts\/174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/comments?post=174"}],"version-history":[{"count":4,"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/posts\/174\/revisions"}],"predecessor-version":[{"id":180,"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/posts\/174\/revisions\/180"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/media\/183"}],"wp:attachment":[{"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/media?parent=174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/categories?post=174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/tags?post=174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}