• 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

inter-frame submitting

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Saloon Keeper
Posts: 24496
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Saloon Keeper
Posts: 24496
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic