This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JSF and the fly likes inter-frame submitting Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSF
Reply Bookmark "inter-frame submitting " Watch "inter-frame submitting " New topic
Author

inter-frame submitting

seb petterson
Ranch Hand

Joined: Mar 04, 2005
Posts: 118
page2.faces contains headings for a table in the form of commandLinks. page3.faces contains the table. When user clicks a heading the sort order of the table column content should be changed, and after this page3.faces should be redisplayed.

Currently I solve this through javascripts in page2.faces telling iframe in page1.faces to refresh its source. But How can I solve this with pure jsf? Setting the target of h:form to the second frame doesnt work since that results in page2.faces being loaded into the frame (where page3.faces should be).
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14572
    
    7

One way to do it is to wire the backing beans together as Managed Beans. I did almost exactly what you're describing just yesterday.

Here's how it works:

1. Starting with (presumably) existing display backing bean...

2. Create an "ordering" bean that contains your sort options

3. Define - but don't construct - an "ordering" bean object in your display backing bean. Add setter/getter.

4. Add the "ordering" bean to the list of Managed Beans defined in your faces-config.xml file.

5. Define construction of the ordering bean object in the Managed Bean definition of your display backing bean.

for example (using search, rather than ordering):


et viola! "searchArgs" is created by the framework when it constructs the display backing bean. Now aim your sort parameters JSP at "searchArgs", add a "sort" action to the display bean, expecting searchArgs, and wire the search, er sort, arguments JSP at the display backing bean's "sort" action.


Customer surveys are for companies who didn't pay proper attention to begin with.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14572
    
    7

Actually, maybe I didn't. I was thinking inter-page submissions, not frames on a page. Time to visit the optometrist, maybe.

Hope it was some help, anyway
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: inter-frame submitting
 
Similar Threads
popup form - howto get data ? from newbie
page redirection
Regarding HTML Form
Track the pages user visits and keep them in session.
Javascript-- how to find referrer when url redirect is done