I need to display <p:selectManyCheckbox>
items with images. I tried to display images with in <p:selectOneRadio>
. It works fine. I am programmatically adding components on UI. This is my code.
answerRadio.setLayout("custom"); //answerRadio is SelectOneRadio
customPnl = (PanelGrid) app.createComponent(PanelGrid.COMPONENT_TYPE);
customPnl.setId("pnl"+qstnCnt);
customPnl.setColumns(3);
radioBtn = (RadioButton) app.createComponent(RadioButton.COMPONENT_TYPE);
radioBtn.setId("opt"+qstnAnsIndx);
radioBtn.setFor("ID of answerRadio");
radioBtn.setItemIndex(ansIndx);
customPnl.getChildren().add(radioBtn);
outPnl.getChildren().add(answerRadio); //outPnl is OutputPanel that include answerRadio
outPnl.getChildren().add(customPnl);
That's <p:selectOneRadio>
with images.
I'd like to use <p:selectManyCheckbox>
in same way. But PrimeFaces has only a <p:radioButton>
for custom layoue and not a <p:checkbox>
like that. How can I achieve it anyway? How can I display <p:selectManyCheckbox>
items with images ?