Howard (DBA in Training) wrote:"Hide" how?
APEX 4.0, Theme 17 Sapphire, Oracle 11.2.
I've added "previous" and "next" buttons to CHARTS to make navigation through the data easier. When I get to the right-most future data, I hide the "next" button and correspondingly with "previous".
Of course, when the "next" button is hidden, the "previous" button floats to the right into the position vacated by the "next" button. What does it take to fix the button positions?Potentially, absolute/relative positioning, but I don't think that's the way to go.
Yes, I know the old adage: "If they're ain't broke, don't fix them." But in this case, I'd really like them fixed! Now, I can create additional "place holder" buttons-grayed out buttons, if you will-but that's a lot of extra buttons work as I also have "most previous" and "most future" buttons in the mix.That would be the <tt>disabled</tt> attribute.
It would be nice if I knew some attribute that would just gray/disable a button without hiding it.
is what disables the button. Its an HTML attribute so applies to Apex as well.
1. Create a hidden page item or application item, say P3_HIDDEN .2. write a Before Header computation on the page that sets the value of the above item to disabled="disabled" on the same SQL condition that you are using to hide the button
I can see the value of the hidden attribute (P3_HIDDEN) changing in the Session state. (Actually, I'm trying it on another page where I named it P1_BUTTON_CONTROL.) I also tried disabled="" with the same effects. The button picks up the disabled attribute but seems to ignore any changes to it.
SELECT CASE WHEN EXISTS (<query goes here>) THEN 'disabled=false' ELSE 'disabled="disabled"' END FROM DUAL;
The "disabled" attribute is a little odd. If it is present then the effect is disable. E.g. all the lines below will end up with the item being disabled.
SELECT CASE WHEN EXISTS (<query goes here>) THEN '' ELSE 'disabled="disabled"' END FROM DUAL;
disabled="disabled" disabled="" disabled
Ah. One of the many things I did not know. But what about?
The "disabled" attribute is a little odd. If it is present then the effect is disable. E.g. all the lines below will end up with the item being disabled. disabled="disabled" disabled="" disabled