[Seaside] Re: Help with JQuery example

Robert Sirois watchlala at hotmail.com
Fri Aug 24 16:11:41 UTC 2012


I don't think two click listeners can be registered like that. There can only be one #onClick() if I remember right. Try to chain the jquery calls.
RS

Date: Thu, 23 Aug 2012 21:06:07 -0400
From: arning315 at comcast.net
To: seaside at lists.squeakfoundation.org
Subject: Re: [Seaside] Re: Help with JQuery example


  
    
  
  
    Hmm...

      

      This is getting interesting. I made these changes:

      

      renderContentOnSqueakman3: html

      

      Transcript show: 'rendering ',html requestContext request url
        asString; cr.

      

      (html form)

          id: #form;

          with:

              [html label with: 'Name'.

              (html textInput)

                  id: #temp;

                  value: 'sample text'.

      

              (html button beSubmit)

                  onClick: (html jQuery ajax

                      callback: [:v | Transcript show: 'on click';
        cr.]

                      value: (html jQuery: #temp) value);

      

                  onClick: (html jQuery ajax script:

                      [:s | (s jQuery: #form) triggerSubmit]);

      

              callback: [Transcript show: 'non-ajax'; cr.];    "
      non-ajax callback"

      

                   with: 'Pay >']

      

      and see this in the transcript as I click the pay button over and
      over:

      

      

      rendering /mt

      rendering /mt

      non-ajax

      rendering /mt?_s=JTe6UE1ZzC_doo3j&_k=RVMTCSGy6eRuwFPa

      on click

      non-ajax

      rendering /mt?_s=JTe6UE1ZzC_doo3j&_k=HrNRut8hmeMBy9u3

      on click

      non-ajax

      rendering /mt?_s=JTe6UE1ZzC_doo3j&_k=mFjQlh1kqGF6357K

      on click

      non-ajax

      rendering /mt?_s=JTe6UE1ZzC_doo3j&_k=F0hO6ifLUdBNeIkO

      non-ajax

      rendering /mt?_s=JTe6UE1ZzC_doo3j&_k=bTdSB3mLJzUjv_Ll

      on click

      non-ajax

      rendering /mt?_s=JTe6UE1ZzC_doo3j&_k=lDq1GQPbcjSImBAP

      non-ajax

      rendering /mt?_s=JTe6UE1ZzC_doo3j&_k=LRsJryXuP-xaOeXJ

      non-ajax

      rendering /mt?_s=JTe6UE1ZzC_doo3j&_k=AQx9GhKhAAQkiLZe

      on click

      non-ajax

      rendering /mt?_s=JTe6UE1ZzC_doo3j&_k=3C3ftOy_RGEglbCC

      non-ajax

      rendering /mt?_s=JTe6UE1ZzC_doo3j&_k=_7Q2Ed4aVj6wkRYh

      non-ajax

      rendering /mt?_s=JTe6UE1ZzC_doo3j&_k=fvjjH-UmKYv9nZ3J

      non-ajax

      rendering /mt?_s=JTe6UE1ZzC_doo3j&_k=lGOYq5nlHMEUDGHk

      non-ajax

      rendering /mt?_s=JTe6UE1ZzC_doo3j&_k=r7nM6kuJy_V_12b-

      

      sometimes both are triggered and sometimes only one.

      

      Curious

    
    On 8/23/12 7:39 PM, squeakman wrote:

    
    On
      23/08/2012 6:53 PM, Bob Arning wrote:
      

      Well, now that you have the triggerSubmit
        in there, this seems to work:
        

        

        renderContentOnSqueakman3: html
        

        

        (html form)
        

             id: #form;
        

             with:
        

                 [html label with: 'Name'.
        

                 (html textInput)
        

                     id: #temp;
        

                     value: 'sample text'.
        

        

                 (html button beSubmit)
        

                     onClick: (html jQuery ajax
        

                         callback: [:v | self halt]   "<=== this is
        never called"
        

                         value: (html jQuery: #temp) value);
        

        

                     onClick: (html jQuery ajax script:          
        "<=== not needed"
        

                         [:s | (s jQuery: #form) triggerSubmit]);
        "<== not needed"
        

        

                     callback: [self halt];    " non-ajax callback"
        

                     with: 'Pay >']
        

        

        

      
      

      Yes, that does call the "non-ajax callback" but now the callback
      marked
      

      

           "<=== this is never called"
      

      

      above is not called.
      

      

      

      Also, it seems that with the beSubmit added, the two lines marked
      

      

          "<=== not needed"
      

      

      are not needed.
      

      

      

      I will keep plugging away at this and if I get a solution I will
      post it.
      

      

      Thanks,
      

      Frank
      

      

      _______________________________________________
      

      seaside mailing list
      

      seaside at lists.squeakfoundation.org
      

      http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
      

      

    
    

  


_______________________________________________
seaside mailing list
seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20120824/71a1b9ba/attachment.htm


More information about the seaside mailing list