I want to put a label beside the radio button.
HtmlSelectOneRadio
has a setLabel(String s)
method. But it does not work.
Is there a way to do that without using another library?
I want to put a label beside the radio button.
HtmlSelectOneRadio
has a setLabel(String s)
method. But it does not work.
Is there a way to do that without using another library?
It is done by using the setItemLabel in the UISelectItem object.
Then using some css to let it the way you want.
UISelectItem selectItemSim = new UISelectItem();
UISelectItem selectItemNao = new UISelectItem();
selectItemSim.setItemLabel("SIM");
selectItemSim.setItemValue("SIM");
selectItemSim.setId(perguntaVO.getCodigo() + "SIM");
selectItemNao.setItemValue("NAO");
selectItemNao.setItemLabel("NÃO");
selectItemNao.setId(perguntaVO.getCodigo() + "NAO");
htmlOneRadio.getChildren().add(selectItemSim);
htmlOneRadio.getChildren().add(selectItemNao);