I hope it's okay that I'm forwarding this to the list.
A suggestion, to allow all the alternatives in a type-safe and type-documenting
way, would involve implicits. So you would have say
sealed trait AjaxResponse
case class JsCmdResponse(cmd: JsCmd)
...
object AjaxReponse {
implicit def apply(cmd: JsCmd): AjaxResponse = JsCmdResponse(cmd)
...
}
Alternatively, define the implicit separate from the apply method (e.g., in
SHtml).
Then you can either write AjaxResponse(myJsCmd), or import the implicits (if
they're in SHtml you may not need a new import statement) and write it the old
way.
-------------------------------------
From: Kris Nuttycombe<[email protected]>
To:
[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected]
Subject: Re: Review Request: Ajax change from () => Any to () => JsCmd
Date: Jan 21, 2:23 PM
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.liftweb.net/r/184/#review481
-----------------------------------------------------------
Since ajaxSubmit is brand-new, this makes sense to me. I was unaware that Lift
explicitly attempted to match JsCmd, NodeSeq, JsCommands, and LiftResponse as
you noted in your mail to the list. It would be helpful to add this to the
documentation of the other methods that take functions returning Any; also,
would it make sense to have these signatures return a common super-trait (not
likely, because of NodeSeq) or else a standard sealed trait with concrete
instances wrapping each one of those types?
- Kris
On 2010-01-21 14:08:12.907657, Marius Danciu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.liftweb.net/r/184/
> -----------------------------------------------------------
>
> (Updated 2010-01-21 14:08:12.907657)
>
>
> Review request for Derek Chen-Becker, David Pollak, Marius Danciu, Charles
> Munat, Heiko Seeberger, Joni Freeman, Atsuhiko Yamanaka, Jorge Ortiz, Naftoli
> Gugenheim, Kris Nuttycombe, Indrajit Raychaudhuri, and Alex Boisvert.
>
>
> Summary
> -------
>
> It's more consistent for ajax functions to return JsCmd
>
>
> This addresses bug 295.
> http://github.com/dpp/liftweb/issues#issue/295
>
>
> Diffs
> -----
>
> framework/lift-base/lift-webkit/src/main/scala/net/liftweb/http/SHtml.scala
> 82949d1
>
> framework/lift-persistence/lift-mapper/src/main/scala/net/liftweb/mapper/MappedLong.scala
> 7655346
>
> Diff: http://reviewboard.liftweb.net/r/184/diff
>
>
> Testing
> -------
>
>
> Thanks,
>
> Marius
>
>
--
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.