• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dynamic JSF components

 
dileep Chappalli
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can we create the JSF components based on the input the user has submitted in on page. For example if the user submits some data in first page the next page is to be generated based on the input he gives.

Thank you,
Dileep
 
jeroen dijkmeijer
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm my first throw would be to abuse the rendered attribute for that.
How many variants are you looking at?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"dileep cvr",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can definitely do that. I many ways. One is that the user input can be used as the navigation result, so the user enters data there is a button to go to the next page, you call a backing bean method that just returns what the user entered as a String and the navigation rules you set send it to a different page depending on what the String that was entered.

Or you can also code up JSF components dynamically with UIComponent and make the component tree yourself, but I would hold back on that as a last resort, and only if you really understand JSF.

Mark
 
dileep Chappalli
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The project Iam working used web services and JSF. As the webservices uses XML as inputs and output format.
The area I am working on is to show the response( output ) XML data as UI and from that UI the user is asked to choose the solution and the solution is sent as a request for other service.
Here to do this I used XSL to convert the XML into HTML and used this HTML as a UI.
As the Components are of HTML type and not of JSF components. I want to make them as JSF components.
Is my approach correct to use JSF here ?

Thanks,
Dileep
 
Dennis Hopfer
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you get from UIComponent land to JSF markup land?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dennis Hopper wrote:How do you get from UIComponent land to JSF markup land?


JSF markup is compiled into UIComponents under control of the FacesServlet.

But the cynical among us are inclined to wonder if you're taking Mark's admonition about fictitious names to heart.
 
Dennis Hopfer
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the proper process for creating JSF components dynamically? I'd like a JSP/JSF page to populate a table from a database. However since it seems JSF pages need to be event listeners to get into the backing bean logic, do I use a PhaseListener to intercept the page before it loads and to get into my bean's logic?

The solution I have now is to stick <f:phaseListener> into a JSF page and intercept it at the beforePhase method. Is this right? Seems convoluted.

Thanks,

Dennis


http://www.whitepages.com/dir/a-z/hopper/dennis
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic