On Sun, Mar 7, 2010 at 9:54 AM, hexa <[email protected]> wrote:
> Hi,
>
> I'm trying to do something which should be simple I think .. passing
> a function to toForm like so :
>
> class AddClient {
>
> def add (inhtml: NodeSeq) : NodeSeq = {
>
> val client = Client.create
>
> def processEntry () = {
> client.save
> S.notice ("Entre : Prenom " + client.prenom + " Nom : " +
> client.nom)
> }
>
> client.toForm (Full ("Ajouter Client"), processEntry )
>
try:
client.toForm(Full("...."), processEntrry _ ) // the _ turns it into a
function
> }
> }
>
> But I keep getting something like :
>
> AddClient.scala:23: error: overloaded method value toForm with
> alternatives (net.liftweb.util.Box[String],
> (com.envirobiz.model.Client) => Any)scala.xml.NodeSeq <and>
> (net.liftweb.util.Box[String],String)scala.xml.NodeSeq cannot be
> applied to (net.liftweb.util.Full[java.lang.String],Unit)
> [INFO] client.toForm (Full ("Ajouter Client"), processEntry )
>
> Looking at the spect I see :
> def toForm(button : Box[String], f : (A) => Any)
>
> So seems to me it should take any func... ,
>
> Any ideas ?
>
> Note that i'm new to scala/lift...
>
>
>
>
> --
> 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]<liftweb%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
--
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
--
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.