Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <p:selectOneMenu value="#{navigationBean.location}">
- <p:ajax listener="#{navigationBean.navigate}"/>
- <f:selectItems value="#{locationBean.locations}"/>
- </p:selectOneMenu>
- public String navigate(AjaxBehaviorEvent event)
- {
- return (location != null) ? "pretty:view" : null;
- }
- <url-mapping id="view">
- <pattern value="/#{ location : navigationBean.location }/#{ /\d{4}/ year : navigationBean.year }/"/>
- <view-id value="/view.xhtml"/>
- </url-mapping>
- public void navigate() {
- FacesContext context = FacesContext.getCurrentInstance();
- context.getApplication().getNavigationHandler()
- .handleNavigation(context, null, (location != null) ? "pretty:view" : null);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement