admin管理员组文章数量:1125609
Created a new (very simple) APEX application, three pages only: Global, Home and Login.
Modified the Home page to allow public access.
Created a Blank Page, Breadcrumbs off, Use Navigation set to on.
On the Home page: created a region with one page item (P1_NEW)
Modified P1_NEW to have a default static value of ‘ABC’
Shared Components / Navigation Menu / Conditions for the Home entry, set the condition to ‘Function Body Returning a boolean’ and entered the following:
BEGIN IF :P1_NEW = 'ABC' THEN return true; ELSE return false; END IF; END;
Re-ran the application, the menu entry for the Home page was not displayed - it should have been.
Created a new Home page item: P1_NEW_1, set server side condition for this item to ‘Function Body’ and inserted the code as detailed above and P1_NEW_1 was visible - as you would expect.
Changed default value of P1_NEW to ‘ABCD’, re-ran the application and P1_NEW_1 did not display – as you would expect.
I’m probably missing something very obvious but why doesn’t this condition work when applied to a menu item?
APEX product build is 24.1.5
Actions are detailed above. Given that the boolean function returned TRUE, menu entry for the Home page should display but did not.
Created a new (very simple) APEX application, three pages only: Global, Home and Login.
Modified the Home page to allow public access.
Created a Blank Page, Breadcrumbs off, Use Navigation set to on.
On the Home page: created a region with one page item (P1_NEW)
Modified P1_NEW to have a default static value of ‘ABC’
Shared Components / Navigation Menu / Conditions for the Home entry, set the condition to ‘Function Body Returning a boolean’ and entered the following:
BEGIN IF :P1_NEW = 'ABC' THEN return true; ELSE return false; END IF; END;
Re-ran the application, the menu entry for the Home page was not displayed - it should have been.
Created a new Home page item: P1_NEW_1, set server side condition for this item to ‘Function Body’ and inserted the code as detailed above and P1_NEW_1 was visible - as you would expect.
Changed default value of P1_NEW to ‘ABCD’, re-ran the application and P1_NEW_1 did not display – as you would expect.
I’m probably missing something very obvious but why doesn’t this condition work when applied to a menu item?
APEX product build is 24.1.5
Actions are detailed above. Given that the boolean function returned TRUE, menu entry for the Home page should display but did not.
Share Improve this question edited yesterday MT0 168k11 gold badges66 silver badges127 bronze badges asked 2 days ago PhilPhil 112 bronze badges New contributor Phil is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.2 Answers
Reset to default 1By the page is rendered, all the server-side conditions executed first. Then, when conditions are met, some regions, items etc. are displayed.
In your case, navigation menu is a system wide component in terms of DOM structure and when the condition is checked, it is already rendered.
I suggest you use client-side conditions or create a application item not a page item.
It doesn't work because at the time the Nav Menu is rendered, the page item does not have it's value set yet. Instead of using the "default" attribute of the page item, create a computation on the item with a before header execution point. That way the value is set before the nav menu is rendered. I never use the default attribute for exactly that reason.
To ensure the behaviour of the computation is what you'd expect of a default value, set a serverside condition of "Item is NULL" on it.
off topic: The serverside condition can just be type "Expression" with source :P1_NEW = 'ABC'
. Same result but less typing ;)
本文标签: Oracle Apex Navigation Menu – Conditions questionStack Overflow
版权声明:本文标题:Oracle Apex Navigation Menu – Conditions question - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736645179a1946086.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论