• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

dynamic JSF components

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do you get from UIComponent land to JSF markup land?
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
We don't have time to be charming! Quick, read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic