• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Trying to change <ui:include> src tag dinamically

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have main page that looks like this:

What i want to do is have a bean like this and change dinamically which page is included. This is how bean looks like:

When i click button Push i want this page to be included:

Problem is that i have to press the button twice for page to be included. How can this be done so when i press the button the first time page is included.
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know how to do this but I can tell you why it happens.
If you use a getPage method like this you can observe what's going on.

<ui:include is using the first phase of JSF lifecycle to get value of #{bean.page}. So if you click commandButton it gets old value even before action method changePage is called. That's why it's always one click late. Seems like there is no way to do this with ui:include. Doesn't matter if you use Ajax or Primefaces, it's JSF thing.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic