Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic JSF, programatically adding components

 
Rui Azevedo
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys!

In a project I'm ivolved in I have to dynamically add some components. All was going well until I had to generate data tables dynamically. I'm iterating a list of "SomeObject" and when I try to access a property of that object Glassfish tells me that object doesn't have such a property that is readable. I have getters for those properties and SomeObject implements Serializable as well. I used BalusC resources but I'm having no luck. Tell me if you need any more detail. Thanks.
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post your .xhtml file
 
Rui Azevedo
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm.. My .xhtml is this:


and this is the DynamicForm bean:


And this is the data table component, the one that's giving me problems:


The addComponent method ignores the bindingValue parameter, and the selectableOptions here evaluates to a list a of KeyValueItem. Which I present next:


When i try to run the project Glassfish tells me KeyValueItem doesn't have a readable property 'chave'.

It's a lot of code to go through, so if you can sort through it you have my deepest thanks.
 
Mabura Zeguru
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This may shed some light... in the right direction ... i hope ;-)

For PrimeFaces i do the following...




Full example in this blog post
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic