On Sat, Apr 4, 2009 at 6:02 AM, Tobias Daub <hannes.flo...@gmx.li> wrote:

>
> Hi There,
>
>  From the ToDo tutorial I got this code:
>
> private def desc(td: ToDo, reDraw: () => JsCmd) =
>  swappable(<span>{td.desc}</span>,
>         <span>{ajaxText(td.desc,
>                     v => {td.desc(v).save; reDraw()})}
>         </span>)
>
>
> What if I've a numeric field, e.g. td.num and I want to view/edit it?
>
> I got to the point that I modified the code to look like this:
>
> <span>{ajaxText(td.num.toString,
>                     v => {td.desc(v).save; reDraw()})}
>         </span>)
>
>
> But I still get another compile error, that tells me, that it awaits
> String instead of Int.
>
> What do I've to change here? I tried some things with toString() too,
> but all didn't worked.
>
> v => {td.num(v).save; reDraw()})}
>


td.num is looking for an Int.  v is a String.

Try:
v => {td.num(v.toInt).save; reDraw()}



>
>
> thanks
> Tobias
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

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

Reply via email to