Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. <p:selectOneMenu value="#{navigationBean.location}">
  2. <p:ajax listener="#{navigationBean.navigate}"/>
  3. <f:selectItems value="#{locationBean.locations}"/>
  4. </p:selectOneMenu>
  5.  
  6. public String navigate(AjaxBehaviorEvent event)
  7. {
  8. return (location != null) ? "pretty:view" : null;
  9. }
  10.  
  11. <url-mapping id="view">
  12. <pattern value="/#{ location : navigationBean.location }/#{ /\d{4}/ year : navigationBean.year }/"/>
  13. <view-id value="/view.xhtml"/>
  14. </url-mapping>
  15.  
  16. public void navigate() {
  17. FacesContext context = FacesContext.getCurrentInstance();
  18. context.getApplication().getNavigationHandler()
  19. .handleNavigation(context, null, (location != null) ? "pretty:view" : null);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement