• 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

setting parameter in backend bean before JSF page loads

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Ranch Hand
Posts: 893
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 376
Scala Monad
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic