Problem setting request parameters using PageRenderLinkSource
Hi, I have a select component onchange of whose value I'm returning a PageLink with request parameters. The id for the select component is pcat. Please find the method being called on change of the value. public Object onValueChangedFromPcat(ItemCategory pcat) { this.pcat = pcat; this.cat = null; this.refreshModels(); this.refreshCatModels(); this.refreshGallarymodel(); // Generating the Link Link fwd = pageRenderLS.createPageRenderLink(ItemBrowse.class); // Adding the request parameters fwd.addParameterValue(pcat, this.pcat); fwd.addParameterValue(cat, this.cat); fwd.addParameterValue(coll, this.coll); // Debug - clean up log.debug(URL VALUE + fwd.toAbsoluteURI()); return fwd; } On doing so the URL on the browser comes out as: http://localhost:8080/km/store/itembrowse%3Fcat=$Ncoll=$Npcat=20120311143401335000 On the other hand the debug message shows it as: http://localhost:8080/km/store/itembrowse?cat=$Ncoll=$Npcat=20120311143401335000 If you see closely instead of '?' the hex value of '%3F' is populated which translates to '??' and I get an exception as: java.lang.IllegalArgumentException Input string 'itembrowse?cat=$Ncoll=$Npcat=20120311143401335000' is not valid; the character '?' at position 11 is not valid. I haven't faced this issue when the url is generated using the t:pagelink tag but only when using PareRenderLinkSource to generate the URL. Is this a Tapestry issue? Please do advice as to what could have caused this to happen and if it could be resolved. Thanks and Regards, Srijith - -- Don't Forget to Rate -- View this message in context: http://tapestry.1045711.n5.nabble.com/Problem-setting-request-parameters-using-PageRenderLinkSource-tp5614443p5614443.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Problem setting request parameters using PageRenderLinkSource
out of curiosity, do you still get the exception when you put teh debug URL into your browser address bar? On 03/04/2012, at 5:34 PM, ksrijith wrote: Hi, I have a select component onchange of whose value I'm returning a PageLink with request parameters. The id for the select component is pcat. Please find the method being called on change of the value. public Object onValueChangedFromPcat(ItemCategory pcat) { this.pcat = pcat; this.cat = null; this.refreshModels(); this.refreshCatModels(); this.refreshGallarymodel(); // Generating the Link Link fwd = pageRenderLS.createPageRenderLink(ItemBrowse.class); // Adding the request parameters fwd.addParameterValue(pcat, this.pcat); fwd.addParameterValue(cat, this.cat); fwd.addParameterValue(coll, this.coll); // Debug - clean up log.debug(URL VALUE + fwd.toAbsoluteURI()); return fwd; } On doing so the URL on the browser comes out as: http://localhost:8080/km/store/itembrowse%3Fcat=$Ncoll=$Npcat=20120311143401335000 On the other hand the debug message shows it as: http://localhost:8080/km/store/itembrowse?cat=$Ncoll=$Npcat=20120311143401335000 If you see closely instead of '?' the hex value of '%3F' is populated which translates to '??' and I get an exception as: java.lang.IllegalArgumentException Input string 'itembrowse?cat=$Ncoll=$Npcat=20120311143401335000' is not valid; the character '?' at position 11 is not valid. I haven't faced this issue when the url is generated using the t:pagelink tag but only when using PareRenderLinkSource to generate the URL. Is this a Tapestry issue? Please do advice as to what could have caused this to happen and if it could be resolved. Thanks and Regards, Srijith - -- Don't Forget to Rate -- View this message in context: http://tapestry.1045711.n5.nabble.com/Problem-setting-request-parameters-using-PageRenderLinkSource-tp5614443p5614443.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Problem setting request parameters using PageRenderLinkSource
No the url that comes out in the debug works perfectly fine. - -- Don't Forget to Rate -- View this message in context: http://tapestry.1045711.n5.nabble.com/Problem-setting-request-parameters-using-PageRenderLinkSource-tp5614443p5614551.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Grid Pager events leave out request parameters
Just thought I'd better check this before filing an issue in JIRA... When I click on a GridPager link, it seems the pages's activation context is sent through but not the request parameters. It's a real problem since I like to put search/filter criteria into the request parameters, so I lose them every time. Can anyone confirm I've got this right? Cheers, Geoff - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Grid Pager events leave out request parameters
Hmmm, it seems EventLink has the same problem - it sends through the page's activation context but not its request parameters. This is in T5.1. Is T5.2 the same? On 21/11/2010, at 8:10 PM, Geoff Callender wrote: Just thought I'd better check this before filing an issue in JIRA... When I click on a GridPager link, it seems the pages's activation context is sent through but not the request parameters. It's a real problem since I like to put search/filter criteria into the request parameters, so I lose them every time. Can anyone confirm I've got this right? Cheers, Geoff - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5 template selection based on the current request (e.g. request parameters)
Yep, you're right. But there are several posts that state that there is a one-to-one relationship of page class and template (with support for i18n'ed templates). Having such a simple solution I wonder where these statements come from and if they are completely wrong. And the question is, if the mentioned solution works correctly without side effects, having the full template lifecycle supported (however this works in detail). So do you say, that the shown solution is working correctly? Thanx cheers, Martin On Thu, 2008-02-07 at 01:17 +0100, Renat Zubairov wrote: Hello Martin, What isn't clear, is what is the question? If it's how to implement it I guess the post you've already found describes it good enough. Renat On 06/02/2008, Martin Grotzke [EMAIL PROTECTED] wrote: Hello, I have a question concerning the relation between template and page class, which admittedly has already been raised sometimes :) Especially, the thread T5: Personalizing page and component template ( http://www.nabble.com/T5%3A-Personalizing-page-and-component-template-td14098291.html ) seems to show a solution for I want to achieve (or, to be honest, my collegues need in a project they are starting). The requirement is to select the chosen page template (or even the template of the layout component) at request time based on e.g. some request parameters, session attribute or s.th. else. I think common use cases are whitelabeling, country specific templates, personalization and there are probably a lot more. I would asume that some of you also have this requirement, so I (and my collegues :)) would be happy if you could share your experiences / solutions concerning this requirement. Jeffrey, as you already presented your solution (mentioned above), did you experience any drawbacks/problems with this implementation? Thanx in advance, cheers, Martin signature.asc Description: This is a digitally signed message part
Re: T5 template selection based on the current request (e.g. request parameters)
I'm not 100% clear either. A page class has one and only one page template, albeit localizeable. It seems like you'll need to do at least 2 things: 1. Use a Layout component specific to the user/page. For this you will have your page template wrap itself in a layout component, the exact type of which must be determined at runtime. If I'm not mistaken there is a way to do this using a delegate or placeholder, but you'll need to look at the core docs to be sure. 2. Embed blocks your page component which render the specifics. You can render these blocks conditionally using t:if. Granted your page will look a bit cobbled, but that is what requirements like this dictate. I've not heard of any method more elegant than this unfortunately - you can see the same thing in RoR (widgets, etc). Hope this helps - sorry I couldn't be more specific about the dynamic layout. chris Martin Grotzke wrote: Yep, you're right. But there are several posts that state that there is a one-to-one relationship of page class and template (with support for i18n'ed templates). Having such a simple solution I wonder where these statements come from and if they are completely wrong. And the question is, if the mentioned solution works correctly without side effects, having the full template lifecycle supported (however this works in detail). So do you say, that the shown solution is working correctly? Thanx cheers, Martin On Thu, 2008-02-07 at 01:17 +0100, Renat Zubairov wrote: Hello Martin, What isn't clear, is what is the question? If it's how to implement it I guess the post you've already found describes it good enough. Renat On 06/02/2008, Martin Grotzke [EMAIL PROTECTED] wrote: Hello, I have a question concerning the relation between template and page class, which admittedly has already been raised sometimes :) Especially, the thread T5: Personalizing page and component template ( http://www.nabble.com/T5%3A-Personalizing-page-and-component-template-td14098291.html ) seems to show a solution for I want to achieve (or, to be honest, my collegues need in a project they are starting). The requirement is to select the chosen page template (or even the template of the layout component) at request time based on e.g. some request parameters, session attribute or s.th. else. I think common use cases are whitelabeling, country specific templates, personalization and there are probably a lot more. I would asume that some of you also have this requirement, so I (and my collegues :)) would be happy if you could share your experiences / solutions concerning this requirement. Jeffrey, as you already presented your solution (mentioned above), did you experience any drawbacks/problems with this implementation? Thanx in advance, cheers, Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 template selection based on the current request (e.g. request parameters)
On Thu, 2008-02-07 at 14:26 +0100, Chris Lewis wrote: I'm not 100% clear either. A page class has one and only one page template, albeit localizeable. What do you think about the mentioned solution (http://www.nabble.com/T5%3A-Personalizing-page-and-component-template-td14098291.html)? It's somehow confusing to find a solution that show custom template selection and to read that A page class has one and only one page... Thanx for clarification, cheers, Martin It seems like you'll need to do at least 2 things: 1. Use a Layout component specific to the user/page. For this you will have your page template wrap itself in a layout component, the exact type of which must be determined at runtime. If I'm not mistaken there is a way to do this using a delegate or placeholder, but you'll need to look at the core docs to be sure. 2. Embed blocks your page component which render the specifics. You can render these blocks conditionally using t:if. Granted your page will look a bit cobbled, but that is what requirements like this dictate. I've not heard of any method more elegant than this unfortunately - you can see the same thing in RoR (widgets, etc). Hope this helps - sorry I couldn't be more specific about the dynamic layout. chris Martin Grotzke wrote: Yep, you're right. But there are several posts that state that there is a one-to-one relationship of page class and template (with support for i18n'ed templates). Having such a simple solution I wonder where these statements come from and if they are completely wrong. And the question is, if the mentioned solution works correctly without side effects, having the full template lifecycle supported (however this works in detail). So do you say, that the shown solution is working correctly? Thanx cheers, Martin On Thu, 2008-02-07 at 01:17 +0100, Renat Zubairov wrote: Hello Martin, What isn't clear, is what is the question? If it's how to implement it I guess the post you've already found describes it good enough. Renat On 06/02/2008, Martin Grotzke [EMAIL PROTECTED] wrote: Hello, I have a question concerning the relation between template and page class, which admittedly has already been raised sometimes :) Especially, the thread T5: Personalizing page and component template ( http://www.nabble.com/T5%3A-Personalizing-page-and-component-template-td14098291.html ) seems to show a solution for I want to achieve (or, to be honest, my collegues need in a project they are starting). The requirement is to select the chosen page template (or even the template of the layout component) at request time based on e.g. some request parameters, session attribute or s.th. else. I think common use cases are whitelabeling, country specific templates, personalization and there are probably a lot more. I would asume that some of you also have this requirement, so I (and my collegues :)) would be happy if you could share your experiences / solutions concerning this requirement. Jeffrey, as you already presented your solution (mentioned above), did you experience any drawbacks/problems with this implementation? Thanx in advance, cheers, Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] signature.asc Description: This is a digitally signed message part
Re: Request Parameters
It's not clear to me what exactly is your goal if it is, as I think, dinamically generate a tapestry url inside a javascript you should then look at one of the IEngineService (depending on the type of service your link will be bound to): http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/engine/IEngineService.html in particular the getLink method. In fact I think there is a lack of documentation in tapestry about how to properly generate url. The most common case (action/listener links for forms or not) you should look at DirectService http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/engine/DirectService.html and the Object passed to the getLink method (even though not documented) should be of type DirectServiceParameter (http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/engine/DirectServiceParameter.html) You can see the types of parameters that can be passed reading DirectLink component documentation (http://tapestry.apache.org/tapestry4.1/components/link/directlink.html) Hope this can be of some help. Martino On 9/21/07, mogulwraith [EMAIL PROTECTED] wrote: From Javascript I try to build a link something like: var link = ${requestlink} + ?firstparam= + paramA + secondparam= + paramB; But when this gets back to the server the only parameter available with request.getParameter is the first one. How can I accomplish this? -- View this message in context: http://www.nabble.com/Request-Parameters-tf4498661.html#a12830070 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Request Parameters
From Javascript I try to build a link something like: var link = ${requestlink} + ?firstparam= + paramA + secondparam= + paramB; But when this gets back to the server the only parameter available with request.getParameter is the first one. How can I accomplish this? -- View this message in context: http://www.nabble.com/Request-Parameters-tf4498661.html#a12830070 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How can I access request parameters in my page class?
James Carman [EMAIL PROTECTED] wrote on 11.07.2006 18:31:07: Can't you set up a page where they type in the value they want and then switch over to the page that displays values based on that? No, I can't :( I need user enter link to this page in its browser or clicks on this links in google or other search engines - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How can I access request parameters in my page class?
Hi Vitaly. Have a look at FAQ number 2.7: I need to calculate a URL to jump to a particular page. How do I do this? http://tapestry.apache.org/tapestry4/faq.html This shows you how to generate URLs for a page that implements IExternalPage. Cheers, Nick. [EMAIL PROTECTED] wrote: James Carman [EMAIL PROTECTED] wrote on 11.07.2006 18:31:07: Can't you set up a page where they type in the value they want and then switch over to the page that displays values based on that? No, I can't :( I need user enter link to this page in its browser or clicks on this links in google or other search engines - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How can I access request parameters in my page class?
Good day! I have tapestry application. I want users enter in browser http://mycompany.com/mytapestryapp?param1=test, and my page class receive value test in it's property param1. So, my question is: how can I access request parameters in my page class? Thanks! With best regards, Vitaly Baranovsky P.S.: Sorry for my bad English - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How can I access request parameters in my page class?
Typically, you don't have users manually type request parameters into their browser. Can't you set up a page where they type in the value they want and then switch over to the page that displays values based on that? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 11:25 AM To: users@tapestry.apache.org Subject: How can I access request parameters in my page class? Good day! I have tapestry application. I want users enter in browser http://mycompany.com/mytapestryapp?param1=test, and my page class receive value test in it's property param1. So, my question is: how can I access request parameters in my page class? Thanks! With best regards, Vitaly Baranovsky P.S.: Sorry for my bad English - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How can I access request parameters in my page class?
Poka, Vitaly ; ) If you absolutely need access to the servlet API, and can't find a way to do what you want that is more Tapestry-ish, you can inject certain service-objects into your page. Here are the relevant HiveMind service points: http://tapestry.apache.org/tapestry4/tapestry-annotations/hivedocs/modul e/tapestry.globals.html So, for example, in your case, you need access to the HttpServletRequest functionality. Two options: you could inject the HttpServletRequest directly into your page: @InjectObject(service:tapestry.globals.HttpServletRequest) public abstract HttpServletRequest getRequest(); Or you could use the Tapestry wrapper/abstraction class: @InjectObject(service:tapestry.globals.WebRequest) public abstract WebRequest getRequest(); In both cases, you'll be able to access the request parameters as you're used to (e.g. ... String param1 = getRequest().getParameter(param1); ...) This is assuming, though, that your users know enough about how Tapestry URLs are structured so that they're getting to the page you intend, which is tricky, error-prone, a security-risk, and technically locks your application into a specific version of Tapestry, since a future of Tapestry could very well structure those URLs very differently. Jim -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 11:25 AM To: users@tapestry.apache.org Subject: How can I access request parameters in my page class? Good day! I have tapestry application. I want users enter in browser http://mycompany.com/mytapestryapp?param1=test, and my page class receive value test in it's property param1. So, my question is: how can I access request parameters in my page class? Thanks! With best regards, Vitaly Baranovsky P.S.: Sorry for my bad English - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]