Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to disable Buttons based on condition.

658330Feb 13 2009 — edited Feb 16 2009
Hi

Need your help to disable button based on condition.

Please refer the application:
http://apex.oracle.com/pls/otn/f?p=34797:5:110582943383419::NO:::

login credentials:
workspace: vsanthanam
user: vijay
pswd: apex_demo

In the above application, i have 2 buttons in page 5, (Report1 and Report2)
Where i have to disable button based on the following conditon:

i) USER whoever has Admin value 'Y' in my table can access the button.

for this i've written a Button Condition : Type (EXISTS)

select 1 from apex_extra_values where rtrim(lower(empname)) like decode((select Admin from apex_extra_values
where rtrim(lower(empname))=rtrim(lower(V('APP_USER')))),'Y',rtrim(lower(V('APP_USER'))))


note: i have empname same as my APEx user name. with Admin access 'Y'.

By using this code i can able to hide the button for users who has no Admin access.
But my requirement is : i have to show the button even if the user is not Admin, but to grey out (disable the button - no action)

I tried using javascript function:

function disableButton(pThis)
{
pThis.disabled=true;
}

But either of this (exists condtion or JAvascript function) works in my case and not both.


Any pointer on this would be highlt appreciated.

Thanks
Vijay
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 16 2009
Added on Feb 13 2009
4 comments
2,366 views