• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF getter called on continue button on a page when needs to redirect url  RSS feed

 
jagadesh padimala
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


used above way to build a datatable, for the first time mybean.prerender method never calls and first call goes to gettermethod panelGroup and i had continue button same page the bean.continue method doesnt invoke and instead it goes to getter method above panelgroup. IS it the way it should work ?. Thanks for your help.
 
Tim Holloway
Bartender
Posts: 18715
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Jagadesh!

Binding is actually not used/required very often in JSF. You can get a false impression that it is thanks to the fact that obsolete documentation can often crowd out more recent stuff on the Internet and that some of the less polite IDEs used it as a cheat to make their proprietary functions work, but in actuality, I only have one webapp that uses it and even it probably shouldn't have.

What binding does is bind the JSF internal component object directly to the backing bean. You only actually need to do this if you are dynamically modifying the component tree or have very unique requirements to access JSF's internals. Most of JSF is designed to work on POJOs, so the more JSF-specific code you have, the more likely you've made a design mistake.

A lot of people think you have to use dynamic component modification to show/hide elements or to change the size of a displayed table. In actuality, JSF has much simpler POJO mechanisms for that. To show/hide elements, you use the "rendered" element attribute. To change the number of rows in a table, you simply change the number of rows in the table's data model. If you have a limit on the actual number of displayed rows in your dataTable element definition, that particular property value (number of displayed rows) can be supplied from a backing bean POJO property via an EL expression.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!