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

Java Server Faces add screen components at runtime  RSS feed

 
Mauro Reinehr
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I would like to know how he could do to add run-time components in page.

In my example would have a form with a " <p:inputText></p:inputText>" but I wanted to be able to add more of this kind , for I am wanting to create a table in the database according to the data
inputText .
 
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, Mauro!

Basically, you'd define a binding point on the View Template and add logic to you backing bean to insert/remove/change View elements.

That's not something you want to do lightly. Things can get confused and out of sync.

Fortunately, it's not usually necessary. For cases like what you are describing, just embed the prototype inputText control in a dataTable control. JSF will render as many inputText elements are you've defined corresponding dataTable DataModel rows to hold their values.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!