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

Popular posts from this blog

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -