Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JavaServer Faces » Referencing Bean values in JSF page(How to achieve "dynamic" HTML URL and conditional rendering)
Referencing Bean values in JSF page [message #663842] Wed, 06 April 2011 15:45 Go to next message
thealy is currently offline thealyFriend
Messages: 4
Registered: May 2010
Junior Member
[New to JSF, so apologies if too basic or explained badly]

I have a Session scoped managed bean (A) that is populated from a form with selectOneMenu items. On submit, the controller Bean (B) routes based on the categories chosen by the user.

The target page must display one or more graphs depending on variables contained in the session bean A. But the URL of the chart or graph depends on variables in Bean A. In some cases one chart is needed, in other cases several. So I need to conditionally include code on this .xhtml page, and somehow create the appropriate URL for the charts.

I can't get the syntax to make a URL like:

A.index = 5

I need a URL like: "chart-3/"+A.index+"/1.html" to be inserted.

Thanks for any help.
Re: Referencing Bean values in JSF page [message #663889 is a reply to message #663842] Wed, 06 April 2011 17:46 Go to previous messageGo to next message
Ian Trimble is currently offline Ian TrimbleFriend
Messages: 137
Registered: July 2009
Senior Member
This is a general JSF question, but the forum is for the Eclipse JSF Tools project. You'd probably get more answers in a more general forum.

That said, could you use a command link, something like this?

<h:commandLink value="chart-3/#{A.index}/1.html"/>
Re: Referencing Bean values in JSF page [message #663890 is a reply to message #663889] Wed, 06 April 2011 17:56 Go to previous message
thealy is currently offline thealyFriend
Messages: 4
Registered: May 2010
Junior Member
Sorry, thought I was in the right place.
Previous Topic:JSF Facet
Next Topic:pagecode sync in Eclipse
Goto Forum:
  


Current Time: Wed Apr 24 22:28:25 GMT 2024

Powered by FUDForum. Page generated in 0.03489 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top