Fair point, Jesse. But it does seem crazy that we're all solving the same problem again and again.

So I guess I was thinking that maybe it's possible to codify the typical solutions to "multiple clicks" and provide them as an option on the Submit and similar components eg. you could choose between afterclick="disable-buttons", "disable-form", "display-wait-message", "error-on-next-click", etc. If none of those suits the particular situation then no harm's done - the developer can still code up their own solution, just as they do now.

Too hard?  Worth pursuing?

Cheers,

Geoff

On 20/05/2007, at 11:01 AM, Jesse Kuhnert wrote:

I don't think this is something I would want to add in to the core simply because there are way too many ways to do this and choosing the wrong one
will hurt everyone else...

For instance - off the cuff I would probably do something more like this
instead:

function disableInputs(ids){
    for (var id in ids) {
      var node = document.getElementById(id);
      if (!node){continue;}

      node.setAttribute("disabled", true);
      if (node.tagName == "A"){
              node.innerHTML = "Processing...";
      } else if (node.tagName == "INPUT") {
              node.value = "Processing...";
      }
   }
}

<input jwcid="[EMAIL PROTECTED]" onClick="disableInputs(this.id)" />

I left out a global handler for XHR io responses as well as doing a
getTextContent() on the A element so I could dump the old content into a bogus node attribute in order to retrieve it again once any XHR requests
were finished. (same thing to do on inputs ) ...

That's one way at least. The possibilities are endless. It's still a cool idea though - which is why I'm glad we have different people providing their
own component libraries. :)

On 5/19/07, Geoff Callender <[EMAIL PROTECTED]> wrote:

To all Tapestry users:

It seems to me that "do it once" is an essential capability that
everyone desires in a web framework.

Perhaps the existing Tapestry components (Submit, SubmitLink,
ImageLink, and DirectLink) should have the option added to them?

What do you     think?

Geoff

On 20/05/2007, at 1:55 AM, Jacob von Eyben wrote:

> Tapestry Bayeux v2.0.0-beta2 is now available. New in this version:
>
> * Upgraded component library to be tapestry 4.1 compatible.
> * Made it possible to specify more than just once download resource
> source when using the DownloadLink component.
> * Made it possible to set a content-disposition header for a
> download resource.
>
> Tapestry Bayeux is a open source component library for tapestry and
> more information can be found here:
>
> The project website:
> http://tapestry-bayeux.sourceforge.net/
>
> A blog about the bayeux release:
> http://ancientprogramming.blogspot.com/2007/05/bayeux-is-now-
> tapestry-41-compatible.html
>
> Cheers,
>
> Jacob von Eyben
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to