You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Angelo C." <an...@gmail.com> on 2012/08/02 05:15:44 UTC

redirecting to a class with parameter

Hi,

I have a class that need to return to another class with context parameter,
how? Thanks,

Angelo

public class Info {
    Object onActivate(String type) {
		}
}


@OnEvent(value = EventConstants.SUBMIT, component = "premiumForm")
public Object premiumSubmit() {
	return Info.class;
}




--
View this message in context: http://tapestry.1045711.n5.nabble.com/redirecting-to-a-class-with-parameter-tp5714980.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: redirecting to a class with parameter

Posted by "Angelo C." <an...@gmail.com>.
it's an external url, i found out it can be done this way:

new URL("http://sample.com?type='123'")


Taha Hafeez wrote
> 
> What is url ? Is it a tapestry page or event. 
> 
> For page you can use PageRenderLinkSource#createPageRenderLinkWithContext
> and for event you can use ComponentResources#createEventLink...
> 
> 
> On Aug 2, 2012, at 9:10 AM, Angelo C. wrote:
> 
>> thanks for the fast answer, it works, in a related question, if I have
>> something like this:
>> URL u = new URL(url);
>> how to add some query parameters? 
>> 
>> 
>> 
>> --
>> View this message in context:
>> http://tapestry.1045711.n5.nabble.com/redirecting-to-a-class-with-parameter-tp5714980p5714982.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@.apache
>> For additional commands, e-mail: users-help@.apache
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@.apache
> For additional commands, e-mail: users-help@.apache
> 




--
View this message in context: http://tapestry.1045711.n5.nabble.com/redirecting-to-a-class-with-parameter-tp5714980p5714985.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: redirecting to a class with parameter

Posted by Taha Siddiqi <ta...@gmail.com>.
What is url ? Is it a tapestry page or event. 

For page you can use PageRenderLinkSource#createPageRenderLinkWithContext and for event you can use ComponentResources#createEventLink...


On Aug 2, 2012, at 9:10 AM, Angelo C. wrote:

> thanks for the fast answer, it works, in a related question, if I have
> something like this:
> URL u = new URL(url);
> how to add some query parameters? 
> 
> 
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/redirecting-to-a-class-with-parameter-tp5714980p5714982.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


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


Re: redirecting to a class with parameter

Posted by "Angelo C." <an...@gmail.com>.
thanks for the fast answer, it works, in a related question, if I have
something like this:
 URL u = new URL(url);
how to add some query parameters? 



--
View this message in context: http://tapestry.1045711.n5.nabble.com/redirecting-to-a-class-with-parameter-tp5714980p5714982.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: redirecting to a class with parameter

Posted by Taha Siddiqi <ta...@gmail.com>.
Hi

You can use :-

@Inject
private PageRenderLinkSource linkSource;

@OnEvent(value = EventConstants.SUBMIT, component = "premiumForm")
public Object premiumSubmit(){
   return linkSource.createPageRenderLinkWithContext(Info.class, "whateverType");
}

or may be create a property "type" in "Info" page and use @InjectPage


@InjectPage
private Info infoPage;


@OnEvent(value = EventConstants.SUBMIT, component = "premiumForm")
public Object premiumSubmit(){
   infoPage.setType("whateverType");
   return infoPage;
}

regards
Taha


On Aug 2, 2012, at 8:45 AM, Angelo C. wrote:

> Hi,
> 
> I have a class that need to return to another class with context parameter,
> how? Thanks,
> 
> Angelo
> 
> public class Info {
>    Object onActivate(String type) {
> 		}
> }
> 
> 
> @OnEvent(value = EventConstants.SUBMIT, component = "premiumForm")
> public Object premiumSubmit() {
> 	return Info.class;
> }
> 
> 
> 
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/redirecting-to-a-class-with-parameter-tp5714980.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


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