• Post Reply Bookmark Topic Watch Topic
  • New Topic

dynamic fields display  RSS feed

 
Sushma Sharma
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have to get all the fields from the database and display it on the front end. The database provides all the details of the fields like id, value, fieldType, valueType.
for some reason, I am not able to mix JSTL and JSF (most probably version problem).So, I can not do anything in the jsf file. Now, I am trying to write the whole script which contains the fields.
e.g.



and then I try to output this string into the jsf file, but the output is this


what I need is, to render these components. Any suggestions how to do this?
please help.

Sushma
[ October 03, 2006: Message edited by: Bear Bibeault ]
 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are to trying to display the "output" variable as a scriplet in your jsp ? it doesnt seem to work properly

instead of



create a new component

HtmlCommandLink link = new HtmlCommandLink();
link.setId(id);
...

and add this component to the parent ( panelgrid ) depending on your design.

Thanks,
 
Sushma Sharma
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you explain more about how to add the component to the panel and show it in the jsp file?

Thanks,
Sushma
 
Sushma Sharma
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I careated an instance variable in my bean of type HtmlPanelGrid and added a link to it in my backbean method. but I got exception.



also, when I set the id of commandLink, it throws exception saying that illegal argument.

Sushma
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


do this this way, instead:


the rendered attribute determines whether to display a component or not.

now just add this function to your backing bean



hope this helps.
[ October 03, 2006: Message edited by: Lynette Dawson ]
 
Sushma Sharma
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my problem is that the number of fields may vary as I am getting it from the database, so I cannot put this code into the jsp.
e.g. there might be 5 fields for one item and any no. of fields for the other. Also, I have to show multiple items and and their no. of attributes can differ.


Sushma
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!