This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JSF and the fly likes Coding binding attibute for my custom Component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Coding binding attibute for my custom Component" Watch "Coding binding attibute for my custom Component" New topic
Author

Coding binding attibute for my custom Component

Prash Singh
Ranch Hand

Joined: Aug 23, 2009
Posts: 102

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

Joined: Jun 25, 2001
Posts: 15624
    
  15

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Prash Singh
Ranch Hand

Joined: Aug 23, 2009
Posts: 102

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Coding binding attibute for my custom Component
 
Similar Threads
Creating HtmlInputFileUpload in Java code
Custom Component ELResolveJSF 1.2
JSF - Listbox required="true" field problem
JSP date field
Custom tag does not render.