On Fri, Jan 14, 2011 at 7:28 PM, Stephan Windmüller < stephan.windmuel...@tu-dortmund.de> wrote:
> Hi! > > I have a strange behavior with a javascript button here. My page > contains the following: > > - Many items which may be selected > - A "select all" button > - A submit button > > The "select all" button works with or without JavaScript. This is > achieved by this code: > > It works without javascript because the select-all button is used as a simple submit button when javascript is disabled and so when it is clicked it submits the form and at the server side, Tapestry executes onSelectFromSelectAll() > | <t:submit t:id="selectAll" onClick="selectAll(); return false;"/> > > The according onSelectedFromSelectAll() method in Java is called when > JavaScript is disabled. > > My problem is: This page does not work when I click the "select all" > button with activated JavaScript and then "submit". It does work, when I > select all fields manually and submitting after that or when JavaScript > is disabled. > > When you click "select-all" with javascript enabled the form is not submitted and all it does is enable the checkboxes at the client end. Nothing happens at the server end. When you click "submit" only then the form is submitted and as the submit button value is 'submit', only onSelectedFromSubmit() is called and onSelectedFromSelectAll() is not called... > After much debugging I found out that the onSelectedFromSelectAll() > event is queued when JavaScript is enabled. When I hit the "submit" > button after clicking the "select all" one, _both_ events are triggered. > > So no queuing !!! > Is there anything special with the JavaScript generated by Tapestry > which might cause this? > > NO > TIA > Stephan > > regards Taha > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >