File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF component binding does not get updated correctly

 
Stephen Ma
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My JSF code:



The method getT1CategoryList in the backing bean that gets executed when I select from the selectOneMenu updates the columns attribute as well as the formElements attribute. Problem is, the getFormElements method does not get called. It makes no sense...the getColumns method gets called, so the panelGrid's column is updated correctly, but the binding formElements doesn't get updated.

Any help would be greatly appreciated!


 
Bauke Scholtz
Ranch Hand
Posts: 2458
 
Stephen Ma
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
noted
 
Tom Fulton
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the information on the property you are connected to with the binding? Value and binding mean two different things...value is used to represent the "contents" of a control, while binding is used to refer to an instance of the class of the control itself. For example, for a <h:selectBooleanCheckbox> control, value would be associated with a boolean property, while binding would be associated with a UISelectBoolean instance. This gives you access to the control itself, in the case of binding, and direct access to its contents, in the case of value.

My guess is that it's not calling the method, because the binding is connecting to an inappropriate type of reference. You might very well have the method name right, but returning the wrong type of object.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic