This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Navigate to new view on ajax update  RSS feed

 
Christer Dalevind
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I'm using the Dynamic Faces framework together with JSF to poll updates for a backing bean value like this:

<hutputText id="state" styleClass="stateTextStyle" value="#{stateBean.userState}"/>

function refreshWithAjax() {
DynaFaces.fireAjaxTransaction(null, {'render: 'state'});
}

and in StateBean class I have the following code (pseudocode here):

public String getState() {
//if state has a certain value call performNavigation method otherwise just
//return state as string
}

private void performNavigation() {
FacesContext context = FacesContext.getCurrentInstance();
Application application=context.getApplication();
NavigationHandler navigation=application.getNavigationHandler();
navigation.handleNavigation(context,null,"gotoNewView");
}

My problem is that the navigation only occurs after I press F5 to refresh
the whole page or click on a commandButton. Any ideas on how to solve this?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!