This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

extending primefaces 5 components  RSS feed

 
serafino lillo
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Really need some simple and complete example on how to extends components (graphically and functionally) for primefaces 5.

For example I can't figure how to add custom attributes to existing component or define default values for existing attributes.

Is there any tutorial or a basic common way to achieve this goal or each component have to be extended in its way?

 
Tim Holloway
Bartender
Posts: 18705
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Serafino!

JSF doesn't really encourage extending its tags the way some platforms do. In most cases, the tags are expected to be self-sufficient. You can define new tags that pull in existing tags or sets of tags and assign certain desirable characteristics via XML (facelets), but extending an existing tag's binary characteristics isn't something I recommend. It's complicated, messy, and likely to break when JSF3 comes out, just as it did in the transition from JSF1 to JSF2.

 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch (again)

I don't suggest you extending JSF components or primefaces components. As Tim pointed out, JSF2 components' attributes and/or behavior may change when JSF3 comes out.

This applies to primeface too. The component you use for extending may disappear/ deprecate in the next version of primeface. No one knows.
 
serafino lillo
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for hospitality ... and discouragement :)
 
Tim Holloway
Bartender
Posts: 18705
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't give up just yet.

Let us know what you need to do and we'll see if we can't come up with a solution. The JSF tagsets are generally pretty complete if you know how to employ them to best effect.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!