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("Page2");
cycle.activate(nextPage);
of Page1 put:
nextPage.setConfigName(getConfigName());
>From: Pramila Manthena <pramilaraju@gmail.com>
>Reply-To: Pramila Manthena <pramilaraju@gmail.com>
>To: tapestry-user@jakarta.apache.org
>Subject: Fwd: Passing request parameters between 2 pages
>Date: Tue, 1 Mar 2005 09:01:09 -0600
>
>---------- Forwarded message ----------
>From: Pramila Manthena <pramilaraju@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