This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes UIDateInput Custom Component 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 "UIDateInput Custom Component" Watch "UIDateInput Custom Component" New topic
Author

UIDateInput Custom Component

Prash Singh
Ranch Hand

Joined: Aug 23, 2009
Posts: 103

Dear all,

I am new to JSF world. I am using JSF in Action book for JSF reference.
In their Custom Component Development chapter, they have created a custom component UIDateInput.
This component creates three html select option tag pairs filled with month, year and day parts of a date.

This component uses the java.util.Date for value attribute.

But I want to add more attributes like binding, disabled ,styleclass to this component.
But I am unable to do so..
Also there is ValueBinding and ValueExpression issues.

Please help me through this....
I am really having a tough time in dealing with this component.

Waiting for replies.
Thanks In Advance.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

The easiest way to do this is to subclass an existing component that already has these features.

Just as a warning, however, creating a custom JSF binary component is something you should only attempt as an absolute last resort. JSF components started out as an extended JSP tag construct but they quickly got lost and the results these days are a mish-mash resulting from blending about 3 different and occasionally conflicting concepts, with documentation that's generally poor and out of date. For most cases, it's a lot easier to build components at the XML source level instead.


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

Joined: Aug 23, 2009
Posts: 103

Thanks for your reply Tim.

But in my work area I am restricted to use any other external component library.
So for handling date fields , I need to have some kind of custom component which can reflect changes in date fields.

The example I have been through in "JSF in action" displays a date in three different parts and is pretty cool.
But I am just not able to get its binding attribute working.

I need help in this regard.
Sorry if it sounds redundant.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UIDateInput Custom Component
 
Similar Threads
Extending JSF Components
AJAX Request
Need to write A custom ELResolver?
Extending JSF input text tag
Manipulating HTML dom from a custom JSF component???