File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes dynamic JSF components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "dynamic JSF components" Watch "dynamic JSF components" New topic
Author

dynamic JSF components

dileep Chappalli
Greenhorn

Joined: Oct 08, 2007
Posts: 8
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

Joined: Sep 26, 2003
Posts: 131
hmm my first throw would be to abuse the rendered attribute for that.
How many variants are you looking at?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

"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.


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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

Joined: Oct 08, 2007
Posts: 8
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

Joined: Dec 02, 2010
Posts: 43
How do you get from UIComponent land to JSF markup land?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15657
    
  15

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Dennis Hopfer
Ranch Hand

Joined: Dec 02, 2010
Posts: 43
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dynamic JSF components
 
Similar Threads
JSF
JSF vs JSP
PrimeFaces
How to design a jsf page dynamically with input text,radio button etc
security constraint with jsp forward