Pages

Wednesday, March 28, 2012

Visible/Unvisible property For UI Components

Well, While when i'm Roaming around the Otn forums,

I have been noticed that,

New bie's keep posting on this specific topic Visible property On/Off for UI Components.

Say as e.g.: if user try to give the salary as negative. Save button Visible should be get's off.

Step1 :At initial stage save button should be enabled


Step2: If user try to edit the salary as negative. so save button goes off.

Step3: Here Code snippet goes.


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.