I don't know single circumstance when double click should be allowed. (In the sense that there are many exactly same requests.) Even if user has a "Add product" -link that adds one product of a kind, it should not accept multiple clicks before it has processed the previous request. User can add many products using this link, pressing it repeatedly. Or did I misunderstood something?
JS-disable button method is solution that works for almost all cases, except that clients may or may not have js on. Also that doesn't cover browser reload and back button - resubmit scenariors. - 99 kristian.marinkovic wrote: > > i think it depends on the application, whether double clicks are > allowed or not. > > my simple solution: > attach a Mixin to every ActionLink component where double clicks > are not allowed. This mixin renders some javascript capturing the > link's click event (javascript events -> prototype observe). in the > event listener i then disable the link by adding a dummy event listener > that captures all other click events. > > there are some cases not covered - especially when dealing with > AJAX - but most of the time this solution is sufficient > > g, > kris > > > > > > 9902468 <[EMAIL PROTECTED]> > 05.08.2008 13:51 > Bitte antworten an > "Tapestry development" <[email protected]> > > > An > [email protected] > Kopie > > Thema > Re: T5 double click / multiple windows on same session prevention > > > > > > > > > Dear list: > > I would really like to hear your take on this matter? Has this been > discussed before regarding T5? Is there alternative, better way to stop > double clicks etc? > > Should I just add Jira: "Make Tapestry ignore double clicks"? > > - 99 > > > > 9902468 wrote: >> >> Hi! >> >> In an effort to make J2EE and browsers suck less :) Tapestry should > really >> implement some mechanism to prevent double clicks and all problems > related >> to multiple windows using the same session / back button etc. >> >> I'm familiar with Struts kind approach with tokens, and I am proposing >> similar approach that should be implemented to Tapestry. >> >> The implementation involves filter that intercepts all requests, >> synchronizes them to session, and checks the tokens submitted. >> >> The used method is generic, as it is based on filter that captures >> requests and basically works as specified: >> >> - Check that the token that came with the request matches the token in >> session >> - If no token is associated -> process request as it is processed >> currently >> - If token exists but doesn't match -> Show error page / developer >> configurable action is taken >> - Start processing request. >> - If another request is submitted with the same token and session -> >> capture the response to session >> - When request processing is complete -> populate the latest response >> with the response returned if there is one in session >> - Return the response >> >> The usage of session can probably be at least partially avoided using >> Tapestry's facilities. This should also be configurable as there is >> overhead associated to this process. >> >> What needs to be altered in Tapestry? >> - The addition of the filter (In chain only if this functionality is >> enabled) >> - Perhaps some service that encapsulates some of the logic? >> - Form should be altered to include the token to the submit (If this >> functionality is enabled) >> - Action Event etc links should add the token to request url (If this >> functionality is enabled) >> - New configuration symbol with values >> (SymbolConstants.UNIQUE_REQUEST_SUPPORT): >> - off (default, everything as it is now) >> - forgiving (requests without tokens are processed the same way when >> off) >> - strict-forms (forms are required to have correct token, else as if >> token exists but doesn't match) >> - strict-links (links are required to have correct token, else as if >> token exists but doesn't match) >> - strict (forms and links are required to have correct token, else > as >> if token exists but doesn't match) >> >> I do not have enough knowledge how this can be implemented AJAX wise, > but >> I do know that this should really be corrected. >> >> I'm ready to contribute to this if I can. Please elaborate. >> >> - 99 >> > > -- > View this message in context: > http://www.nabble.com/T5-double-click---multiple-windows-on-same-session-prevention-tp18807447p18829465.html > > Sent from the Tapestry - Dev mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > -- View this message in context: http://www.nabble.com/T5-double-click---multiple-windows-on-same-session-prevention-tp18807447p18830295.html Sent from the Tapestry - Dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
