You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Pramila Manthena <pr...@gmail.com> on 2005/03/01 16:01:09 UTC

Fwd: Passing request parameters between 2 pages

---------- Forwarded message ----------
From: Pramila Manthena <pr...@gmail.com>
Date: Mon, 28 Feb 2005 22:47:13 -0600
Subject: Passing request parameters between 2 pages
To: hlship@apache.org


Hi,

I want to know how we can pass parameters between 2 tapestry pages
without using the visit Object.

The Page2.java pageBeginRender prints the values as null. Is
cycle.activate() not equivalent to a page forward? If not how can I
accomplish passing such parameters without usinf session object like
visit. I may have to pass not only strings but other Objects too.

###### Page1 html: ##################

<input jwcid="@TextField" value="ognl:configName" type="text"
id="configurationName" size="15"/>

<a jwcid="@LinkSubmit" listener="ognl:listeners.generateMatrix"
href="#" class="brownButton">Generate Matrix</a>

###### Page1.page ##################

<property-specification name="configName" type="java.lang.String"/>

###### Page1.java ###################

public abstract String getConfigName();
public abstract void setConfigName(String configName);
public void generateMatrix(IRequestCycle cycle)
       {
               System.out.println("Configuration name= "+getConfigName());
               System.out.println("Product name= "+getSelectedProduct());

               this.setConfigName(getConfigName());
               this.setSelectedProduct(getSelectedProduct());

               // BE logic to create configuration with given name

               IPage nextPage = cycle.getPage("Page2");
               cycle.activate(nextPage);

       }

########## Page2.html ###################

<span jwcid="@InsertText" value="ognl:configName">ABC Configuration</span>

########## Page2.page ##################

<property-specification name="configName" type="java.lang.String"/>

########## Page2.java ###################

public abstract String getConfigName();
public abstract void setConfigName(String configName);
public void pageBeginRender(PageEvent event)
       {
               System.out.println("in page2 PageBeginRender");
               System.out.println("page2 Configuration name= "+getConfigName());
               System.out.println("page2 Product name= "+getSelectedProduct());
       }

Hope to hear from you soon! Need help!!

Thanks,
Pramila

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Passing request parameters between 2 pages

Posted by Adolfo Ruiz <ar...@legosoft.com.mx>.
Hello I understood that you have problems with passing parameters
between two pages 
I think everithing is ok except for one thing:  you forget to set the
parameters on the other page
And then activate it.

Page2 nextPage = (Page2) cycle.getPage("Page2");
nextPage.setName(getConfigName());
nextPage.setProduct(getSelectedPtoduct());
cycle.activate(nextPage);

Hope this help

-----Original Message-----
From: Pramila Manthena [mailto:pramilaraju@gmail.com] 
Sent: Tuesday, March 01, 2005 09:01
To: tapestry-user@jakarta.apache.org
Subject: Fwd: Passing request parameters between 2 pages


---------- Forwarded message ----------
From: Pramila Manthena <pr...@gmail.com>
Date: Mon, 28 Feb 2005 22:47:13 -0600
Subject: Passing request parameters between 2 pages
To: hlship@apache.org


Hi,

I want to know how we can pass parameters between 2 tapestry pages
without using the visit Object.

The Page2.java pageBeginRender prints the values as null. Is
cycle.activate() not equivalent to a page forward? If not how can I
accomplish passing such parameters without usinf session object like
visit. I may have to pass not only strings but other Objects too.

###### Page1 html: ##################

<input jwcid="@TextField" value="ognl:configName" type="text"
id="configurationName" size="15"/>

<a jwcid="@LinkSubmit" listener="ognl:listeners.generateMatrix"
href="#" class="brownButton">Generate Matrix</a>

###### Page1.page ##################

<property-specification name="configName" type="java.lang.String"/>

###### Page1.java ###################

