0

How to ignore duplicate request processing

asked 2011-06-03 06:27:48 +0800

rautrupesh gravatar image rautrupesh
6

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!

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2011-06-03 11:34:39 +0800

twiegand gravatar image twiegand
1807 3

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

link publish delete flag offensive edit

answered 2011-06-03 15:39:50 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

	/**
	 * 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();
	}

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-06-03 06:27:48 +0800

Seen: 302 times

Last updated: Jun 03 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More