Apologies for the noise.

The correct usage is, thanks to dpp:
"button2" -> <button>Press Me 2</button> %
("onclick" -> SHtml.ajaxCall(Str("Button-2"), ajaxFunc2 _)._2)

The branch is gone.


On Apr 1, 2:05 pm, David Pollak <[email protected]> wrote:
> Tyler,
>
> This call is malformed:
>      "button2" -> <button>Press Me 2</button> % ("onclick" ->
> SHtml.ajaxCall(Str("Button-2"), ajaxFunc2 _)))
>
> SHtml.ajaxCall returns a (String, JsCmd).  The String is absolutely
> necessary (it will be actually) for GC).
>
> The call is doing the right thing and should not be patched.
>
> At some point when jQuery 1.4 comes out and fixes the namespace issue, the
> first parameter will need to go into a lift:gc attribute and the second will
> be the actual JavaScript command.
>
> So, please do not push your changes live.
>
> Thanks,
>
> David
>
>
>
> On Tue, Mar 31, 2009 at 8:57 AM, TylerWeir <[email protected]> wrote:
>
> > I'm wading into an area that I'm a bit unfamiliar with and not sure if
> > I'm running in a bug.
>
> > Snippet code:
> > class HelloWorld {
> >  def ajaxFunc1() : JsCmd = JsRaw("alert('Button1 clicked')")
>
> >  def ajaxFunc2(str: String) : JsCmd = {
> >    Log.info("Received" + str)
> >    JsRaw("alert('Button2 clicked')")
> >  }
>
> >  def renderAjaxButtons(xhtml: NodeSeq): NodeSeq = {
> >    bind("ex", xhtml,
> >      "button1" -> SHtml.ajaxButton("Press Me", ajaxFunc1 _),
> >      "button2" -> <button>Press Me 2</button> % ("onclick" ->
> > SHtml.ajaxCall(Str("Button-2"), ajaxFunc2 _)))
> >  }
> > }
>
> > Which is in this template:
> >    <lift:HelloWorld.renderAjaxButtons>
> >    <ex:button1 /><br />
> >    <ex:button2 /><br />
> >    </lift:HelloWorld.renderAjaxButtons>
>
> > And is rendered thusly:
> >  <button onclick="lift_ajaxHandler('F687305521434PIG=true', null,
> > null); return false;">Press Me</button><br />
>
> >    <button onclick="(F687305521435R3K,lift_ajaxHandler
> > ('F687305521435R3K=' + 'Button-2', null, null))">Press Me 2</
> > button><br />
>
> > Button 1 is find, but Button 2 causes FireBug to whine:
> > F687305521435R3K is not defined
> > onclick(click clientX=500, clientY=239)2 (line 2)
> > [Break on this error] F687305521435R3K,
> > lift_ajaxHandl...F687305521435R3K=Button-2", null, null);
>
> > Does the second onclick look incorrect to you?
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://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 [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