0

I am a beginner. I would like to know which attribute is executed first when button is clicked.

For example is bean.method called first, than update takes place or update happens first than the method is called?

p:commandButton update="form" actionListener="#{bean.method}"
Marko
  • 20,385
  • 13
  • 48
  • 64
Ali Atıl
  • 121
  • 7
  • See this [Action and ActionListener](http://stackoverflow.com/a/3909382/3102124) for information about `actionListener` or the `action`attribute – Kami Aug 01 '15 at 13:02
  • Have a look at the JSF Standard Request-Response Lifecycle: https://docs.oracle.com/javaee/6/tutorial/doc/bnaqq.html The actionListener should be invoked in the "Invoke Application" phase and the update happens in the "Render Response" phase. – Markus Patt Aug 01 '15 at 13:06
  • @MPirious: since the OP states he/she is a beginner, the concept of 'update' might even beci onfusing. In basic jsf it is called 'render' which is done in the Render Response phase. Updating the model, whichh is a different thing takes place in another earlier phase. A link to the differences in the PrimeFaces vs plain jsf would help to I think http://stackoverflow.com/questions/25339056/understanding-process-and-update-attributes-of-primefaces – Kukeltje Aug 01 '15 at 15:52
  • The method is executed (assuming that there are no request validation failures) and then the update is carried out – kolossus Aug 01 '15 at 18:53
  • i read the oracle document about the faces application lifecycle . it helped me to understand the concept more clear – Ali Atıl Aug 02 '15 at 09:32

0 Answers0