So that's what Noop is for...

David Pollak wrote:
> Shtml.ajaxCheckbox(thing.isChecked, b => {thing.setChecked(b); JsCmds.Noop})
> 
>     On Nov 25, 2008 4:12 AM, "Charles F. Munat" <[EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
>     I want to update an attribute on a model object in the database via AJAX
>     when a checkbox is clicked on a page. I presume that ajaxCheckbox is for
>     this purpose.
> 
>     Can anyone quickly give me an example of how it works?
> 
>     If I have an attribute called isActive, how would I create an
>     ajaxCheckbox that would call a method on the server when the checkbox is
>     clicked to set isActive to true or false, depending on the state of the
>     checkbox after the click?
> 
>     bind("mine", xhtml,
>       "isActive" -> SHtml.ajaxCheckbox(thing.isActive, ???)
> 
>     What about selecting the day of the week from an ajaxSelect and updating
>     dayOfWeek. Or, finally, updating a text field on blur and setting the
>     user_name.
> 
>     Examples would really help.
> 
>     I am pretty desperate to have this done today, and several hours of
>     playing with various combinations has left me befuddled. Doesn't help
>     that it's 4 AM.
> 
>     Any and all help very greatly appreciated.
> 
>     Thanks,
>     Chas.
> 
> 
> 
> > 

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to