public abstract String getConfigName();
public abstract void setConfigName(String configName);
public void generateMatrix(IRequestCycle cycle)
       {
               System.out.println("Configuration name=
"+getConfigName());
               System.out.println("Product name=
"+getSelectedProduct());

               this.setConfigName(getConfigName());
               this.setSelectedProduct(getSelectedProduct());

               // BE logic to create configuration with given name

               IPage nextPage = cycle.getPage("Page2");
               cycle.activate(nextPage);

       }

########## Page2.html ###################

<span jwcid="@InsertText" value="ognl:configName">ABC
Configuration</span>

########## Page2.page ##################

<property-specification name="configName" type="java.lang.String"/>

########## Page2.java ###################

public abstract String getConfigName();
public abstract void setConfigName(String configName);
public void pageBeginRender(PageEvent event)
       {
               System.out.println("in page2 PageBeginRender");
               System.out.println("page2 Configuration name=
"+getConfigName());
               System.out.println("page2 Product name=
"+getSelectedProduct());
       }

Hope to hear from you soon! Need help!!

Thanks,
Pramila

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Fwd: Passing request parameters between 2 pages

Posted by "seloha ." <se...@hotmail.com>.
Something like this:

between lines:

               IPage nextPage = cycle.getPage(&quot;Page2&quot;);
               cycle.activate(nextPage);

of Page1 put:

               nextPage.setConfigName(getConfigName());




&gt;From: Pramila Manthena &lt;pramilaraju@gmail.com&gt;
&gt;Reply-To: Pramila Manthena &lt;pramilaraju@gmail.com&gt;
&gt;To: tapestry-user@jakarta.apache.org
&gt;Subject: Fwd: Passing request parameters between 2 pages
&gt;Date: Tue, 1 Mar 2005 09:01:09 -0600
&gt;
&gt;---------- Forwarded message ----------
&gt;From: Pramila Manthena &lt;pramilaraju@gmail.com&gt;
&gt;Date: Mon, 28 Feb 2005 22:47:13 -0600
&gt;Subject: Passing request parameters between 2 pages
&gt;To: hlship@apache.org
&gt;
&gt;
&gt;Hi,
&gt;
&gt;I want to know how we can pass parameters between 2 tapestry pages
&gt;without using the visit Object.
&gt;
&gt;The Page2.java pageBeginRender prints the values as null. Is
&gt;cycle.activate() not equivalent to a page forward? If not how can I
&gt;accomplish passing such parameters without usinf session object like
&gt;visit. I may have to pass not only strings but other Objects too.
&gt;
&gt;###### Page1 html: ##################
&gt;
&gt;&lt;input jwcid=&quot;@TextField&quot; value=&quot;ognl:configName&quot; 
type=&quot;text&quot;
&gt;id=&quot;configurationName&quot; size=&quot;15&quot;/&gt;
&gt;
&gt;&lt;a jwcid=&quot;@LinkSubmit&quot; 
listener=&quot;ognl:listeners.generateMatrix&quot;
&gt;href=&quot;#&quot; class=&quot;brownButton&quot;&gt;Generate 
Matrix&lt;/a&gt;
&gt;
&gt;###### Page1.page ##################
&gt;
&gt;&lt;property-specification name=&quot;configName&quot; 
type=&quot;java.lang.String&quot;/&gt;
&gt;
&gt;###### Page1.java ###################
&gt;
&gt;public abstract String getConfigName();
&gt;public abstract void setConfigName(String configName);
&gt;public void generateMatrix(IRequestCycle cycle)
&gt;        {
&gt;                System.out.println(&quot;Configuration name= 
&quot;+getConfigName());
&gt;                System.out.println(&quot;Product name= 
&quot;+getSelectedProduct());
&gt;
&gt;                this.setConfigName(getConfigName());
&gt;                this.setSelectedProduct(getSelectedProduct());
&gt;
&gt;                // BE logic to create configuration with given name
&gt;
&gt;                IPage nextPage = cycle.getPage(&quot;Page2&quot;);
&gt;                cycle.activate(nextPage);
&gt;
&gt;        }
&gt;
&gt;########## Page2.html ###################
&gt;
&gt;&lt;span jwcid=&quot;@InsertText&quot; 
value=&quot;ognl:configName&quot;&gt;ABC Configuration&lt;/span&gt;
&gt;
&gt;########## Page2.page ##################
&gt;
&gt;&lt;property-specification name=&quot;configName&quot; 
type=&quot;java.lang.String&quot;/&gt;
&gt;
&gt;########## Page2.java ###################
&gt;
&gt;public abstract String getConfigName();
&gt;public abstract void setConfigName(String configName);
&gt;public void pageBeginRender(PageEvent event)
&gt;        {
&gt;                System.out.println(&quot;in page2 
PageBeginRender&quot;);
&gt;                System.out.println(&quot;page2 Configuration name= 
&quot;+getConfigName());
&gt;                System.out.println(&quot;page2 Product name= 
&quot;+getSelectedProduct());
&gt;        }
&gt;
&gt;Hope to hear from you soon! Need help!!
&gt;
&gt;Thanks,
&gt;Pramila
&gt;
&gt;---------------------------------------------------------------------
&gt;To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
&gt;For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
&gt;



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org