• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

difference between value and binding

 
Ranch Hand
Posts: 193
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.



 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic