| 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
|
|
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
|
|
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
|
 |
 |
|
|
subject: inter-frame submitting
|
|
|