// MPL License text (see http://www.mozilla.org/MPL/) <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:ace="http://www.icefaces.org/icefaces/components" xmlns:icecore="http://www.icefaces.org/icefaces/core" xmlns:ui="http://java.sun.com/jsf/facelets" template="/resources/templates/content-template.xhtml"> <ui:param name="title" value="#{msgs['example.core.redirect.title']}"/> <ui:param name="description" value="#{msgs['example.core.redirect.description']}"/> <ui:param name="resourceValue" value="#{redirectBean.exampleResource}"/> <ui:param name="wikiResources" value="#{redirectResources.wikiResources}"/> <ui:param name="tldResources" value="#{redirectResources.tldResources}"/> <ui:define name="example"> <h4>Page A</h4> <h:form id="form"> <h:selectBooleanCheckbox id="checkbox" value="#{redirectViewScopeBean.renderRedirect}"> <f:ajax render="@all"/> </h:selectBooleanCheckbox> render icecore:redirect component to navigate to other page </h:form> <h:form rendered="#{redirectViewScopeBean.renderRedirect}"> <icecore:redirect href="resources/examples/core/redirect/redirect-next.jsf" /> </h:form> </ui:define> </ui:composition>
/* MPL License text (see http://www.mozilla.org/MPL/) */ package org.icefaces.samples.showcase.example.core.redirect; import org.icefaces.samples.showcase.metadata.annotation.*; import org.icefaces.samples.showcase.metadata.context.ComponentExampleImpl; import javax.annotation.PostConstruct; import javax.faces.bean.CustomScoped; import javax.faces.bean.ManagedBean; import java.io.Serializable; @ComponentExample( title = "example.core.redirect.title", description = "example.core.redirect.description", example = "/resources/examples/core/redirect/redirect.xhtml" ) @ExampleResources( resources ={ // xhtml @ExampleResource(type = ResourceType.xhtml, title="redirect.xhtml", resource = "/resources/examples/core/redirect/redirect.xhtml"), // Java Source @ExampleResource(type = ResourceType.java, title="RedirectBean.java", resource = "/WEB-INF/classes/org/icefaces/samples/showcase"+ "/example/core/redirect/RedirectBean.java") } ) @Menu( title = "menu.core.redirect.subMenu.title", menuLinks = { @MenuLink(title = "menu.core.redirect.subMenu.main", isDefault = true, exampleBeanName = RedirectBean.BEAN_NAME) } ) @ManagedBean(name = RedirectBean.BEAN_NAME) @CustomScoped(value = "#{window}") public class RedirectBean extends ComponentExampleImpl<RedirectBean> implements Serializable { public static final String BEAN_NAME = "redirectBean"; public String getBeanName() { return BEAN_NAME; } public RedirectBean() { super(RedirectBean.class); } @PostConstruct public void initMetaData() { super.initMetaData(); } }