Slot A
2
Slot B
2
Slot C
2
Slot D
6
Slot
The UiSlotWidthHandler can be used to easily handle dynamic slot widths. The handler provides two different attributes:
- This width itself (a, b, c, ...)
- The information to show the slot or not (showA, showB, showC...)
<j:row id="row">
<j:slot width="#{handlerSlotBean.uiSlot.a}" rendered="#{handlerSlotBean.uiSlot.showA}">
<p:panel header="Slot A" styleClass="jeeslPanel jeesl-panel">
<j:inputGrid labelWidth="9">
<p:outputLabel value="Width"/>
<h:panelGroup styleClass="ui-outputtext"><h:outputText value="#{handlerSlotBean.uiSlot.a}"/></h:panelGroup>
</j:inputGrid>
</p:panel>
</j:slot>
<j:slot width="#{handlerSlotBean.uiSlot.b}" rendered="#{handlerSlotBean.uiSlot.showB}">
<p:panel header="Slot B" styleClass="jeeslPanel jeesl-panel">
<j:inputGrid labelWidth="9">
<p:outputLabel value="Width"/>
<h:panelGroup styleClass="ui-outputtext"><h:outputText value="#{handlerSlotBean.uiSlot.b}"/></h:panelGroup>
</j:inputGrid>
</p:panel>
</j:slot>
<j:slot width="#{handlerSlotBean.uiSlot.c}" rendered="#{handlerSlotBean.uiSlot.showC}">
<p:panel header="Slot C" styleClass="jeeslPanel jeesl-panel">
<j:inputGrid labelWidth="9">
<p:outputLabel value="Width"/>
<h:panelGroup styleClass="ui-outputtext"><h:outputText value="#{handlerSlotBean.uiSlot.c}"/></h:panelGroup>
</j:inputGrid>
</p:panel>
</j:slot>
<j:slot width="#{handlerSlotBean.uiSlot.d}" rendered="#{handlerSlotBean.uiSlot.showD}">
<p:panel header="Slot D" styleClass="jeeslPanel jeesl-panel">
<j:inputGrid labelWidth="9">
<p:outputLabel value="Width"/>
<h:panelGroup styleClass="ui-outputtext"><h:outputText value="#{handlerSlotBean.uiSlot.d}"/></h:panelGroup>
</j:inputGrid>
</p:panel>
</j:slot>
</j:row>
@Named @ViewScoped
public class HandlerSlotBean extends AbstractJeeBean implements Serializable
{
final static Logger logger = LoggerFactory.getLogger(HandlerSlotBean.class);
private static final long serialVersionUID = 1L;
private final UiSlotWidthHandler uiSlot;
public UiSlotWidthHandler getUiSlot() {return uiSlot;}
public HandlerSlotBean()
{
uiSlot = new UiSlotWidthHandler();
}
@PostConstruct public void init()
{
super.initSecurity();
test1();
}
public void test1() {uiSlot.set(2,2,2,6);}
public void test2() {uiSlot.set(5,3,2,2);}
public void test3() {uiSlot.set(6,3,3);}
public void test4() {uiSlot.set(8,2,0,2);}
}
Resource not found:
/jeesl/java/org/jeesl/controller/handler/ui/UiSlotWidthHandler.java
must be available in the classpath