Remove message from h:outputText ofter time

321 views Asked by At

I'm using this message to display mail status

<h:outputText id="output" value="#{mailhandler.result}"  />

I'm interested how I can remove the text after 5 seconds from the screen?

1

There are 1 answers

2
Evan Knowles On

Give it a class so it's easier to refer to

<h:outputText id="output" value="#{mailhandler.result}"  styleClass="timeout" />

Then add JavaScript/jQuery:

 setTimeout(function() {
     $('.timeout').toggle();
 }, 5000);