// 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.refresh.title']}"/> <ui:param name="description" value="#{msgs['example.core.refresh.description']}"/> <ui:param name="resourceValue" value="#{refreshBean.exampleResource}"/> <ui:param name="wikiResources" value="#{refreshResources.wikiResources}"/> <ui:param name="tldResources" value="#{refreshResources.tldResources}"/> <ui:define name="example"> <icecore:refresh interval="#{refreshViewScopeBean.interval}" duration="#{refreshViewScopeBean.duration}"/> <h:form> <ace:selectMenu value="#{refreshViewScopeBean.interval}" label="Interval:" labelPosition="left"> <f:selectItem itemValue="1" itemLabel="1 second" /> <f:selectItem itemValue="2" itemLabel="2 seconds" /> <f:selectItem itemValue="5" itemLabel="5 seconds" /> <f:selectItem itemValue="10" itemLabel="10 seconds" /> <ace:ajax /> </ace:selectMenu> <ace:selectMenu value="#{refreshViewScopeBean.duration}" label="Duration:" labelPosition="left"> <f:selectItem itemValue="1" itemLabel="1 minute" /> <f:selectItem itemValue="2" itemLabel="2 minutes" /> <f:selectItem itemValue="-1" itemLabel="forever" /> <ace:ajax /> </ace:selectMenu> </h:form> <ace:panel> Time: <h:outputText value="#{refreshViewScopeBean.currentTime}"/> </ace:panel> </ui:define> </ui:composition>
/* MPL License text (see http://www.mozilla.org/MPL/) */ package org.icefaces.samples.showcase.example.core.refresh; 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.refresh.title", description = "example.core.refresh.description", example = "/resources/examples/core/refresh/refresh.xhtml" ) @ExampleResources( resources ={ // xhtml @ExampleResource(type = ResourceType.xhtml, title="refresh.xhtml", resource = "/resources/examples/core/refresh/refresh.xhtml"), // Java Source @ExampleResource(type = ResourceType.java, title="RefreshBean.java", resource = "/WEB-INF/classes/org/icefaces/samples/showcase"+ "/example/core/refresh/RefreshBean.java") } ) @Menu( title = "menu.core.refresh.subMenu.title", menuLinks = { @MenuLink(title = "menu.core.refresh.subMenu.main", isDefault = true, exampleBeanName = RefreshBean.BEAN_NAME) } ) @ManagedBean(name = RefreshBean.BEAN_NAME) @CustomScoped(value = "#{window}") public class RefreshBean extends ComponentExampleImpl<RefreshBean> implements Serializable { public static final String BEAN_NAME = "refreshBean"; public String getBeanName() { return BEAN_NAME; } public RefreshBean() { super(RefreshBean.class); } @PostConstruct public void initMetaData() { super.initMetaData(); } }