What if you use the following form?


<form action="$jslink.setAction("myaction")" name="RundataTest"> <input type="submit" name="eventSubmit_doSomething"/> </form>

This should fire the action before anything else. As long as your portlets do not store data in the portletsessionstate, then this should be fine.

Jeremy Ford
[EMAIL PROTECTED]


From: Bjorn Vidar Remme <[EMAIL PROTECTED]>
Reply-To: "Jetspeed Users List" <[EMAIL PROTECTED]>
To: "Jetspeed Users List" <[EMAIL PROTECTED]>
Subject: Re: Portlets execution flow
Date: Fri, 6 Aug 2004 11:10:55 +0200

Hi Oscar,

Note: This answer does not solve your problem, it only confirms it. Read
on if you are interested.

We are using Jetspeed 1.6-dev and we struggle with the same problem
(Velocity portlets in our case). The idea was to have multiple portlets on
the page share information stored in rundata. The BuildNormalContext()
method builds the context based entirely on data stored in rundata. We use
a system to store data in the rundata based on portlet id / portlet group
(parameter) and global for all.
We then write action handlers that performs all the logic and updates the
rundata.

Of course this relies on the fact that the action event is executed BEFORE
the buildNormaContext() methods are executed.

Specifying the action for a specific portlet like this:
<form action="$jslink.getPortletById($portlet.ID)" name="RundataTest"
method="GET">
or this:
<form
action="$jslink.getAction("portlets.test.general.Rundata_TestAction",
$portlet)" name="RundataTest" method="GET">

executes the action specifically for that particular portlet. Exactly what
we wanted.

But, then we noticed that the some of the portlets displayed old data!
The pattern for the problem was top->bottom->left->right as you describe.

Lets say we have two portlets A & B (AE=Action Event,
BNC=BuildNormalContext).
1. Clicking on portlet A executes: AE for A -> BNC for A -> BNC for B
(Perfect!).
2. Clicking on portlet B executes: BNC for A -> AE for B -> BNC for B
(Disaster!)

In case 2 portlet A is diplayed using old values from the rundata object.
Oh dear...

The only answer I have received on this problem is that in JSR168
(Jetspeed-2 implements this) the action event should always be executed
before the portlets are rendered in an undefined order.
Very cute, but migrating to Jetspeed-2 is not an option for the moment.

It would be nice to get an opinion from an experienced Jetspeed developer
on how much work it would be to modifiy Jetspeed-1 to behave in this way
to.
Right now we have to be really careful when planning the actions/flow in
the portal and this is quite a limitation for the moment.



Kind regards,
Bjorn Vidar Remme






"Oscar Ruiz" <[EMAIL PROTECTED]> 05.08.2004 13:33 Please respond to "Jetspeed Users List"

        To:     "'Jetspeed Users List'" <[EMAIL PROTECTED]>
        cc:
        Subject:        Portlets execution flow


Hi all,

can anyone clarify me how multiple MVC portlets (JSP for instance) are
executed and output displayed?

There is obviously an order in which portlet controllers are called,
apparently from top to bottom and left to right.

*apparently* the View component (JSP) is executed right after the
Controller, hence if portlets are sharing a Model the whole thing results
in
a disaster.

Is there a way of rendering the page (i.e. execute the View components)
after all controllers have completed?

Many thanks.

Oscar.



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



_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement



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



Reply via email to