wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "difference between value and binding" Watch "difference between value and binding" New topic
Author

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 started...anyway..here 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..

Cheers


OCMJEA/SCEA, SCDJWS, SCBCD 1.3, SCJP 1.4
My SCEA experience:http://javalogue.blogspot.com/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: difference between value and binding
 
Similar Threads
NullPointerException in getter method
To Authors: Difference between Value Binding and Component Binding
newbe question on JSF
value and binding attribute
Identifying Selected Row in Table