Pages

Wednesday, March 28, 2012

Enable/disable the buttons based on conditions

Well, i previously blogged about Visible/Unvisible property For UI

But here I'm to represent Enable/Disable button,
Concept and code snippet is same some what like previous post. 

I got a requirement like, A button(update) should be disable at initial stage.
Based on condition should get enabled.

If you are using the commit button once record created never allow you to update.
If you remove this EL Expression (#{!bindings.Commit.enabled}) you can update the records as always.

But my customer expect something like update button. 
To update the existing records. 

Consider this as a scenario for Toggling enable/disable button.


Step1: At initial stage existing records cannot save and update.



Step2:  when the user try to edit the employee id means update button get's enabled.


Step3:  Here Code Snippet shows, Approach1 and Approach2 both of them performs the same. 

No comments:

Post a Comment