Bom dia Pessoal,
Estou tentando utilizar o componente HtmlSelectManyCheck do Tomahawk, pois ele possuí uma propriedade que não há no componente da especificação, a propriedade LayoutWidth.
Essa propriedade pode ser utilizada para gerar as checkbox em colunas, porem não estou conseguindo fazer isso programaticamente.
Quando eu seto no JSP essa propriedade, funciona corretamente, mas se eu seto ela em um backingbean parece que a propriedade é ignorada.
Alguem pode me ajudar?!
Segue em anexo no meu código.
JSP<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<html>
<body>
<f:view>
<h:form id="form1">
<h:panelGrid binding="#{bb.gridao}">
</h:panelGrid>
</h:form>
</f:view>
</body>
</html>
public class Bb {
private HtmlPanelGrid gridao;
public HtmlPanelGrid getGridao() {
FacesContext faces = FacesContext.getCurrentInstance();
Application app = faces.getApplication();
gridao = (HtmlPanelGrid)app.createComponent(HtmlPanelGrid.COMPONENT_TYPE);
HtmlSelectManyCheckbox check = (HtmlSelectManyCheckbox)app.createComponent(HtmlSelectManyCheckbox.COMPONENT_TYPE);
UISelectItem a = (UISelectItem) app.createComponent(UISelectItem.COMPONENT_TYPE);
a.setId("a");
a.setItemValue("a");
a.setItemLabel("aaaa");
UISelectItem b = (UISelectItem) app.createComponent(UISelectItem.COMPONENT_TYPE);
b.setId("b");
b.setItemValue("b");
b.setItemLabel("bbbb");
UISelectItem c = (UISelectItem) app.createComponent(UISelectItem.COMPONENT_TYPE);
c.setId("c");
c.setItemValue("c");
c.setItemLabel("cccc");
UISelectItem d = (UISelectItem) app.createComponent(UISelectItem.COMPONENT_TYPE);
d.setId("d");
d.setItemValue("d");
d.setItemLabel("ddddd");
check.setLayoutWidth("2");
check.setLayout("pageDirection");
check.getRendererType();
check.getChildren().add(a);
check.getChildren().add(b);
check.getChildren().add(c);
check.getChildren().add(d);
gridao.getChildren().add(check);
faces.renderResponse();
return gridao;
}
public void setGridao(HtmlPanelGrid grid) {
this.gridao = grid;
}
}
Valeu pessoal,
Ferry