On Tuesday, February 3, 2004, at 06:08 AM, Swientek, Jens-Martin wrote: [snip]

Thanks for your reply.
For some reasons this does not work as intended.
I have to portlets on a pane. portlet1 displays a Velocity-Template with a link to portlet2. This link should also call a specified action-method.


The link
"<a href="$jsforward.forward('ForwardPortlet')">Portlet Forward</a>"
results in
"...default.psml/js_peid/P-fa76ed989d- 10000?action=portlets.ForwardTargetAction"
but nothing happens.


I've changed my forward to:
----------------------------------------------------------------------- -------
<forward name='ForwardPortlet'>
<portlet id='P-fa76ed989d-10000' action='portlets.ForwardTargetAction'/>
</forward>
----------------------------------------------------------------------- -------
I've got the portlet id from the users default.psml file.



The ForwardTargetAction should simply change the displayed Template of portlet2:
----------------------------------------------------------------------- ---------
protected void buildNormalContext(VelocityPortlet portlet,
Context context,
RunData rundata) {
setTemplate(rundata, "ForwardTarget2.vm");
}
----------------------------------------------------------------------- ---------


But nothing happens. What's going wrong?

You should change a portlet's template in the action phase, not the render (buildNormalContext) phase.

Here is an example of saving an employee record that may be useful:

In your vm file:

<form action="$jsforward.forward('EmployeeForm', 'Action')" method="POST">
....
<input type="image" src="images/buttons/save.gif"
border="0" alt="Save" value="Save" name="eventSubmit_doSave"/>


This will call the doSave event on your action.

Then in your forwards xml, one way to do this is with a portlet forward as:

<portlet-forward portlet='EmployeeForm' forward='EmployeeAction' target='Action'/>

<forward name='EmployeeAction'>
<portlet id='EmployeeForm' action='portlets.EmployeeFormAction'/>
</forward>


I'll update the tutorial to demonstrate forwards in actions as examples.
Let you know when its ready


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



Reply via email to