Have you tried just changing the form attribute on the Lift tag to "GET"
instead of "POST"?
Anyways, you should be able to just do a mapping on S.request.params to
"regenerate" the URL. Something like:
S.request.map(r =>
val m = r.params
... update the form values you want to change here ...
m.keys.map(key => m(key).mkString(key + "=", "&" + key +
"=")).mkString("?","&","")
}
Ugly, but it should work. There has to be a cleaner way but I don't have
time to really dig into it at the moment.
Derek
On Thu, Mar 26, 2009 at 2:51 PM, Timothy Perrett <[email protected]>wrote:
> Sorry, let me be more accurate. Lets say your viewing the following:
>
> /catalogue?filter=marin&limit=10&page=1
>
> I then want a dropdown menu to change “10” in limit to, say, 20. So I setup
> a form, but when it does the POST of course those paramaters are gone and
> the URL goes to:
>
> /catalogue
>
> Which because my function that calculates the URL is looking for those
> filter parameters it bombs out as they are missing when its trying to
> evaluate.
>
> My current thinking is to perhaps use some hidden field which holds the
> value of S.uri or something... Im not sure.
>
> Does that help?
>
> Cheers, Tim
>
>
>
> On 26/03/2009 19:42, "Derek Chen-Becker" <[email protected]> wrote:
>
> Are you saying that when you access a page using some GET params, the page
> renders with those params missing in any embedded links? Some more concrete
> code/HTML could help clear this up, since I think I'm missing something.
> There is Helpers.appendParams, but I'm not sure if that's what you're
> talking about.
>
> Derek
>
> On Thu, Mar 26, 2009 at 1:06 PM, Tim Perrett <[email protected]>
> wrote:
>
>
> Guys,
>
> I have a catalogue of products that essentially have a bunch of meta-
> data attached to them and the user can dynamically drill down into to
> get a relevant list of products. Because of this query type operation,
> im using the query string like so:
>
> /catalogue?filter=marin
>
> I know some people don't agree with this, but IMO, its the most REST
> approach with the rest of the ROA I have in this application (i.e.
> there is no meaningful relationship between the filter options so it
> makes no sense to use resource paths) - anyway... to the problem at
> hand.
>
> I have a function def that calculates links etc taking into account
> all the various filters and things, and i want a simple "results on a
> page" type drop-down select. Now, this is fairly simple as i already
> have the function defined to calculate the url and yes, i know i could
> calculate the new URL in javascript, but i dont really want to do that
> as its two lot of code to maintain. When I write a form with lift and
> bind(...) the action="catalogue" with a post so my server side
> function bones because the S.params call cant find anything (there are
> no longer any params).
>
> Any ideas on how one could work around this?
>
> Cheers, Tim
>
>
>
>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---