You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Anna Simbirtsev <as...@gmail.com> on 2012/09/12 16:52:43 UTC

disabling ajax submit button

Hi

I am trying to disable ajax submit button after it has been clicked.

AjaxSubmitLink  submitButton1 =  new AjaxSubmitLink("submitButton1") {

            private static final long serialVersionUID = 1L;


            protected void onSubmit(AjaxRequestTarget target, final Form<?>
form)
            {
                submitButton1.add(
                        new SimpleAttributeModifier("disabled",
"disabled"));

                target.addComponent(submitButton1);
            }


This does not work.:(

Re: disabling ajax submit button

Posted by Anna Simbirtsev <as...@gmail.com>.
<div class="submitarea"><a href="#" wicket:id = "submitButton1"
class="button submitarea">SUBMIT</a></div>

Sorry, you are right, it is an ajax link, not a button.

On Thu, Sep 13, 2012 at 4:26 PM, Paul Bors <pa...@bors.ws> wrote:

> I'm confused, the title is talking about an Ajax submit button yet your
> code
> snippet shows an AjaxSubmitLink.
> Perhaps you meant to use an AjaxButton in your Java code?
>
> What's the HTML mark-up you use with the Java code you showed us?
>
> ~ Thank you,
>   Paul Bors
>
> -----Original Message-----
> From: Anna Simbirtsev [mailto:asimbirtsev@gmail.com]
> Sent: Thursday, September 13, 2012 3:28 PM
> To: users@wicket.apache.org
> Subject: Re: disabling ajax submit button
>
> it does not work
>
> On Thu, Sep 13, 2012 at 11:53 AM, vineet semwal
> <vi...@gmail.com>wrote:
>
> > that should have worked... btw why not just button.setEnabled(false)  ?
> >
> > On Thu, Sep 13, 2012 at 9:11 PM, Anna Simbirtsev
> > <as...@gmail.com>
> > wrote:
> > > I am using wicket 1.4.3
> > > and changing to the code you mentioned below, does not work as
> > > well:(
> > >
> > > Thanks
> > >
> > > On Wed, Sep 12, 2012 at 11:42 AM, Sébastien Gautrin <
> > sgautrin@telemetris.com
> > >> wrote:
> > >
> > >> Which wicket version ? (I ask because I see you are using several
> > >> calls that are deprecated in 1.5).
> > >> Besides, within the declaration of your inner class, don't try to
> > >> access the variable you are defining (and without declaring it
> > >> final, it should normally not compile anyway).
> > >>
> > >> Not changing the deprecated calls, this should probably look like :
> > >>
> > >> add(new SimpleAttributeModifier("**disabled", "disabled"));
> > >> target.addComponent(this);
> > >>
> > >> -------- Original Message --------
> > >> *Subject: *disabling ajax submit button
> > >> *From: *Anna Simbirtsev <as...@gmail.com>
> > >> *To: *users@wicket.apache.org
> > >> *Date: *2012-09-12
> > >>
> > >>  Hi
> > >>>
> > >>> I am trying to disable ajax submit button after it has been clicked.
> > >>>
> > >>> AjaxSubmitLink  submitButton1 =  new
> > >>> AjaxSubmitLink("submitButton1"**)
> > {
> > >>>
> > >>>              private static final long serialVersionUID = 1L;
> > >>>
> > >>>
> > >>>              protected void onSubmit(AjaxRequestTarget target,
> > >>> final Form<?>
> > >>> form)
> > >>>              {
> > >>>                  submitButton1.add(
> > >>>                          new SimpleAttributeModifier("**disabled",
> > >>> "disabled"));
> > >>>
> > >>>                  target.addComponent(**submitButton1);
> > >>>              }
> > >>>
> > >>>
> > >>> This does not work.:(
> > >>>
> > >>>
> > >>
> >
> >
> >
> > --
> > regards,
> >
> > Vineet Semwal
> >
> > ---------------------------------------------------------------------
> > 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
>
>

RE: disabling ajax submit button

Posted by Paul Bors <pa...@bors.ws>.
I'm confused, the title is talking about an Ajax submit button yet your code
snippet shows an AjaxSubmitLink.
Perhaps you meant to use an AjaxButton in your Java code?

What's the HTML mark-up you use with the Java code you showed us?

~ Thank you,
  Paul Bors

-----Original Message-----
From: Anna Simbirtsev [mailto:asimbirtsev@gmail.com] 
Sent: Thursday, September 13, 2012 3:28 PM
To: users@wicket.apache.org
Subject: Re: disabling ajax submit button

it does not work

On Thu, Sep 13, 2012 at 11:53 AM, vineet semwal
<vi...@gmail.com>wrote:

> that should have worked... btw why not just button.setEnabled(false)  ?
>
> On Thu, Sep 13, 2012 at 9:11 PM, Anna Simbirtsev 
> <as...@gmail.com>
> wrote:
> > I am using wicket 1.4.3
> > and changing to the code you mentioned below, does not work as 
> > well:(
> >
> > Thanks
> >
> > On Wed, Sep 12, 2012 at 11:42 AM, Sébastien Gautrin <
> sgautrin@telemetris.com
> >> wrote:
> >
> >> Which wicket version ? (I ask because I see you are using several 
> >> calls that are deprecated in 1.5).
> >> Besides, within the declaration of your inner class, don't try to 
> >> access the variable you are defining (and without declaring it 
> >> final, it should normally not compile anyway).
> >>
> >> Not changing the deprecated calls, this should probably look like :
> >>
> >> add(new SimpleAttributeModifier("**disabled", "disabled")); 
> >> target.addComponent(this);
> >>
> >> -------- Original Message --------
> >> *Subject: *disabling ajax submit button
> >> *From: *Anna Simbirtsev <as...@gmail.com>
> >> *To: *users@wicket.apache.org
> >> *Date: *2012-09-12
> >>
> >>  Hi
> >>>
> >>> I am trying to disable ajax submit button after it has been clicked.
> >>>
> >>> AjaxSubmitLink  submitButton1 =  new 
> >>> AjaxSubmitLink("submitButton1"**)
> {
> >>>
> >>>              private static final long serialVersionUID = 1L;
> >>>
> >>>
> >>>              protected void onSubmit(AjaxRequestTarget target, 
> >>> final Form<?>
> >>> form)
> >>>              {
> >>>                  submitButton1.add(
> >>>                          new SimpleAttributeModifier("**disabled",
> >>> "disabled"));
> >>>
> >>>                  target.addComponent(**submitButton1);
> >>>              }
> >>>
> >>>
> >>> This does not work.:(
> >>>
> >>>
> >>
>
>
>
> --
> regards,
>
> Vineet Semwal
>
> ---------------------------------------------------------------------
> 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


Re: disabling ajax submit button

Posted by Anna Simbirtsev <as...@gmail.com>.
it does not work

On Thu, Sep 13, 2012 at 11:53 AM, vineet semwal <vi...@gmail.com>wrote:

> that should have worked... btw why not just button.setEnabled(false)  ?
>
> On Thu, Sep 13, 2012 at 9:11 PM, Anna Simbirtsev <as...@gmail.com>
> wrote:
> > I am using wicket 1.4.3
> > and changing to the code you mentioned below, does not work as well:(
> >
> > Thanks
> >
> > On Wed, Sep 12, 2012 at 11:42 AM, Sébastien Gautrin <
> sgautrin@telemetris.com
> >> wrote:
> >
> >> Which wicket version ? (I ask because I see you are using several calls
> >> that are deprecated in 1.5).
> >> Besides, within the declaration of your inner class, don't try to access
> >> the variable you are defining
> >> (and without declaring it final, it should normally not compile anyway).
> >>
> >> Not changing the deprecated calls, this should probably look like :
> >>
> >> add(new SimpleAttributeModifier("**disabled", "disabled"));
> >> target.addComponent(this);
> >>
> >> -------- Original Message --------
> >> *Subject: *disabling ajax submit button
> >> *From: *Anna Simbirtsev <as...@gmail.com>
> >> *To: *users@wicket.apache.org
> >> *Date: *2012-09-12
> >>
> >>  Hi
> >>>
> >>> I am trying to disable ajax submit button after it has been clicked.
> >>>
> >>> AjaxSubmitLink  submitButton1 =  new AjaxSubmitLink("submitButton1"**)
> {
> >>>
> >>>              private static final long serialVersionUID = 1L;
> >>>
> >>>
> >>>              protected void onSubmit(AjaxRequestTarget target, final
> >>> Form<?>
> >>> form)
> >>>              {
> >>>                  submitButton1.add(
> >>>                          new SimpleAttributeModifier("**disabled",
> >>> "disabled"));
> >>>
> >>>                  target.addComponent(**submitButton1);
> >>>              }
> >>>
> >>>
> >>> This does not work.:(
> >>>
> >>>
> >>
>
>
>
> --
> regards,
>
> Vineet Semwal
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: disabling ajax submit button

Posted by vineet semwal <vi...@gmail.com>.
that should have worked... btw why not just button.setEnabled(false)  ?

On Thu, Sep 13, 2012 at 9:11 PM, Anna Simbirtsev <as...@gmail.com> wrote:
> I am using wicket 1.4.3
> and changing to the code you mentioned below, does not work as well:(
>
> Thanks
>
> On Wed, Sep 12, 2012 at 11:42 AM, Sébastien Gautrin <sgautrin@telemetris.com
>> wrote:
>
>> Which wicket version ? (I ask because I see you are using several calls
>> that are deprecated in 1.5).
>> Besides, within the declaration of your inner class, don't try to access
>> the variable you are defining
>> (and without declaring it final, it should normally not compile anyway).
>>
>> Not changing the deprecated calls, this should probably look like :
>>
>> add(new SimpleAttributeModifier("**disabled", "disabled"));
>> target.addComponent(this);
>>
>> -------- Original Message --------
>> *Subject: *disabling ajax submit button
>> *From: *Anna Simbirtsev <as...@gmail.com>
>> *To: *users@wicket.apache.org
>> *Date: *2012-09-12
>>
>>  Hi
>>>
>>> I am trying to disable ajax submit button after it has been clicked.
>>>
>>> AjaxSubmitLink  submitButton1 =  new AjaxSubmitLink("submitButton1"**) {
>>>
>>>              private static final long serialVersionUID = 1L;
>>>
>>>
>>>              protected void onSubmit(AjaxRequestTarget target, final
>>> Form<?>
>>> form)
>>>              {
>>>                  submitButton1.add(
>>>                          new SimpleAttributeModifier("**disabled",
>>> "disabled"));
>>>
>>>                  target.addComponent(**submitButton1);
>>>              }
>>>
>>>
>>> This does not work.:(
>>>
>>>
>>



-- 
regards,

Vineet Semwal

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


Re: disabling ajax submit button

Posted by Anna Simbirtsev <as...@gmail.com>.
I am using wicket 1.4.3
and changing to the code you mentioned below, does not work as well:(

Thanks

On Wed, Sep 12, 2012 at 11:42 AM, Sébastien Gautrin <sgautrin@telemetris.com
> wrote:

> Which wicket version ? (I ask because I see you are using several calls
> that are deprecated in 1.5).
> Besides, within the declaration of your inner class, don't try to access
> the variable you are defining
> (and without declaring it final, it should normally not compile anyway).
>
> Not changing the deprecated calls, this should probably look like :
>
> add(new SimpleAttributeModifier("**disabled", "disabled"));
> target.addComponent(this);
>
> -------- Original Message --------
> *Subject: *disabling ajax submit button
> *From: *Anna Simbirtsev <as...@gmail.com>
> *To: *users@wicket.apache.org
> *Date: *2012-09-12
>
>  Hi
>>
>> I am trying to disable ajax submit button after it has been clicked.
>>
>> AjaxSubmitLink  submitButton1 =  new AjaxSubmitLink("submitButton1"**) {
>>
>>              private static final long serialVersionUID = 1L;
>>
>>
>>              protected void onSubmit(AjaxRequestTarget target, final
>> Form<?>
>> form)
>>              {
>>                  submitButton1.add(
>>                          new SimpleAttributeModifier("**disabled",
>> "disabled"));
>>
>>                  target.addComponent(**submitButton1);
>>              }
>>
>>
>> This does not work.:(
>>
>>
>

Re: disabling ajax submit button

Posted by Sébastien Gautrin <sg...@telemetris.com>.
Which wicket version ? (I ask because I see you are using several calls 
that are deprecated in 1.5).
Besides, within the declaration of your inner class, don't try to access 
the variable you are defining
(and without declaring it final, it should normally not compile anyway).

Not changing the deprecated calls, this should probably look like :

add(new SimpleAttributeModifier("disabled", "disabled"));
target.addComponent(this);

-------- Original Message --------
*Subject: *disabling ajax submit button
*From: *Anna Simbirtsev <as...@gmail.com>
*To: *users@wicket.apache.org
*Date: *2012-09-12
> Hi
>
> I am trying to disable ajax submit button after it has been clicked.
>
> AjaxSubmitLink  submitButton1 =  new AjaxSubmitLink("submitButton1") {
>
>              private static final long serialVersionUID = 1L;
>
>
>              protected void onSubmit(AjaxRequestTarget target, final Form<?>
> form)
>              {
>                  submitButton1.add(
>                          new SimpleAttributeModifier("disabled",
> "disabled"));
>
>                  target.addComponent(submitButton1);
>              }
>
>
> This does not work.:(
>