Hi Pierre,
Thanks for your reply.
Could we provide you with a general view what we already did?
As you knew, we have 2 different portlets (HelloVelocity and Replica) with the same
function;
We have 2 xreg files, 2 vm files and 2 java files:
_ demo-portlets.xreg, myportlet.xreg;
_ hello.vm, replica.vm;
_ HelloAction.java, Bonjour.java file.
Open the psml\user\turbine\html\default.psml file, both new text values are saved.
Running Jetspeed, we got the update problem (as we reported in the our first email).
We hope now you understand clearly our scene.
Thanks for your help,
David
Here are the contents of our files:
myportlet.xreg content:
<portlet-entry name="Replica" hidden="false" type="ref"
parent="CustomizerVelocity" application="false">
<meta-info>
<title>Test</title>
<description>...</description>
</meta-info>
<parameter name="template" value="replica" hidden="false"/>
<parameter name="action" value="test.Bonjour" hidden="false"/>
<parameter name="text2" value="initial value" hidden="false"/>
<media-type ref="html"/>
</portlet-entry>
replica.vm content:
#if (!$text2)
#set ( $text2 = "Salut" )
#end
<form action="$jlink" method="post">
<font color="$!{skin.Color}">
<h2>$text2</h2>
<p>please enter text:
<br /><input name="inputtext" value="$text2" size="30" />
<input type="submit" name="eventSubmit_doUpdate" value="Change" class="BUTON"/>
</p>
</font>
</form>
Bonjour.java
public void doUpdate(RunData data, Context context)
{
String text = data.getParameters().getString("inputtext");
if (text!=null)
{
VelocityPortlet portlet = (VelocityPortlet)context.get("portlet");
if (portlet!= null) {
portlet.setAttribute("text2",text,data);
context.put("text2",text);
//...
}
//...
}
}
----- Original Message -----
From: "Pierre BESNARD" <[EMAIL PROTECTED]>
Date: Fri, 5 Apr 2002 09:33:08 +0200
To: <[EMAIL PROTECTED]>
Subject: RE: Problem with Update button
> Hi David,
>
> You don't have to define your action in any Jetspeed template!
> check if your doUpdate2() method realy do things like:
> portlet.setAttribute("text2",text,data);
> or
> portlet.setTitle(text);
>
> If you use the second way to set the title of replica, the title is not store in the
>psml file. So, each time you reload the portlet, the value of text2 define in the
>.xreg file will be load.
>
> try to deploy the CVS version of Jetspeed like said you the other David!
> You'll see, you can use 2 doUpdate() method and only one will be called.
>
> regards,
>
> --
> Pierre
>
> -----Message d'origine-----
> De : David Humphrey [mailto:[EMAIL PROTECTED]]
> Envoy� : vendredi 5 avril 2002 05:53
> � : [EMAIL PROTECTED]
> Objet : RE: Problem with Update button
>
>
>
> Hi Pierre,
>
> We made a little change in our code:
>
> doUpdate() is changed to doUpdate2() (in Bonjour.java file - a copy of
>HelloAction.java)
>
>
> and (in replica.vm)
>
> <input type="submit" name="eventSubmit_doUpdate" value="Update" />
>
> is changed to
>
> <input type="submit" name="eventSubmit_doUpdate2" value="Change" class="BUTON"/>
>
>
>
> Now, when we press <Change> button from Replica portlet, the title text is updated
>and the text on HelloVelocity portlet is not be refreshed to the default value.
>CONGRATULATION!
>
> But the problem still exists on HelloVelocity portlet. E.g pressing <Update> button
>on HelloVelocity portlet, the title of Replica portlet will be refreshed to the
>default value!?
>
> Do we need to define eventSubmit_doUpdate2 in permission-form.vm, role-form.vm,...?
>
>
>
>
>
> ----- Original Message -----
> From: "Pierre BESNARD" <[EMAIL PROTECTED]>
> To: "Jetspeed Users List" <[EMAIL PROTECTED]>
> Sent: Thursday, April 04, 2002 9:01 PM
> Subject: RE: Problem with Update button
>
>
> hi,
> Its normal!
> You have 2 copy of the HelloAction class load in the portal which both have a
>doUpdate() method.
> When you press the update button, the doUpdate() method il called for each Action
>class which have the doUpdate() method.
> And, since you don't post the new $text value to the HelloVelocityPortlet, it is
>refresh with the default value.
>
> I hope you understood me! :)
>
> Pierre
> -----Message d'origine-----
> De : David Humphrey [mailto:[EMAIL PROTECTED]]
> Envoy� : jeudi 4 avril 2002 05:32
> � : [EMAIL PROTECTED]
> Objet : Problem with Update button
>
>
>
>
> On Jetspeed, we duplicated HelloVelocity portlet example.
> We call the copy portlet "Replica".
> We rename parameter "text" to "text2", the input name "text" to "inputtext".
>
> When we type "Hi there" in HelloVelocity portlet, the title text is updated. (OK)
>
> The same as we type in Replica portlet. (OK)
>
> But the problem is, if we press "Update" button on one portlet, the other portlet
>will be refreshed with the default value!
>
> For example:
> Default text value for HelloVelocity portlet(hello.vm): Hello World in Velocity
>
> Default text value for Replica portlet(replica.vm): Bonjour
>
> Now, we change "Hello World in Velocity" text to "Hi there".
> Press <Update> button.
> The title text on Hello Velocity portlet is updated.
>
> Now, we change "Bonjour" text to "Cava?".
> Press <Update> button.
> The title text on Replica portlet is updated, AND
> HelloVelocity portlet will display "Hello World in Velocity" (Not "Hi there" text)
>and vice versa, if we now change text on HelloVelocity portlet, the Replica portlet
>will show "Bonjour" (Not "cava?").
>
>
> Please help.
>
> --
>
> _______________________________________________
> Sign-up for your own FREE Personalized E-mail at Mail.com
> http://www.mail.com/?sr=signup
>
>
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
> --
>
> _______________________________________________
> Sign-up for your own FREE Personalized E-mail at Mail.com
> http://www.mail.com/?sr=signup
>
>
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
--
_______________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>