This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

dynamic fields display

 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Here. Have a potato. I grew it in my armpit. And from my other armpit, this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic