Run p: commandLink before onclick event?

I have p:commandLink that launches a dialog on click. Next, there is an action that must be performed before starting the dialogue, since the dialogue depends on the content that fills the action.

How to run an action before launching a popup without javascript?

 <p:commandLink action="#{service.computePrefetch(_var)}" onclick="dlg.show()"/> 
+4
source share
1 answer

With oncomplete attribute and ajax update attribute.

 <p:commandLink action="#{service.computePrefetch(_var)}" update="dlgId" oncomplete="dlg.show()"/> 

Order of execution:

onclick-> action-> update-> OnComplete

BalusC posted a detailed sequence of events when clicking PrimeFaces p: commandButton

+18
source

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


All Articles