Hello.
I'm using Liferay portal to develop a portlet using struts 2. I need to use
a custom Liferay Window State called exclusive to generate a URL. This
allows me to make AJAX calls and return only the result generated by the
action. I have added the <custom-window-state> tag to my portlet.xml
I tried
<s:url windowState="exclusive" action="moreinformation">
<s:param name="id" value="resourceId" />
</s:url>
but the windowState in the URL always ends up being 'normal' (I presume this
is the default). I did a quick look through the Struts2 code but I couldn't
find the place where this default value was processed (I will look in more
detail later).
I also tried
<portlet:actionURL windowState="exclusive">
<portlet:param name="struts.portlet.action"
value="/gdocs/moreinformation" />
<portlet:param name="id" value="---------------------" />
</portlet:actionURL>
and it works but I need to add a dynamic parameter (id) from the Value Stack
(I'm using s:iterator) but I have no idea how to put it there. <s:property>
doesn't work, using %{} or ${} doesn't work either.
Finally, I solved this problem the following way
<portlet:actionURL windowState="exclusive">
<portlet:param name="struts.portlet.action"
value="/gdocs/moreinformation" />
</portlet:actionURL>&<portlet:namespace />id=<s:property
value="resourceId" />
but it feels kind of hackish and I think that there has to be a better way.
Any suggestions?
Best Regards,
Ricardo