Slot A
2
Slot B
2
Slot C
2
Slot D
6
Select Many
There are two different handler available:
- JeeslSelectManyCodeHandler can be used if the entity is implementing EjbWithCode
- JeeslSelectManyEmailHandler can be used if the entity is implementing EjbWIthEmail
- JeeslSelectManyIdHandler can be used if the entity is implementing EjbWIthId (NYI)
The purpose of these handler is to have an easier way of dealing with some Primefaces components like
- p:selectMany ...
<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 HandlerEditBean extends AbstractJeeBean implements Serializable
{
final static Logger logger = LoggerFactory.getLogger(HandlerEditBean.class);
private static final long serialVersionUID = 1L;
private UiEditStatusHandler<IoFileType> eh1; public UiEditStatusHandler<IoFileType> getEh1() {return eh1;}
private UiEditStatusHandler<IoFileType> eh2; public UiEditStatusHandler<IoFileType> getEh2() {return eh2;}
private final UiEditBooleanHandler ehBool; public UiEditBooleanHandler getEhBool() {return ehBool;}
private UiEditLogicHandler eh3; public UiEditLogicHandler getEh3() {return eh3;}
private List<IoFileType> types; public List<IoFileType> getTypes() {return types;}
private final Map<IoFileType,Boolean> map1; public Map<IoFileType,Boolean> getMap1() {return map1;}
private final Map<IoFileType,Boolean> map2; public Map<IoFileType,Boolean> getMap2() {return map2;}
private final Map<IoFileType,Boolean> map3; public Map<IoFileType,Boolean> getMap3() {return map3;}
private IoFileType type;
public IoFileType getType() {return type;}
public void setType(IoFileType type) {this.type = type;}
private String txt; public String getTxt() {return txt;} public void setTxt(String txt) {this.txt = txt;}
public HandlerEditBean()
{
eh1 = new UiEditStatusHandler<>();
eh2 = new UiEditStatusHandler<>();
eh3 = new UiEditLogicHandler(UiEditLogicHandler.Type.AND);
eh3.addHandler(eh1);
eh3.addHandler(eh2);
ehBool = new UiEditBooleanHandler();
map1 = new HashMap<>();
map2 = new HashMap<>();
map3 = new HashMap<>();
}
@PostConstruct public void init()
{
super.initSecurity();
types = fUtils.allOrderedPositionVisible(IoFileType.class);
eh1.addAllow(types.get(1));
eh2.addDeny(types.get(2));
for(IoFileType t : types)
{
eh1.update(t); map1.put(t,eh1.isAllow());
eh2.update(t); map2.put(t,eh2.isAllow());
eh3.update(); map3.put(t,eh3.isAllow());
}
}
public void selectType()
{
logger.info(type.toString());
eh1.update(type);
eh2.update(type);
eh3.update();
}
public void save() {}
}
Resource not found:
/jeesl/java/org/jeesl/controller/handler/ui/UiSlotWidthHandler.java
must be available in the classpath