Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

setting parameter in backend bean before JSF page loads

 
indra sen
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From a locate Screen ,i am opening a Modeless window
and loading emp.html page and onload i am
setting action='/faces/emp.jsp' to load JSF page there.
My problem is that i want to pass empleoyee fk to backend bean before to retrieve emp data to show those data in emp.jsp JSF page.
i tried with
action='/faces/emp.jsp?empFK=value'
but it does not work.
Any body can help.
Thanks in advance....
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't understand your problem.

Do you want to show details of a given employee from a form which shows you all employees?
 
Marius Adamut
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can try something like this in faces-config.xml, I guess the bean should have request scope.

<managed-property>
<property-name>prop</property-name>
<value>#{param.empFK}</value>
</managed-property>

Also I think you are not supposed to pass parameters like this in a JSF application, only if you need to jump from an external system to your application then this approach makes sense.
 
Gabriel Claramunt
Ranch Hand
Posts: 375
Monad Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure if I really understand what are you trying to achieve.
But suppose you have a table of records and want to open a new window with the details of the record when you click on one of it.
In JSF to get the selected row, you need to submit the page to the server, so you need to open the new page when the page comes back (and the backing bean has the actual row). So you can use the "onLoad" Javascript function of the form, something like (with some simplifications):



If you update something in the details page, you need to update the main page *after* submitting the detail page. Easy again if you use the onLoad:




It has some simplifications (I don't remember the specific details), but it works... I've used it
[ August 15, 2007: Message edited by: Gabriel Claramunt ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!