You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Andrew Moore <an...@bigfoot.com> on 2008/05/04 14:08:39 UTC

AjaxSelfUpdatingTimerBahaviour to enable button when process compete

Hi,
I'm currently using an ajaxselfupdatingtimerbehaviour to update a message
field for when a job is complete with the following code:
		final Label status = new Label("uploadstatus", new AbstractReadOnlyModel()
{
			private static final long serialVersionUID = 938943178761943953L;

			public Object getObject() {
				if (getMySession().isUploading()) {
					return getString("uploading");
				} else if (getMySession().isUploadComplete()) {
					return getString("uploadcomplete");
				} else {
					return "";
				}
			}
		});
		status.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(5)));
		add(status);

===============================================
What I'm wanting to also have happen is then when the
session.isUploadComplete is true I want to be able to re-enable a button
which got disabled when the process started.

I just can't think what I need to do to my button:
===============================================
final Button cancel = new Button("cancel", new
StringResourceModel("cancelbutton", this, null)) {
     private static final long serialVersionUID = 691332069442892669L;

     public void onSubmit() {
	setReturnPage(pageId, pageType, website);
     }
};
cancel.setDefaultFormProcessing(false);
form.add(cancel);

-- 
View this message in context: http://www.nabble.com/AjaxSelfUpdatingTimerBahaviour-to-enable-button-when-process-compete-tp17045416p17045416.html
Sent from the Wicket - User 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: AjaxSelfUpdatingTimerBahaviour to enable button when process compete

Posted by Andrew Moore <an...@bigfoot.com>.
Thanks, that's just what I was looking for.
Cheers
Andrew


Mr Mean wrote:
> 
> You can override onPostProcessTarget of your
> AjaxSelfUpdatingTimerBehavior and enable your button there.
> 
> Maurice
> 
> On Sun, May 4, 2008 at 2:08 PM, Andrew Moore <an...@bigfoot.com>
> wrote:
>>
>>  Hi,
>>  I'm currently using an ajaxselfupdatingtimerbehaviour to update a
>> message
>>  field for when a job is complete with the following code:
>>                 final Label status = new Label("uploadstatus", new
>> AbstractReadOnlyModel()
>>  {
>>                         private static final long serialVersionUID =
>> 938943178761943953L;
>>
>>                         public Object getObject() {
>>                                 if (getMySession().isUploading()) {
>>                                         return getString("uploading");
>>                                 } else if
>> (getMySession().isUploadComplete()) {
>>                                         return
>> getString("uploadcomplete");
>>                                 } else {
>>                                         return "";
>>                                 }
>>                         }
>>                 });
>>                 status.add(new
>> AjaxSelfUpdatingTimerBehavior(Duration.seconds(5)));
>>                 add(status);
>>
>>  ===============================================
>>  What I'm wanting to also have happen is then when the
>>  session.isUploadComplete is true I want to be able to re-enable a button
>>  which got disabled when the process started.
>>
>>  I just can't think what I need to do to my button:
>>  ===============================================
>>  final Button cancel = new Button("cancel", new
>>  StringResourceModel("cancelbutton", this, null)) {
>>      private static final long serialVersionUID = 691332069442892669L;
>>
>>      public void onSubmit() {
>>         setReturnPage(pageId, pageType, website);
>>      }
>>  };
>>  cancel.setDefaultFormProcessing(false);
>>  form.add(cancel);
>>
>>  --
>>  View this message in context:
>> http://www.nabble.com/AjaxSelfUpdatingTimerBahaviour-to-enable-button-when-process-compete-tp17045416p17045416.html
>>  Sent from the Wicket - User 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
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/AjaxSelfUpdatingTimerBahaviour-to-enable-button-when-process-compete-tp17045416p17046752.html
Sent from the Wicket - User 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: AjaxSelfUpdatingTimerBahaviour to enable button when process compete

Posted by Maurice Marrink <ma...@gmail.com>.
You can override onPostProcessTarget of your
AjaxSelfUpdatingTimerBehavior and enable your button there.

Maurice

On Sun, May 4, 2008 at 2:08 PM, Andrew Moore <an...@bigfoot.com> wrote:
>
>  Hi,
>  I'm currently using an ajaxselfupdatingtimerbehaviour to update a message
>  field for when a job is complete with the following code:
>                 final Label status = new Label("uploadstatus", new AbstractReadOnlyModel()
>  {
>                         private static final long serialVersionUID = 938943178761943953L;
>
>                         public Object getObject() {
>                                 if (getMySession().isUploading()) {
>                                         return getString("uploading");
>                                 } else if (getMySession().isUploadComplete()) {
>                                         return getString("uploadcomplete");
>                                 } else {
>                                         return "";
>                                 }
>                         }
>                 });
>                 status.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(5)));
>                 add(status);
>
>  ===============================================
>  What I'm wanting to also have happen is then when the
>  session.isUploadComplete is true I want to be able to re-enable a button
>  which got disabled when the process started.
>
>  I just can't think what I need to do to my button:
>  ===============================================
>  final Button cancel = new Button("cancel", new
>  StringResourceModel("cancelbutton", this, null)) {
>      private static final long serialVersionUID = 691332069442892669L;
>
>      public void onSubmit() {
>         setReturnPage(pageId, pageType, website);
>      }
>  };
>  cancel.setDefaultFormProcessing(false);
>  form.add(cancel);
>
>  --
>  View this message in context: http://www.nabble.com/AjaxSelfUpdatingTimerBahaviour-to-enable-button-when-process-compete-tp17045416p17045416.html
>  Sent from the Wicket - User 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
>
>

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