Leonardo Quijano Vincenzi wrote:
Go to the demo, AjaxSubmit page, click on the NormalButton with some values...

The name gets updated

Now, change the values and click again... surprise! The listener never gets called

;)

ideas ?

Ok fixed it...

Now..

Jesse... why do you hate my Javascript try / finallys? This is the second time you blow them... :P

Now, seriously, hehe.. this was the problem, in AjaxFormSubmit:

    <if expression="!deferred">
  dojo.event.disconnect(dojo.byId("${componentId}"), "onclick",
              document, "${functionName}");
  </if>
  try {
      tacos.formSubmit({
         url: "${url}",
         processScripts: "${evalScripts}",
         effects: ${effects},
         updateObject: ${updateObject},
         content: {
           ${name}: encodeURIComponent("${hiddenId}"),
           dojoRequest: "true", processScripts: "${evalScripts}" },
         formId: "${form.name}",
         backLink: "${backLink}",
         forwardLink: "${forwardLink}",
         statusElement: "${statusElement}"
      });
  }
  finally {
    <if expression="!deferred">
      dojo.event.connect(dojo.byId("${componentId}"), "onclick",
                 document, "${functionName}");
    </if>
  }

I added that finally to reconnect the button to its listener after the tacos form submission. Remember that - since we are not refreshing the page - it's important to re-attach the listeners after we call formSubmit (I wonder what's the reason we disconnect them in the first place??).

Now, that's unless there's another way of re-connecting that I missed. But well, the page wasn't working and it is now.

--
Ing. Leonardo Quijano Vincenzi
DTQ Software




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Tacos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tacos-devel

Reply via email to