I m using Oracle 11g and Apex - 4.0.2 version
I m having a request to disable template based button based on condition.
Template based button name 'Activate'
When button clicked for first time it would perform a process and then it should disable the buttons.
Is it possible?
If do you want to have the button permanent disabled, just create some new column (for example: ACTIVATE_IDC) in a table where you can store the value like 'Y/N': (default 'N') - create it like some hidden item.
Then create a dynamic action (DA) on button "Activate" - "on Click" where you can use two true processes:
1) PL/SQL update the column ACTIVATE_IDC to Y
2) Submit page with some request or some other processing you need
Crete another DA - "Page load" with condition when "ACTIVATE_IDC = 'Y'"
when true: Disable the button
Don't forgot set the Static ID for the button when needed.
When you run the page again, the button will be disabled now.
Sorry for my English
I used the same version of APEX before. You can choose it to DOM object or by jQuery selector.
I didn't use the DA on button. Only on jQuery selector (#BTN_ACTIVATE).
I can provide some example on apex.oracle.com if do you need.
here is some example using jQuery selector:
When you inspect your button element via firebug or chrome or some other HTML inspector, do you see nay ID of the button ? or button name ?
If yes, you can use jQuery selector by: #BTN_ACTIVATE (BTN_ACTIVE is the button ID) or [name='BUTTON_NAME'] here is used the button name attribute instead of ID.
You can choose first option..
First try a simple test with Dynamic action like this.
DA : Event: Click
Selection Type : jQuery Selector
jQuery Selector: #BTN_ACTIVATE (or [name='BUTTON_NAME'])
As a true action set only the alert with some message. If the message appear, the selector is written OK. If not try to look at the jQuery Selectors
Don't forgot to set the when click button option - there is Submit page as default.