You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by miata <ma...@gmail.com> on 2008/11/18 15:38:00 UTC

No reaction appear on ajaxSubmitLink

Hi,

I have a problem with submitting form by an AjaxSubmitLink. In fact I try to
disabled all field in my form with:
field.setEnabled(false);
It's work if I use an AjaxLink.click to take effect enabled disabled but
it's doesn't work with AjaxSubmitLink.submit. The submit work and react at
the first submit but not after...

This is the code  :
        //don't work
        AjaxSubmitLink editButton = new AjaxSubmitLink("editButton") {
			private boolean isEditing = false;

            @Override
            protected void onSubmit(AjaxRequestTarget target, Form form) {
                if (isEditing) 
                    isEditing = false;
                else
                    isEditing = true;
                field.setEnabled(isEditing);
                field.addComponent(streetLine1Field);

            }
         //work
        AjaxLink enableButton = new AjaxLink("enableButton") {
            private boolean isEditing = false;

            @Override
            public void onClick(AjaxRequestTarget target) {
                if (isEditing) 
                    isEditing = false;
                else
                    isEditing = true;
                field.setEnabled(isEditing);
                field.addComponent(streetLine1Field);
            }
        }

Many thanks

-- 
View this message in context: http://www.nabble.com/No-reaction-appear-on-ajaxSubmitLink-tp20560843p20560843.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: No reaction appear on ajaxSubmitLink

Posted by miata <ma...@gmail.com>.
It's work !!! It's seem to be the model attachment to the form that
problem...

thanks


Martijn Dashorst wrote:
> 
> Try overriding onError as well and add a feedback panel to your ajax
> request target in the onError.
> 
> Martijn
> 
> On Tue, Nov 18, 2008 at 3:38 PM, miata <ma...@gmail.com> wrote:
>>
>> Hi,
>>
>> I have a problem with submitting form by an AjaxSubmitLink. In fact I try
>> to
>> disabled all field in my form with:
>> field.setEnabled(false);
>> It's work if I use an AjaxLink.click to take effect enabled disabled but
>> it's doesn't work with AjaxSubmitLink.submit. The submit work and react
>> at
>> the first submit but not after...
>>
>> This is the code  :
>>        //don't work
>>        AjaxSubmitLink editButton = new AjaxSubmitLink("editButton") {
>>                        private boolean isEditing = false;
>>
>>            @Override
>>            protected void onSubmit(AjaxRequestTarget target, Form form) {
>>                if (isEditing)
>>                    isEditing = false;
>>                else
>>                    isEditing = true;
>>                field.setEnabled(isEditing);
>>                field.addComponent(streetLine1Field);
>>
>>            }
>>         //work
>>        AjaxLink enableButton = new AjaxLink("enableButton") {
>>            private boolean isEditing = false;
>>
>>            @Override
>>            public void onClick(AjaxRequestTarget target) {
>>                if (isEditing)
>>                    isEditing = false;
>>                else
>>                    isEditing = true;
>>                field.setEnabled(isEditing);
>>                field.addComponent(streetLine1Field);
>>            }
>>        }
>>
>> Many thanks
>>
>> --
>> View this message in context:
>> http://www.nabble.com/No-reaction-appear-on-ajaxSubmitLink-tp20560843p20560843.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
>>
>>
> 
> 
> 
> -- 
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> Apache Wicket 1.3.4 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
> 
> ---------------------------------------------------------------------
> 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/No-reaction-appear-on-ajaxSubmitLink-tp20560843p20562045.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: No reaction appear on ajaxSubmitLink

Posted by Martijn Dashorst <ma...@gmail.com>.
Try overriding onError as well and add a feedback panel to your ajax
request target in the onError.

Martijn

On Tue, Nov 18, 2008 at 3:38 PM, miata <ma...@gmail.com> wrote:
>
> Hi,
>
> I have a problem with submitting form by an AjaxSubmitLink. In fact I try to
> disabled all field in my form with:
> field.setEnabled(false);
> It's work if I use an AjaxLink.click to take effect enabled disabled but
> it's doesn't work with AjaxSubmitLink.submit. The submit work and react at
> the first submit but not after...
>
> This is the code  :
>        //don't work
>        AjaxSubmitLink editButton = new AjaxSubmitLink("editButton") {
>                        private boolean isEditing = false;
>
>            @Override
>            protected void onSubmit(AjaxRequestTarget target, Form form) {
>                if (isEditing)
>                    isEditing = false;
>                else
>                    isEditing = true;
>                field.setEnabled(isEditing);
>                field.addComponent(streetLine1Field);
>
>            }
>         //work
>        AjaxLink enableButton = new AjaxLink("enableButton") {
>            private boolean isEditing = false;
>
>            @Override
>            public void onClick(AjaxRequestTarget target) {
>                if (isEditing)
>                    isEditing = false;
>                else
>                    isEditing = true;
>                field.setEnabled(isEditing);
>                field.addComponent(streetLine1Field);
>            }
>        }
>
> Many thanks
>
> --
> View this message in context: http://www.nabble.com/No-reaction-appear-on-ajaxSubmitLink-tp20560843p20560843.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
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

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