See below:


From: Bjorn Vidar Remme <[EMAIL PROTECTED]>
Reply-To: "Jetspeed Users List" <[EMAIL PROTECTED]>
To: "Jetspeed Users List" <[EMAIL PROTECTED]>
Subject: Multiple portlet instances and action event execution order
Date: Thu, 8 Jul 2004 09:49:32 +0200

Hi all,

i have a pane with multiple portlets of the same type added. Works
perfectly now, this was a issue before, but it is solved nicely. Thanks to
the individuals who made that possible :

The portlets are configured to behave differently, but the share some
common data. We store the common data in the RunData object. We can store
data on three different levels: UserSace (rundata.getUser.setTemp()) ,
PortletgroupSpace  (homebrewed) and PortletSpace (using the portlet id).
This also works perfectly.

My problem now is how to handle the action events fired from these
portlets.
If I do the following (velocity):
<form action="$jslink" name="RundataTest" method="POST">
<input type="submit" name="eventSubmit_doBrowse_refresh" value="Refresh" >
</form>

the doBrowse_refresh() method is called for all the portlets on the page
with the same input values. This of course overwrites all the portlet
unique values in rundata. The events look like this:
-       doBrowse_Refresh() for portlet 1
-       buildNormalContext() for portlet 1
-       doBrowse_Refresh() for portlet 2
-       buildNormalContext() for portlet 2


I then modified the code to use the portlet id. This is based on the HTML source for the portlet controls. I manually add the portletid to the context:

<form action="$jslink/js_peid/$!portletid" name="RundataTest"
method="POST">
<input type="submit" name="eventSubmit_doBrowse_refresh" value="Refresh" >
</form>

Is there a equivalent to $jslink that would automatically do this?


$jslink.getPortletById($portlet.ID)


The result was better but not as expected. Now it turned out that the ordering on the pane was important. Lets say that we click on Portlet 2 which is the portlet on the left side of the pane. The events then look like this: - buildNormalContext() for portlet 1 - doBrowse_Refresh() for portlet 2 - buildNormalContext() for portlet 2


Almost what I want! The problem now is that portlet 1 is displaying old data, because the global/group entires in rundata was updated after the buildNormalContext() method was executed. If we click on Portel 1 everything works perfectly, because the events now look like: - doBrowse_Refresh() for portlet 1 - buildNormalContext() for portlet 1 - buildNormalContext() for portlet 2


Is it possible to get the action event to always be handled first regardless of which portlet the request was sent from, i.e. the events after clicking on portlet 2 should be: - doBrowse_Refresh() for portlet 2 - buildNormalContext() for portlet 1 - buildNormalContext() for portlet 2




If you want your action to fire first before any portlets are rendered, you will need to specify the action parameter in the url. This will cause your event to fire first.




Med vennlig hilsen/Kind regards,

Bjorn Vidar Remme
Application Engineer



Jeremy Ford
[EMAIL PROTECTED]

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to