Update URI dynamically

35 views
Skip to first unread message

lmendez2

unread,
Aug 23, 2011, 4:16:24 PM8/23/11
to Lift
Hi everyone, I'm coming from a GWT background and we are moving to
Lift for a new project at work so I'm still a beginner (go easy...).

I'm having trouble finding how to change URl dynamically without
changing the page (all done via javascript, idMemoize, ajax) via Lift;
I know this was possible in GWT with history tokens.

So my URL is of the form: "/page/4e419938e4b0cbb268e46215" and once I
press a certain button it needs to update the URL to "/page/
4e419938e4b0cbb268e46215?row=1&col=2"

This needs to be done dynamically as I don't want to reload the page
everytime a row or column is being changed, but a user may still need
to access a particular row/column by entering the URL combination
which is why I can't have them being state variables

Thanks!

Diego Medina

unread,
Aug 23, 2011, 4:38:57 PM8/23/11
to lif...@googlegroups.com
Hi,

There is no built in way of doing this on Lift (yet), but with a
little work you can get it done.

I have written about one way of doing this here

http://blog.fmpwizard.com/back-button-and-bookmark-meet-lift-comet-revi
there is also a link to a demo application that shows this working as
well as the full source code.

Hope it helps.

Diego

> --
> You received this message because you are subscribed to the Google Groups "Lift" group.
> To post to this group, send email to lif...@googlegroups.com.
> To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
>
>

--
Diego Medina
Web Developer
(305) 788-4954
di...@fmpwizard.com
http://www.fmpwizard.com

lmendez2

unread,
Aug 23, 2011, 5:27:17 PM8/23/11
to Lift
Thanks Diego! That definitely helps, though I was hoping I didn't have
to deal with JavaScript (I don't code all over the place), but I guess
I have no choice for now.

Diego Medina

unread,
Aug 23, 2011, 10:37:21 PM8/23/11
to lif...@googlegroups.com

I have it on my list to improve on the example and reduce the amount
of javascript, but I haven't had much time for lift lately. But
whenever I come up with a better version of that sample app, I'll post
it on the mailing list.

Thanks

Diego

Sergey Trofimov

unread,
Aug 24, 2011, 1:15:53 AM8/24/11
to lif...@googlegroups.com
Hello.

You can try also jQuery Ajaxy http://balupton.github.com/jquery-ajaxy/demo/ .
I use it in my project successfully.
Reply all
Reply to author
Forward
0 new messages