jsf - Append CSS style from a bean -
is possible append style during @postconstruct of component, example commandbutton. change style class here no way because need dynamic values.
i tried following resets style of button
uiviewroot root = facescontext.getcurrentinstance().getviewroot(); commandbutton button = (commandbutton)root.findcomponent("form:btn1"); button.setstyle("background-color: red;");
you can assign style commandbutton
dynamically using expression language:
<p:commandbutton ... style="#{bean.buttonstyle}" ... />
Comments
Post a Comment