LiftTicket and AJAX

9 views
Skip to first unread message

Derek Chen-Becker

unread,
Oct 30, 2009, 7:44:17 PM10/30/09
to liftweb
I just committed some code for AJAX-editable fields that I think might be useful as a part of LiftWeb. Basically, if you've seen how ReviewBoard handles field editing, this is the same thing. It's a trait that can be mixed into any MappedField and as soon as M7 is release and I can merge the new ajaxForm postSubmit code into master, I'll have a demo that will work out of the box. If you're interested, take a look at it in GitHub:

http://github.com/dchenbecker/LiftTicket/blob/master/src/main/scala/org/liftticket/liftticket/model/AjaxEditableField.scala

Constructive criticism would be appreciated.

Derek


Heiko Seeberger

unread,
Oct 31, 2009, 6:47:45 AM10/31/09
to lif...@googlegroups.com
Looks good!

2009/10/31 Derek Chen-Becker <dchen...@gmail.com>



--
Heiko Seeberger

My job: weiglewilczek.com
My blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net

David Pollak

unread,
Oct 31, 2009, 10:08:19 AM10/31/09
to lif...@googlegroups.com
Very cool!
--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

Derek Chen-Becker

unread,
Oct 31, 2009, 7:43:43 PM10/31/09
to lif...@googlegroups.com
I have at least two different pieces of functionality here. The main workhorse is the AjaxUtils.editable method that actually generates the dynamic div. I was thinking that this might be good to put in SHtml (albeit with a different name). I also have the AjaxEditableField trait which mixes into a MappedField to provide a specialized asHtml, but I was thinking that maybe I should provide a trait that you could add to a Mapper that defines a list of fields that will be AJAXified, so that you can control which ones are editable via asHtml. I think I also need to add a boolean function parameter that lets you control whether the field becomes editable or not, so that you could easily tie it to a Loc.If or some other access control mechanism. Thoughts?

Derek

Marius

unread,
Nov 1, 2009, 8:38:01 AM11/1/09
to Lift
I think it would be great to have the editable in SHtml.

On Nov 1, 1:43 am, Derek Chen-Becker <dchenbec...@gmail.com> wrote:
> I have at least two different pieces of functionality here. The main
> workhorse is the AjaxUtils.editable method that actually generates the
> dynamic div. I was thinking that this might be good to put in SHtml (albeit
> with a different name). I also have the AjaxEditableField trait which mixes
> into a MappedField to provide a specialized asHtml, but I was thinking that
> maybe I should provide a trait that you could add to a Mapper that defines a
> list of fields that will be AJAXified, so that you can control which ones
> are editable via asHtml. I think I also need to add a boolean function
> parameter that lets you control whether the field becomes editable or not,
> so that you could easily tie it to a Loc.If or some other access control
> mechanism. Thoughts?
>
> Derek
>
> On Sat, Oct 31, 2009 at 8:08 AM, David Pollak <feeder.of.the.be...@gmail.com
>
> > wrote:
> > Very cool!
>
> > On Fri, Oct 30, 2009 at 4:44 PM, Derek Chen-Becker <dchenbec...@gmail.com>wrote:
>
> >> I just committed some code for AJAX-editable fields that I think might be
> >> useful as a part of LiftWeb. Basically, if you've seen how ReviewBoard
> >> handles field editing, this is the same thing. It's a trait that can be
> >> mixed into any MappedField and as soon as M7 is release and I can merge the
> >> new ajaxForm postSubmit code into master, I'll have a demo that will work
> >> out of the box. If you're interested, take a look at it in GitHub:
>
> >>http://github.com/dchenbecker/LiftTicket/blob/master/src/main/scala/o...
>
> >> Constructive criticism would be appreciated.
>
> >> Derek
>
> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Beginning Scalahttp://www.apress.com/book/view/1430219890

Derek Chen-Becker

unread,
Nov 2, 2009, 1:50:58 PM11/2/09
to lif...@googlegroups.com
If there are no objections, I'll add that method to SHtml post-M7. I was thinking maybe calling it ajaxEditable, what does everything think? Also, any votes +/- for making some Mapper traits to simplify adding this behavior?

Derek

David Pollak

unread,
Nov 2, 2009, 1:51:46 PM11/2/09
to lif...@googlegroups.com
On Mon, Nov 2, 2009 at 10:50 AM, Derek Chen-Becker <dchen...@gmail.com> wrote:
If there are no objections, I'll add that method to SHtml post-M7. I was thinking maybe calling it ajaxEditable, what does everything think? Also, any votes +/- for making some Mapper traits to simplify adding this behavior?

I'm as +1 as I can be over these additions.



--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Reply all
Reply to author
Forward
0 new messages