You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by sw...@tsmc.com on 2012/04/10 11:03:20 UTC

Help. Is it possible show a alert before setThrottleDelay..??

I am not familiar with wicket..  please help to give me suggestion for How
to implement this?

1. click a button and show a confirm message.
2. suspend 1 minute
3. submit the form..

	public ActivityAjaxButton(final ButtonForm form, SessionBean
sessionBean, String id, int seqRequest, String rootSrc) {
		super(id, form);
		this.form = form;
		this.seqRequest = seqRequest;
		this.rootSrc = rootSrc;
		this.setModel(new Model(sessionBean));
		add(new AjaxFormSubmitBehavior(form, "onclick") {

			private static final long serialVersionUID = 1L;
			protected void onSubmit(AjaxRequestTarget target){
				target.appendJavascript("alert('Sumibt
Successfully')");
				ActivityAjaxButton.this.onSubmit(target, form);
			}

			protected void onError(AjaxRequestTarget target){
				ActivityAjaxButton.this.onError(target, form);
			}


			protected CharSequence getEventHandler(){
				return new AppendingStringBuffer
(super.getEventHandler()).append("; return false;");
			}

			protected IAjaxCallDecorator getAjaxCallDecorator()	{

				return ActivityAjaxButton.this.getAjaxCallDecorator
();
			}

			public CharSequence getCallbackUrl(){
				return Utils.generateUrl(this, null, getComponent
(), useRelativeUrls);
			}

		}.setThrottleDelay(Duration..ONE_MINUTE));
          .........

	protected void onSubmit(AjaxRequestTarget target, Form form) {
		SessionBean sessionBean = (SessionBean)getModelObject();
		modelChanging();
		doNavigate(sessionBean, seqRequest, target);
		modelChanged();
	}
         ........

	}

Best Regards,

Joan Wang



Best Regards,

BSID/ERP
Joan Wang 王琇緯

 --------------------------------------------------------------------------- 
                                                         TSMC PROPERTY       
 This email communication (and any attachments) is proprietary information   
 for the sole use of its                                                     
 intended recipient. Any unauthorized review, use or distribution by anyone  
 other than the intended                                                     
 recipient is strictly prohibited.  If you are not the intended recipient,   
 please notify the sender by                                                 
 replying to this email, and then delete this email and any copies of it     
 immediately. Thank you.                                                     
 --------------------------------------------------------------------------- 





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Help. Is it possible show a alert before setThrottleDelay..??

Posted by cellis <ch...@uwa.edu.au>.
I'm trying the same idea within the AjaxPagingNavigator, that is, prepend an
alert (or a jQuery for that matter), but the onclick javascript is always
the default "var wcall=wicketAjaxGet('.."
I just can't seem to get the "extra" javaScript/jQuery to wrap around

(for reference, I am attempting to notify the user of the pageable form he
is on is "dirty" if he moves to the next/prev/goto pageable)

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Help-Is-it-possible-show-a-alert-before-setThrottleDelay-tp4544989p4548143.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Help. Is it possible show a alert before setThrottleDelay..??

Posted by Martin Grigorov <mg...@apache.org>.
There is nothing about 'confirm' in this paste but without digging
into the code I'll assume it is just before the 'wcall' variable.
So it seems the result of IAjaxCallDecorator is wrapped in
wicketThrottler.throttle().

Another approach:
override AjaxFormSubmitBehavior#onComponentTag(Component, ComponentTag) method:
{
  super.onComponentTag(component, tag); // this will set the value
that you pasted
  String oldValue = tag.getAttribute('onclick');
  String newValue = "if (!confirm()) {" + oldValue + "}";
  tag.put("onclick", newValue);
}

On Tue, Apr 10, 2012 at 12:00 PM,  <sw...@tsmc.com> wrote:
>
>
> Dear:
>
> The generated value of onclick is =>
>
> wicketThrottler.throttle( 'th107', 10000, function() { var
> wcall=wicketSubmitFormById('buttonForm92',
> '/portal/tool/cde5a792-9eaa-45c5-bd06-27b9aaa83719/?wicket:interface=ScormPlayer:32:buttonForm:quitButton::IBehaviorListener:2:-1',
>  'quitButton' ,null,null, function() {return Wicket.$$
> (this)&amp;&amp;Wicket.$$('buttonForm92')}.bind(this));});;
>
> Any way to achieve this requrement?
>
> Best Regards,
>
> Joan
>
>
>
> |------------------------------------->
> |            Martin Grigorov          |
> |            <mg...@apache.org>   |
> |                                     |
> |                                     |
> |                                     |
> |            2012/04/10 下午 05:35    |
> |                                     |
> |                                     |
> |                Please respond to    |
> |             users@wicket.apache.org |
> |                                     |
> |------------------------------------->
>  >--------------------------------------------------------------------------------------------------------------------------------------------------|
>  |                                                                                                                                                  |
>  |                                                                                                                                                  |
>  |                                                                                                                                                To|
>  |        users@wicket.apache.org                                                                                                                   |
>  |                                                                                                                                                cc|
>  |                                                                                                                                                  |
>  |                                                                                                                                           Subject|
>  |        Re: Help. Is it possible show a alert before setThrottleDelay..??                                                                         |
>  |                                                                                                                                                  |
>  |                                                                                                                                                  |
>  |                                                                                                                                                  |
>  |                                                                                                                                                  |
>  |                                                                                                                                                  |
>  >--------------------------------------------------------------------------------------------------------------------------------------------------|
>
>
>
>
> Can you paste what is the generated value of 'onclick' attribute with
> the current code ?
>
> On Tue, Apr 10, 2012 at 11:31 AM,  <sw...@tsmc.com> wrote:
>>
>>
>> Thanks for your reply..   But it's not worked.
>> I change the IAjaxCallDecorator to the following code..
>>
>>                       protected IAjaxCallDecorator getAjaxCallDecorator()
> {
>>                        return new AjaxPreprocessingCallDecorator
>> (super.getAjaxCallDecorator()) {
>>                        private static final long serialVersionUID = 1L;
>>
>>                            @Override
>>                            public CharSequence preDecorateScript
> (CharSequence
>> script) {
>>                                return "if(!confirm('continues?')) return
>> false;" + script;
>>                            }
>>                        };
>>                    }
>>
>> But.. the result is
>> 1. click a button.
>> 2. suspend 1 minute
>> 3. show a confirm message, and if yes, submit the form..
>>
>> But want I need is
>> 1. click a button and show a confirm message.
>> 2. suspend 1 minute
>> 3. submit the form..
>>
>>
>>
>>
>> Best Regards,
>>
>> BSID/ERP
>> Joan Wang 王琇緯
>>
>>
>>
>> |------------------------------------->
>> |            Martin Grigorov          |
>> |            <mg...@apache.org>   |
>> |                                     |
>> |                                     |
>> |                                     |
>> |            2012/04/10 下午 05:23    |
>> |                                     |
>> |                                     |
>> |                Please respond to    |
>> |             users@wicket.apache.org |
>> |                                     |
>> |------------------------------------->
>>
>>--------------------------------------------------------------------------------------------------------------------------------------------------|
>
>>  |
> |
>>  |
> |
>>  |
> To|
>>  |        users@wicket.apache.org
> |
>>  |
> cc|
>>  |
> |
>>  |
> Subject|
>>  |        Re: Help. Is it possible show a alert before
> setThrottleDelay..??
> |
>>  |
> |
>>  |
> |
>>  |
> |
>>  |
> |
>>  |
> |
>>
>>--------------------------------------------------------------------------------------------------------------------------------------------------|
>
>>
>>
>>
>>
>> Hi,
>>
>> Your code looks OK.
>> You can add the confirm dialog with IAjaxCallDecorator.
>>
>> 2012/4/10  <sw...@tsmc.com>:
>>>
>>> I am not familiar with wicket..  please help to give me suggestion for
>> How
>>> to implement this?
>>>
>>> 1. click a button and show a confirm message.
>>> 2. suspend 1 minute
>>> 3. submit the form..
>>>
>>>        public ActivityAjaxButton(final ButtonForm form, SessionBean
>>> sessionBean, String id, int seqRequest, String rootSrc) {
>>>                super(id, form);
>>>                this.form = form;
>>>                this.seqRequest = seqRequest;
>>>                this.rootSrc = rootSrc;
>>>                this.setModel(new Model(sessionBean));
>>>                add(new AjaxFormSubmitBehavior(form, "onclick") {
>>>
>>>                        private static final long serialVersionUID = 1L;
>>>                        protected void onSubmit(AjaxRequestTarget
> target){
>>>                                target.appendJavascript("alert('Sumibt
>>> Successfully')");
>>>                                ActivityAjaxButton.this.onSubmit(target,
>> form);
>>>                        }
>>>
>>>                        protected void onError(AjaxRequestTarget target){
>>>                                ActivityAjaxButton.this.onError(target,
>> form);
>>>                        }
>>>
>>>
>>>                        protected CharSequence getEventHandler(){
>>>                                return new AppendingStringBuffer
>>> (super.getEventHandler()).append("; return false;");
>>>                        }
>>>
>>>                        protected IAjaxCallDecorator getAjaxCallDecorator
>> ()     {
>>>
>>>                                return
>> ActivityAjaxButton.this.getAjaxCallDecorator
>>> ();
>>>                        }
>>>
>>>                        public CharSequence getCallbackUrl(){
>>>                                return Utils.generateUrl(this, null,
>> getComponent
>>> (), useRelativeUrls);
>>>                        }
>>>
>>>                }.setThrottleDelay(Duration..ONE_MINUTE));
>>>          .........
>>>
>>>        protected void onSubmit(AjaxRequestTarget target, Form form) {
>>>                SessionBean sessionBean = (SessionBean)getModelObject();
>>>                modelChanging();
>>>                doNavigate(sessionBean, seqRequest, target);
>>>                modelChanged();
>>>        }
>>>         ........
>>>
>>>        }
>>>
>>> Best Regards,
>>>
>>> Joan Wang
>>>
>>>
>>>
>>> Best Regards,
>>>
>>> BSID/ERP
>>> Joan Wang 王琇緯
>>>
>>>
>>
> ---------------------------------------------------------------------------
>>>                                                         TSMC PROPERTY
>>>  This email communication (and any attachments) is proprietary
>> information
>>>  for the sole use of its
>>>  intended recipient. Any unauthorized review, use or distribution by
>> anyone
>>>  other than the intended
>>>  recipient is strictly prohibited.  If you are not the intended
>> recipient,
>>>  please notify the sender by
>>>  replying to this email, and then delete this email and any copies of it
>>>  immediately. Thank you.
>>>
>>
> ---------------------------------------------------------------------------
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>>
>>
> ---------------------------------------------------------------------------
>>                                                         TSMC PROPERTY
>>  This email communication (and any attachments) is proprietary
> information
>>  for the sole use of its
>>  intended recipient. Any unauthorized review, use or distribution by
> anyone
>>  other than the intended
>>  recipient is strictly prohibited.  If you are not the intended
> recipient,
>>  please notify the sender by
>>  replying to this email, and then delete this email and any copies of it
>>  immediately. Thank you.
>>
> ---------------------------------------------------------------------------
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
>
>  ---------------------------------------------------------------------------
>                                                         TSMC PROPERTY
>  This email communication (and any attachments) is proprietary information
>  for the sole use of its
>  intended recipient. Any unauthorized review, use or distribution by anyone
>  other than the intended
>  recipient is strictly prohibited.  If you are not the intended recipient,
>  please notify the sender by
>  replying to this email, and then delete this email and any copies of it
>  immediately. Thank you.
>  ---------------------------------------------------------------------------
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

Re: Help. Is it possible show a alert before setThrottleDelay..??

Posted by sw...@tsmc.com.

Dear:

The generated value of onclick is =>

wicketThrottler.throttle( 'th107', 10000, function() { var
wcall=wicketSubmitFormById('buttonForm92',
'/portal/tool/cde5a792-9eaa-45c5-bd06-27b9aaa83719/?wicket:interface=ScormPlayer:32:buttonForm:quitButton::IBehaviorListener:2:-1',
 'quitButton' ,null,null, function() {return Wicket.$$
(this)&amp;&amp;Wicket.$$('buttonForm92')}.bind(this));});;

Any way to achieve this requrement?

Best Regards,

Joan



|------------------------------------->
|            Martin Grigorov          |
|            <mg...@apache.org>   |
|                                     |
|                                     |
|                                     |
|            2012/04/10 下午 05:35    |
|                                     |
|                                     |
|                Please respond to    |
|             users@wicket.apache.org |
|                                     |
|------------------------------------->
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                                                  |
  |                                                                                                                                                  |
  |                                                                                                                                                To|
  |        users@wicket.apache.org                                                                                                                   |
  |                                                                                                                                                cc|
  |                                                                                                                                                  |
  |                                                                                                                                           Subject|
  |        Re: Help. Is it possible show a alert before setThrottleDelay..??                                                                         |
  |                                                                                                                                                  |
  |                                                                                                                                                  |
  |                                                                                                                                                  |
  |                                                                                                                                                  |
  |                                                                                                                                                  |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|




Can you paste what is the generated value of 'onclick' attribute with
the current code ?

On Tue, Apr 10, 2012 at 11:31 AM,  <sw...@tsmc.com> wrote:
>
>
> Thanks for your reply..   But it's not worked.
> I change the IAjaxCallDecorator to the following code..
>
>                       protected IAjaxCallDecorator getAjaxCallDecorator()
{
>                        return new AjaxPreprocessingCallDecorator
> (super.getAjaxCallDecorator()) {
>                        private static final long serialVersionUID = 1L;
>
>                            @Override
>                            public CharSequence preDecorateScript
(CharSequence
> script) {
>                                return "if(!confirm('continues?')) return
> false;" + script;
>                            }
>                        };
>                    }
>
> But.. the result is
> 1. click a button.
> 2. suspend 1 minute
> 3. show a confirm message, and if yes, submit the form..
>
> But want I need is
> 1. click a button and show a confirm message.
> 2. suspend 1 minute
> 3. submit the form..
>
>
>
>
> Best Regards,
>
> BSID/ERP
> Joan Wang 王琇緯
>
>
>
> |------------------------------------->
> |            Martin Grigorov          |
> |            <mg...@apache.org>   |
> |                                     |
> |                                     |
> |                                     |
> |            2012/04/10 下午 05:23    |
> |                                     |
> |                                     |
> |                Please respond to    |
> |             users@wicket.apache.org |
> |                                     |
> |------------------------------------->
>
>--------------------------------------------------------------------------------------------------------------------------------------------------|

>  |
|
>  |
|
>  |
To|
>  |        users@wicket.apache.org
|
>  |
cc|
>  |
|
>  |
Subject|
>  |        Re: Help. Is it possible show a alert before
setThrottleDelay..??
|
>  |
|
>  |
|
>  |
|
>  |
|
>  |
|
>
>--------------------------------------------------------------------------------------------------------------------------------------------------|

>
>
>
>
> Hi,
>
> Your code looks OK.
> You can add the confirm dialog with IAjaxCallDecorator.
>
> 2012/4/10  <sw...@tsmc.com>:
>>
>> I am not familiar with wicket..  please help to give me suggestion for
> How
>> to implement this?
>>
>> 1. click a button and show a confirm message.
>> 2. suspend 1 minute
>> 3. submit the form..
>>
>>        public ActivityAjaxButton(final ButtonForm form, SessionBean
>> sessionBean, String id, int seqRequest, String rootSrc) {
>>                super(id, form);
>>                this.form = form;
>>                this.seqRequest = seqRequest;
>>                this.rootSrc = rootSrc;
>>                this.setModel(new Model(sessionBean));
>>                add(new AjaxFormSubmitBehavior(form, "onclick") {
>>
>>                        private static final long serialVersionUID = 1L;
>>                        protected void onSubmit(AjaxRequestTarget
target){
>>                                target.appendJavascript("alert('Sumibt
>> Successfully')");
>>                                ActivityAjaxButton.this.onSubmit(target,
> form);
>>                        }
>>
>>                        protected void onError(AjaxRequestTarget target){
>>                                ActivityAjaxButton.this.onError(target,
> form);
>>                        }
>>
>>
>>                        protected CharSequence getEventHandler(){
>>                                return new AppendingStringBuffer
>> (super.getEventHandler()).append("; return false;");
>>                        }
>>
>>                        protected IAjaxCallDecorator getAjaxCallDecorator
> ()     {
>>
>>                                return
> ActivityAjaxButton.this.getAjaxCallDecorator
>> ();
>>                        }
>>
>>                        public CharSequence getCallbackUrl(){
>>                                return Utils.generateUrl(this, null,
> getComponent
>> (), useRelativeUrls);
>>                        }
>>
>>                }.setThrottleDelay(Duration..ONE_MINUTE));
>>          .........
>>
>>        protected void onSubmit(AjaxRequestTarget target, Form form) {
>>                SessionBean sessionBean = (SessionBean)getModelObject();
>>                modelChanging();
>>                doNavigate(sessionBean, seqRequest, target);
>>                modelChanged();
>>        }
>>         ........
>>
>>        }
>>
>> Best Regards,
>>
>> Joan Wang
>>
>>
>>
>> Best Regards,
>>
>> BSID/ERP
>> Joan Wang 王琇緯
>>
>>
>
---------------------------------------------------------------------------
>>                                                         TSMC PROPERTY
>>  This email communication (and any attachments) is proprietary
> information
>>  for the sole use of its
>>  intended recipient. Any unauthorized review, use or distribution by
> anyone
>>  other than the intended
>>  recipient is strictly prohibited.  If you are not the intended
> recipient,
>>  please notify the sender by
>>  replying to this email, and then delete this email and any copies of it
>>  immediately. Thank you.
>>
>
---------------------------------------------------------------------------
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
>
>
---------------------------------------------------------------------------
>                                                         TSMC PROPERTY
>  This email communication (and any attachments) is proprietary
information
>  for the sole use of its
>  intended recipient. Any unauthorized review, use or distribution by
anyone
>  other than the intended
>  recipient is strictly prohibited.  If you are not the intended
recipient,
>  please notify the sender by
>  replying to this email, and then delete this email and any copies of it
>  immediately. Thank you.
>
---------------------------------------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com


 --------------------------------------------------------------------------- 
                                                         TSMC PROPERTY       
 This email communication (and any attachments) is proprietary information   
 for the sole use of its                                                     
 intended recipient. Any unauthorized review, use or distribution by anyone  
 other than the intended                                                     
 recipient is strictly prohibited.  If you are not the intended recipient,   
 please notify the sender by                                                 
 replying to this email, and then delete this email and any copies of it     
 immediately. Thank you.                                                     
 --------------------------------------------------------------------------- 


Re: Help. Is it possible show a alert before setThrottleDelay..??

Posted by Martin Grigorov <mg...@apache.org>.
Can you paste what is the generated value of 'onclick' attribute with
the current code ?

On Tue, Apr 10, 2012 at 11:31 AM,  <sw...@tsmc.com> wrote:
>
>
> Thanks for your reply..   But it's not worked.
> I change the IAjaxCallDecorator to the following code..
>
>                       protected IAjaxCallDecorator getAjaxCallDecorator() {
>                        return new AjaxPreprocessingCallDecorator
> (super.getAjaxCallDecorator()) {
>                        private static final long serialVersionUID = 1L;
>
>                            @Override
>                            public CharSequence preDecorateScript(CharSequence
> script) {
>                                return "if(!confirm('continues?')) return
> false;" + script;
>                            }
>                        };
>                    }
>
> But.. the result is
> 1. click a button.
> 2. suspend 1 minute
> 3. show a confirm message, and if yes, submit the form..
>
> But want I need is
> 1. click a button and show a confirm message.
> 2. suspend 1 minute
> 3. submit the form..
>
>
>
>
> Best Regards,
>
> BSID/ERP
> Joan Wang 王琇緯
>
>
>
> |------------------------------------->
> |            Martin Grigorov          |
> |            <mg...@apache.org>   |
> |                                     |
> |                                     |
> |                                     |
> |            2012/04/10 下午 05:23    |
> |                                     |
> |                                     |
> |                Please respond to    |
> |             users@wicket.apache.org |
> |                                     |
> |------------------------------------->
>  >--------------------------------------------------------------------------------------------------------------------------------------------------|
>  |                                                                                                                                                  |
>  |                                                                                                                                                  |
>  |                                                                                                                                                To|
>  |        users@wicket.apache.org                                                                                                                   |
>  |                                                                                                                                                cc|
>  |                                                                                                                                                  |
>  |                                                                                                                                           Subject|
>  |        Re: Help. Is it possible show a alert before setThrottleDelay..??                                                                         |
>  |                                                                                                                                                  |
>  |                                                                                                                                                  |
>  |                                                                                                                                                  |
>  |                                                                                                                                                  |
>  |                                                                                                                                                  |
>  >--------------------------------------------------------------------------------------------------------------------------------------------------|
>
>
>
>
> Hi,
>
> Your code looks OK.
> You can add the confirm dialog with IAjaxCallDecorator.
>
> 2012/4/10  <sw...@tsmc.com>:
>>
>> I am not familiar with wicket..  please help to give me suggestion for
> How
>> to implement this?
>>
>> 1. click a button and show a confirm message.
>> 2. suspend 1 minute
>> 3. submit the form..
>>
>>        public ActivityAjaxButton(final ButtonForm form, SessionBean
>> sessionBean, String id, int seqRequest, String rootSrc) {
>>                super(id, form);
>>                this.form = form;
>>                this.seqRequest = seqRequest;
>>                this.rootSrc = rootSrc;
>>                this.setModel(new Model(sessionBean));
>>                add(new AjaxFormSubmitBehavior(form, "onclick") {
>>
>>                        private static final long serialVersionUID = 1L;
>>                        protected void onSubmit(AjaxRequestTarget target){
>>                                target.appendJavascript("alert('Sumibt
>> Successfully')");
>>                                ActivityAjaxButton.this.onSubmit(target,
> form);
>>                        }
>>
>>                        protected void onError(AjaxRequestTarget target){
>>                                ActivityAjaxButton.this.onError(target,
> form);
>>                        }
>>
>>
>>                        protected CharSequence getEventHandler(){
>>                                return new AppendingStringBuffer
>> (super.getEventHandler()).append("; return false;");
>>                        }
>>
>>                        protected IAjaxCallDecorator getAjaxCallDecorator
> ()     {
>>
>>                                return
> ActivityAjaxButton.this.getAjaxCallDecorator
>> ();
>>                        }
>>
>>                        public CharSequence getCallbackUrl(){
>>                                return Utils.generateUrl(this, null,
> getComponent
>> (), useRelativeUrls);
>>                        }
>>
>>                }.setThrottleDelay(Duration..ONE_MINUTE));
>>          .........
>>
>>        protected void onSubmit(AjaxRequestTarget target, Form form) {
>>                SessionBean sessionBean = (SessionBean)getModelObject();
>>                modelChanging();
>>                doNavigate(sessionBean, seqRequest, target);
>>                modelChanged();
>>        }
>>         ........
>>
>>        }
>>
>> Best Regards,
>>
>> Joan Wang
>>
>>
>>
>> Best Regards,
>>
>> BSID/ERP
>> Joan Wang 王琇緯
>>
>>
> ---------------------------------------------------------------------------
>>                                                         TSMC PROPERTY
>>  This email communication (and any attachments) is proprietary
> information
>>  for the sole use of its
>>  intended recipient. Any unauthorized review, use or distribution by
> anyone
>>  other than the intended
>>  recipient is strictly prohibited.  If you are not the intended
> recipient,
>>  please notify the sender by
>>  replying to this email, and then delete this email and any copies of it
>>  immediately. Thank you.
>>
> ---------------------------------------------------------------------------
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
>
>  ---------------------------------------------------------------------------
>                                                         TSMC PROPERTY
>  This email communication (and any attachments) is proprietary information
>  for the sole use of its
>  intended recipient. Any unauthorized review, use or distribution by anyone
>  other than the intended
>  recipient is strictly prohibited.  If you are not the intended recipient,
>  please notify the sender by
>  replying to this email, and then delete this email and any copies of it
>  immediately. Thank you.
>  ---------------------------------------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

Re: Help. Is it possible show a alert before setThrottleDelay..??

Posted by sw...@tsmc.com.

Thanks for your reply..   But it's not worked.
I change the IAjaxCallDecorator to the following code..

	               protected IAjaxCallDecorator getAjaxCallDecorator() {
		    	return new AjaxPreprocessingCallDecorator
(super.getAjaxCallDecorator()) {
		        private static final long serialVersionUID = 1L;

		            @Override
		            public CharSequence preDecorateScript(CharSequence
script) {
		                return "if(!confirm('continues?')) return
false;" + script;
		            }
		        };
		    }

But.. the result is
1. click a button.
2. suspend 1 minute
3. show a confirm message, and if yes, submit the form..

But want I need is
1. click a button and show a confirm message.
2. suspend 1 minute
3. submit the form..




Best Regards,

BSID/ERP
Joan Wang 王琇緯



|------------------------------------->
|            Martin Grigorov          |
|            <mg...@apache.org>   |
|                                     |
|                                     |
|                                     |
|            2012/04/10 下午 05:23    |
|                                     |
|                                     |
|                Please respond to    |
|             users@wicket.apache.org |
|                                     |
|------------------------------------->
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                                                  |
  |                                                                                                                                                  |
  |                                                                                                                                                To|
  |        users@wicket.apache.org                                                                                                                   |
  |                                                                                                                                                cc|
  |                                                                                                                                                  |
  |                                                                                                                                           Subject|
  |        Re: Help. Is it possible show a alert before setThrottleDelay..??                                                                         |
  |                                                                                                                                                  |
  |                                                                                                                                                  |
  |                                                                                                                                                  |
  |                                                                                                                                                  |
  |                                                                                                                                                  |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|




Hi,

Your code looks OK.
You can add the confirm dialog with IAjaxCallDecorator.

2012/4/10  <sw...@tsmc.com>:
>
> I am not familiar with wicket..  please help to give me suggestion for
How
> to implement this?
>
> 1. click a button and show a confirm message.
> 2. suspend 1 minute
> 3. submit the form..
>
>        public ActivityAjaxButton(final ButtonForm form, SessionBean
> sessionBean, String id, int seqRequest, String rootSrc) {
>                super(id, form);
>                this.form = form;
>                this.seqRequest = seqRequest;
>                this.rootSrc = rootSrc;
>                this.setModel(new Model(sessionBean));
>                add(new AjaxFormSubmitBehavior(form, "onclick") {
>
>                        private static final long serialVersionUID = 1L;
>                        protected void onSubmit(AjaxRequestTarget target){
>                                target.appendJavascript("alert('Sumibt
> Successfully')");
>                                ActivityAjaxButton.this.onSubmit(target,
form);
>                        }
>
>                        protected void onError(AjaxRequestTarget target){
>                                ActivityAjaxButton.this.onError(target,
form);
>                        }
>
>
>                        protected CharSequence getEventHandler(){
>                                return new AppendingStringBuffer
> (super.getEventHandler()).append("; return false;");
>                        }
>
>                        protected IAjaxCallDecorator getAjaxCallDecorator
()     {
>
>                                return
ActivityAjaxButton.this.getAjaxCallDecorator
> ();
>                        }
>
>                        public CharSequence getCallbackUrl(){
>                                return Utils.generateUrl(this, null,
getComponent
> (), useRelativeUrls);
>                        }
>
>                }.setThrottleDelay(Duration..ONE_MINUTE));
>          .........
>
>        protected void onSubmit(AjaxRequestTarget target, Form form) {
>                SessionBean sessionBean = (SessionBean)getModelObject();
>                modelChanging();
>                doNavigate(sessionBean, seqRequest, target);
>                modelChanged();
>        }
>         ........
>
>        }
>
> Best Regards,
>
> Joan Wang
>
>
>
> Best Regards,
>
> BSID/ERP
> Joan Wang 王琇緯
>
>
---------------------------------------------------------------------------
>                                                         TSMC PROPERTY
>  This email communication (and any attachments) is proprietary
information
>  for the sole use of its
>  intended recipient. Any unauthorized review, use or distribution by
anyone
>  other than the intended
>  recipient is strictly prohibited.  If you are not the intended
recipient,
>  please notify the sender by
>  replying to this email, and then delete this email and any copies of it
>  immediately. Thank you.
>
---------------------------------------------------------------------------
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com


 --------------------------------------------------------------------------- 
                                                         TSMC PROPERTY       
 This email communication (and any attachments) is proprietary information   
 for the sole use of its                                                     
 intended recipient. Any unauthorized review, use or distribution by anyone  
 other than the intended                                                     
 recipient is strictly prohibited.  If you are not the intended recipient,   
 please notify the sender by                                                 
 replying to this email, and then delete this email and any copies of it     
 immediately. Thank you.                                                     
 --------------------------------------------------------------------------- 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Help. Is it possible show a alert before setThrottleDelay..??

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Your code looks OK.
You can add the confirm dialog with IAjaxCallDecorator.

2012/4/10  <sw...@tsmc.com>:
>
> I am not familiar with wicket..  please help to give me suggestion for How
> to implement this?
>
> 1. click a button and show a confirm message.
> 2. suspend 1 minute
> 3. submit the form..
>
>        public ActivityAjaxButton(final ButtonForm form, SessionBean
> sessionBean, String id, int seqRequest, String rootSrc) {
>                super(id, form);
>                this.form = form;
>                this.seqRequest = seqRequest;
>                this.rootSrc = rootSrc;
>                this.setModel(new Model(sessionBean));
>                add(new AjaxFormSubmitBehavior(form, "onclick") {
>
>                        private static final long serialVersionUID = 1L;
>                        protected void onSubmit(AjaxRequestTarget target){
>                                target.appendJavascript("alert('Sumibt
> Successfully')");
>                                ActivityAjaxButton.this.onSubmit(target, form);
>                        }
>
>                        protected void onError(AjaxRequestTarget target){
>                                ActivityAjaxButton.this.onError(target, form);
>                        }
>
>
>                        protected CharSequence getEventHandler(){
>                                return new AppendingStringBuffer
> (super.getEventHandler()).append("; return false;");
>                        }
>
>                        protected IAjaxCallDecorator getAjaxCallDecorator()     {
>
>                                return ActivityAjaxButton.this.getAjaxCallDecorator
> ();
>                        }
>
>                        public CharSequence getCallbackUrl(){
>                                return Utils.generateUrl(this, null, getComponent
> (), useRelativeUrls);
>                        }
>
>                }.setThrottleDelay(Duration..ONE_MINUTE));
>          .........
>
>        protected void onSubmit(AjaxRequestTarget target, Form form) {
>                SessionBean sessionBean = (SessionBean)getModelObject();
>                modelChanging();
>                doNavigate(sessionBean, seqRequest, target);
>                modelChanged();
>        }
>         ........
>
>        }
>
> Best Regards,
>
> Joan Wang
>
>
>
> Best Regards,
>
> BSID/ERP
> Joan Wang 王琇緯
>
>  ---------------------------------------------------------------------------
>                                                         TSMC PROPERTY
>  This email communication (and any attachments) is proprietary information
>  for the sole use of its
>  intended recipient. Any unauthorized review, use or distribution by anyone
>  other than the intended
>  recipient is strictly prohibited.  If you are not the intended recipient,
>  please notify the sender by
>  replying to this email, and then delete this email and any copies of it
>  immediately. Thank you.
>  ---------------------------------------------------------------------------
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com