File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes difference between value and binding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "difference between value and binding" Watch "difference between value and binding" New topic

difference between value and binding

Higgledy Smith
Ranch Hand

Joined: Mar 07, 2006
Posts: 192
I am new to JSF and am using ICEFaces v1.8.

Most ICEFaces components have a binding attribute and a value attribute. Can anyone explain the difference between these two attributes?

From the ICEFaces API for ice:inputText, here is the definition given:

binding - The value binding expression linking this component to a property in a backing bean

value - The current value of this component. All UIInput derived UIComponents, that are placed within a UIData container, such as a dataTable or panelSeries, should have their value attribute bound to a bean property via a ValueBinding/ValueExpression, since otherwise the UIData container will not keep their successfully validated state, which can cause the component to fail to function properly.

Rahul Mishra
Ranch Hand

Joined: Jan 22, 2006
Posts: 211
This has got to be one of the most famous all time questions on JSF...

i asked the same question when i goes your answer..

When you are interested in only the value of a UI element...(the text it holds)..use the value attribute...
When you are interested in the backing the UI element itself , for example, to set the visibility of the UI element in your controller..use binding attribute...because a value attribute will not give you access to the UI element in the backing bean...

To gain further insight into the above explanation..define two UI elements in a JSP...back one using the 'value' attribute and the other using the 'binding' attribute...notice how the 'types' of these attributes differ in the backing bean...and you will have your answer..


My SCEA experience:
I agree. Here's the link:
subject: difference between value and binding
jQuery in Action, 3rd edition