Re: How to remove query parmeter from url string

2012-10-17 Thread Alejandro Scandroli
Hi George I have a similar scenario, but the main difference is that I don't know before hand the names of the query parameters. I only have one page with this particular requirement so I do all the URL query parameters encoding directly in the same page using the events: DECORATE_PAGE_RENDER_LINK

Re: How to remove query parmeter from url string

2012-10-17 Thread George Christman
As always, thanks Lance / Thiago, I think at this point you guys have answered all my base questions. As far as my logic question, I think that it is probably best suited for stack overflow as it doesn't completely relate to tapestry. Hopefully this post will help others in the future who may be tr

Re: How to remove query parmeter from url string

2012-10-17 Thread Lance Java
> It would be nice if tapestry offered you the ability to easily change it's encoder strategy. Example uses dashes instead of the zeros. Download the tapestry sources and check out URLEncoderImpl. Use this as a basis to override the default URLEncoder. -- View this message in context: http://ta

Re: How to remove query parmeter from url string

2012-10-17 Thread Thiago H de Paula Figueiredo
On Wed, 17 Oct 2012 10:36:46 -0300, George Christman wrote: So I think this is my last question in regards to this topic. If your doing your calculations on the fly, example converting aston marton to aston-martin which would mean you would later need to convert it back to aston marton to d

Re: How to remove query parmeter from url string

2012-10-17 Thread George Christman
So I think this is my last question in regards to this topic. If your doing your calculations on the fly, example converting aston marton to aston-martin which would mean you would later need to convert it back to aston marton to do the query, what do you do when the string naturally contains a das

Re: How to remove query parmeter from url string

2012-10-17 Thread Lance Java
> is returning a link in onSuccess the right way to build the URL If you're using @ActivationRequestParam then as Thiago said a void return is probably best. If you're not using @ActivationRequestParam you will either need to build a link or use @Persist (lets not discuss activation context here).

Re: How to remove query parmeter from url string

2012-10-17 Thread George Christman
Hi Lance, yes using @ActivationRequestParam was deffinately much cleaner since I didn't need an onActivate nor did I need to return a Link in onSuccess. BTW, is returning a link in onSuccess the right way to build the URL? A problem I found with @ActivationRequestParam is my inability to handle ex

Re: How to remove query parmeter from url string

2012-10-17 Thread Lance Java
Since you're using tapestry-hibernate, you will be using an auto-generated ValueEncoder under the hood to convert to/from clientside strings to your entities. So this seems to lead to the fact that "Aston Martin" is a primary key in you database. If this is the case it's probably a bad idea to have

Re: How to remove query parmeter from url string

2012-10-16 Thread Lance Java
> tell me if I'm using the RequestParameters properly now? Looks good to me. I guess it's a judgement call as to whether @RequestParam is cleaner than @ActivationRequestParam. With @ActivationRequestParam I'm guessing that onSuccess() was a bit cleaner with a void return? It's up to you in the end

Re: How to remove query parmeter from url string

2012-10-16 Thread George Christman
Hi Lance, setting the variables to null resolved my issue. Not sure what I was doing last night that wouldn't allow it to work. Anyhow Lance, would you take a look at my code below and tell me if I'm using the RequestParameters properly now? Also, how do you typically handle spaces in the URL param

Re: How to remove query parmeter from url string

2012-10-16 Thread Lance Java
Since you've got two entry points, I'd probably use @RequestParam in onActivate() and populate the same render variables that are populated by submitting the form. -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-remove-query-parmeter-from-url-string-tp5716922p5716

Re: How to remove query parmeter from url string

2012-10-16 Thread George Christman
Would it be better to somehow use @RequestParam inside of onActivate rather than @ActivationRequestParameter? BTW, I'll let you know about returning the page instance tonight. Hopefully that works :) -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-remove-query-par

Re: How to remove query parmeter from url string

2012-10-16 Thread Lance Java
Ok, cool... then your @ActivationRequestParameter approach seems fine to me. Just checking ;) -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-remove-query-parmeter-from-url-string-tp5716922p5716959.html Sent from the Tapestry - User mailing list archive at Nabble.c

Re: How to remove query parmeter from url string

2012-10-16 Thread George Christman
Hi Lance, I'd like all the search filters to remain in the URL for book marking, sharing the URL, and SEO. My goal is for the search page to function similarly to the ebaymotors search page. The search form resides directly within the search page. I do however have links from other pages that will

Re: How to remove query parmeter from url string

2012-10-16 Thread Lance Java
George, are you doing all of this to maintain state throughout tapestry's redirect-after-post? Or do you actually have two entry points into your search? If it's the former, have you considered @Persist? You can either use PersistenceConstants.FLASH to temporarily store in the session or Persisten

Re: How to remove query parmeter from url string

2012-10-16 Thread Lance Java
To tell the truth you seem to be duplicating to logic normally seen in a . It seems that you have two ways to fire your search: 1. onActivate - This is where you are getting request parameters which were passed to you from another page (or maybe even this page) 2. Search form is posted - Here you

Re: How to remove query parmeter from url string

2012-10-16 Thread Thiago H de Paula Figueiredo
On Tue, 16 Oct 2012 10:26:10 -0300, Lance Java wrote: On second thought, return this (aka the current page instance) I wouldn't return 'this', as it always forces a redirect, and that's not what you want in all cases, specially inside onActivate() methods. George, I think there's no rea

Re: How to remove query parmeter from url string

2012-10-16 Thread George Christman
Okay, so your thinking my issue has to do with my return logic? I'll give your suggestion a test tonight. Do you see any other issues with me using this code for filter criteria? Just not sure if it's the most efficient way to accomplish this task and considering it's the 2nd highest used page on t

Re: How to remove query parmeter from url string

2012-10-16 Thread Lance Java
On second thought, return this (aka the current page instance) -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-remove-query-parmeter-from-url-string-tp5716922p5716936.html Sent from the Tapestry - User mailing list archive at Nabble.com. --

Re: How to remove query parmeter from url string

2012-10-16 Thread Lance Java
You could simply return this or null. -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-remove-query-parmeter-from-url-string-tp5716922p5716935.html Sent from the Tapestry - User mailing list archive at Nabble.com. ---

Re: How to remove query parmeter from url string

2012-10-16 Thread George Christman
I've tried setting the @ActivationRequestParameter to null, however when the page reloads the parameter still exist in the URL. Do you guys think the URL remains intact do to how I'm reloading the page using pageRenderLinkSource.createPageRenderLink(this.getClass()); ? -- View this message in

Re: How to remove query parmeter from url string

2012-10-16 Thread Lance Java
Ah, I get it now... sorry. I've not needed to do this but can you set your @ActivationRequestParameter values to null? -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-remove-query-parmeter-from-url-string-tp5716922p5716933.html Sent from the Tapestry - User mailing

Re: How to remove query parmeter from url string

2012-10-16 Thread George Christman
Hi Guys, I'm confused now. I decided to use query parameters in my page URL over key/pair parameters. Example http://cardaddy.com/used_cars_for_sale?year=2009&make=Nissan&model=GTR The query parameters are set based on year make model options selected from select menu then submitted. This part

Re: How to remove query parmeter from url string

2012-10-16 Thread Lance Java
Most of the time in tapestry, you will never need to access request parameters yourself. Tapestry's form/input components get and set values on your pages / components for you. Tapestry pages can use the activation context and events can use the event context. It's only very rarely that you should