Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Coding binding attibute for my custom Component

 
Prash Singh
Ranch Hand
Posts: 103
jQuery Netbeans IDE Notepad
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

I am trying to create a custom component in JSF 1.2 and JSP 2.1 .

The component gets rendered fine.
Now I want to implement the "binding" attribute for that component.

I am not having much idea about how binding attribute works for other components
like HtmlInputText etc.

This is what I am trying to implement.
My jsp page.



and this is my Managed bean.




Please help me this issue.





 
Tim Holloway
Saloon Keeper
Posts: 18302
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't work that way.

In most cases, you don't want "binding", you want "value". Binding is used to inject an actual UIComponent into a backing bean and about the only reason you need to do that is if you intend to access or modify raw JSF UI Components. The "value" attribute is what causes the actual backing bean property set/get methods to be invoked.
 
Prash Singh
Ranch Hand
Posts: 103
jQuery Netbeans IDE Notepad
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Tim,

I got your point. But now I am stuck somewhere else.
The component I was trying to make shows a java.util.Date value in form of three select <option> tags.
Now it seems like that component never gets updated.
If I try to update the component value in ValueChangeEvent of other component in the form, it never shows any updation,
But if use the updation code in the commandAction method , the component gets updated.
Is there something I am missing about these two events.

Please guide
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic