Powered By Blogger

Sunday, April 10, 2011

Understanding the two phases of portlet execution: action and render

Action phase: The action phase can only be invoked for one portlet at a
time and is usually the result of an user interaction with the portlet. In
this phase the portlet can change its status, for instance changing the
user preferences of the portlet. It is also recommended that any inserts
and modifications in the database or operations that should not be
repeated are performed in this phase.

• Render phase: The render phase is always invoked for all portlets in
the page after the action phase (which may or not exist). This includes
the portlet that also had executed its action phase. It's important to
note that the order in which the render phase of the portlets in a page
gets executedis not guaranteed by the portlet specification. Liferay has
an extension to the specification through the element render-weight in
liferay-portlet.xml. Portlets with a higher render weight will be
rendered before those with a lower value.


renderURL: this is the type of URL that we have used so far. It invokes a
portlet using only its render phase.

• actionURL: this type of URL tells the portlet that it should execute its
action phase before rendering all the portlets in the page.

No comments:

Post a Comment