[Lift] Re: Hidden field in form

2009-04-07 Thread bradford
Thanks, Marius. I will need this functionality as well. On Apr 7, 12:32 pm, "marius d." wrote: > Ok ... I took the liberty to overload it. Here is the signature: > > def hidden(func: (String) => Any, defaultlValue: String, attrs: > (String, String)*): Elem > > Br's, > Marius > > On Apr 7, 7:08 

[Lift] Re: Hidden field in form

2009-04-07 Thread marius d.
Ok ... I took the liberty to overload it. Here is the signature: def hidden(func: (String) => Any, defaultlValue: String, attrs: (String, String)*): Elem Br's, Marius On Apr 7, 7:08 pm, "marius d." wrote: > I actually encountered situations where I had to pass actual data as > hidden field. Fo

[Lift] Re: Hidden field in form

2009-04-07 Thread marius d.
I actually encountered situations where I had to pass actual data as hidden field. For instance we had a SAML service that also provided a login widget as a convenient way to login the user directly into the user's realm service and that service after auth redirected the user to the originator ser

[Lift] Re: Hidden field in form

2009-04-07 Thread David Pollak
Marius -- Thanks for giving the answer. The reason that SHtml.hidden() takes () => Unit is that I could not think of a use case for passing data back and I was tired of ignore => {...} in my code. As a broader issue, there's nothing magic in Lift. You can see how Marius grabbed the existing code

[Lift] Re: Hidden field in form

2009-04-07 Thread wapgui
Perfect, works as expected. Thanks again. Cheers Torsten On Apr 7, 3:37 pm, "marius d." wrote: > Note the SHtml.hidden function is defined as: > > def hidden(func: () => Any, attrs: (String, String)*): Elem = > makeFormElement("hidden", NFuncHolder(func), attrs :_*) % ("value" -> > "true") > >

[Lift] Re: Hidden field in form

2009-04-07 Thread marius d.
Note the SHtml.hidden function is defined as: def hidden(func: () => Any, attrs: (String, String)*): Elem = makeFormElement("hidden", NFuncHolder(func), attrs :_*) % ("value" -> "true") see that it automatically puts value = true. It used to accept a function like (String) => Any but I'm not su

[Lift] Re: Hidden field in form

2009-04-07 Thread wapgui
Thanks for the reply I found the js solution this night too, but the delivery of messages on google groups seems to be very slow (Now 6 hours pending). Now I have only left one little problem. This should give me the value : "color" -> hidden(() => fp.color) % ("id" -> "color"). But it's empty and

[Lift] Re: Hidden field in form

2009-04-07 Thread wapgui
Ok it so easy if you know how to do. I used document.getElementById ('color').value to set the value now I only to find out how to get the value in scala. The () => fp.color seems not working. Cheers Torsten On Apr 6, 9:05 pm, wapgui wrote: > Did you mean something like that ? > "color" -> hidd

[Lift] Re: Hidden field in form

2009-04-06 Thread marius d.
On Apr 6, 10:05 pm, wapgui wrote: > Did you mean something like that ? > "color" -> hidden(() => fp.color) % ("id" -> "color") Yes > > But how can I get the value of the "color" and how to set the value > via js if the form has no name and the name of the input is generated. > > >          

[Lift] Re: Hidden field in form

2009-04-06 Thread wapgui
Did you mean something like that ? "color" -> hidden(() => fp.color) % ("id" -> "color") But how can I get the value of the "color" and how to set the value via js if the form has no name and the name of the input is generated. It's all so difficult if there are no examples. B

[Lift] Re: Hidden field in form

2009-04-06 Thread marius d.
Well putting an id to the hidden field allows you to manipulate it via JavaScript. Br's, Marius On Apr 6, 5:01 pm, wapgui wrote: > Hi, > > is there an equivalent in lift to the hidden input filed used in > forms. The SHtml.hidden is only for functions not for parameters, the > value is always t