-
FEATURED COMPONENTS
First time here? Check out the FAQ!
We've a wizard application. On the very first page of wizard if we click "Next" continuously then rather than taking to next page it takes user to any next page in the wizard. Is there any setting in ZK configuration on application level or component level for ignoring the duplicate request / events.
Thanks!
rautrupesh,
One suggestion might be to make the button disabled after it is clicked the first time. The following is an example:
<zk> <window style="padding: 25px;"> <button label="Next" onClick="self.setDisabled(true);"/> </window> </zk>
Or, if you prefer an example using a composer:
<zk> <zscript> import org.zkoss.zk.ui.util.GenericForwardComposer; public class myController extends GenericForwardComposer { public void onClickNext(Event event) { event.getOrigin().getTarget().setDisabled(true); } } </zscript> <window style="padding: 25px;" apply="myController"> <button label="Next" forward="onClick=onClickNext()"/> </window> </zk>
Hope that helps.
Regards,
Todd
/** * Opens the help screen for the current module. * * @param event * @throws InterruptedException */ private void doHelp(Event event) throws InterruptedException { FDMessageUtils.doShowNotImplementedMessage(); // we stop the propagation of the event, because zk will call ALL events // with the same name in the namespace and 'btnHelp' is a standard // button in this application and can often appears. // Events.getRealOrigin((ForwardEvent) event).stopPropagation(); event.stopPropagation(); }
Asked: 2011-06-03 06:27:48 +0800
Seen: 302 times
Last updated: Jun 03 '11