How to add an effect to growl in a show?

I have an attached lever, which I define so that it appears after adding the user to the database, and I want this lever to have the slide action shown below:

<p:outputPanel id="idMainGrowl"> <p:growl id="idGrowl" binding="#{myBean.growl}" life="700000" closeable="true" > <p:effect type="bounce" event="load" delay="0" > <f:param name="mode" value="'show'" /> </p:effect> </p:growl> </p:outputPanel> 

but the code above will not work, please report.

+4
source share
1 answer

I have a little hack for you. I ran into the same problem and solved it by raising the jquery event as follows:

 <p:growl id="idGrowl" life="3000" closeable="true" > <h:outputScript> $("#idGrowl_container").effect("pulsate", { times:3 }, 2000); </h:outputScript> </p:growl> 

You must apply the effect to your id + "_container". Make sure your jQuery Selector points to the correct generated identifier on your jsf page, so be sure to s with your growl. To apply the bounce effect, just make small changes to the effect, as described below: http://api.jqueryui.com/bounce-effect/

+1
source

Source: https://habr.com/ru/post/1489858/


All Articles