• Post Reply Bookmark Topic Watch Topic
  • New Topic

inter-frame submitting  RSS feed

 
seb petterson
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 18715
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tim Holloway
Bartender
Posts: 18715
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!