Change the value and background color of Command on oncomplete

I'm new to simple faces and I was wondering if there is a way to change the color and color value of the command button with an incomplete method in the bean base. At the moment, I still can't think of a way to do both at the same time. Any suggestions?

+3


source to share


1 answer


You can call JavaScript function to change button color



<p:commandButton value="click" id="btn1" actionListener="#{something}"  preocess="@this" oncomplete="changeColor()" />

<script>

function changeColor(){
document.getElementById('btn1').style.background='red';
}

</script>

      

0


source







All Articles