• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to force refresh of my screen in JSF

 
Ousmane Mbinte
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in my JSF2 app I have ​​screens composed with :

- Header
- Body

In the header I have a combo list. At each change in value in the combo list I have an Ajax request that updates the data in the Body. So far everything is working properly. Now the home screen's structure should be change when the value of combo list change. To do this I have :

- 1 ManagedBean HomeBean that manage the home
- 1 ManagedBean HeaderBean that manage the header
- 2 object HomeScreen1.java and HomeScreen2.java that allows me to valued data from each screen
- 2 services HomeScreen1Loader.java and HomeScreen2Loader.java that manage loading of each type of screen
- 1 template home.xhtml
- 2 fichier home1.xhtml et home2.xhtml

When I log in to the application, I get the good page corresponding (Element type 1 => home page 1). But when I select a type 2 item, the actionListener methode is execute, ManagedBean's data was updated (for type 2 screen) , but the page does not updated. What do you do ?

HeaderBean.java :





ContextBean.java :



HomeBean.java :


home.xhtml :


 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"moos mas",

We don't have many rules here on the CodeRanch, but we're pretty serious about our requirement to use a real display name.

Some people won't even answer questions until the person asking complies with our naming policy, and I'm one of them.

If you are not sure about our requirements, see http://www.javaranch.com/name.jsp .
 
Ousmane Mbinte
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I made changes. I think everythings is better with little fun...no problem I respect the rules.
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Ousmane! Your real name looks cooler anyway!

It's best when presenting a problem on the ranch to start with a small abstract summary. Since no one gets paid to do this, if you post a large amount of code right off, people tend to pass it by because it's too much to read.

I'm afraid I'm very guilty of that, but I did do a high-level scan and one thing that jumped out at me is that you are referencing JSF navigation using template resource paths, not URL paths. JSF navigation is done via URL, not the internal resources used to resolve the URLs.

So try replacing all the ".xhtml" with ".jsf" and see if that helps.
 
Ousmane Mbinte
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the solution, the problem came to the ManagedBean ContextBean's templateHomeName attribute that was not properly valued. I added in loader.load(homeScreen1) and refresh and everything it's ok. I should upgrade my JSF version : 2.1.0-b11 to 2.1.26 because I had an error when refresh.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!