You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jade <ja...@gmail.com> on 2009/06/09 11:30:43 UTC

AjaxLink and Form Validation

Hi all,

 I am having a issue with AjaxLink and thought would get help from you.

 I have a modal window which has a form with two ajax links, few check boxes
and a AjaxButton.The check boxes are bound inside a list view.

 Now, out of the two ajax links - one ajax link is for checking all the
check boxes and other is for unchecking all of them.

 I also have validation added to the form to check at least one of the check
boxes is checked on submit. But the strange thing that happens is - whenever
the ajaxlink for none is clicked, the ajaxbutton's onSubmit  is not at all
called. And the validation does not happen in the form, which I came to know
by eclipse debug sequence.

 Am I doing something wrong here, I am still very much confused why its not
called.

Also, any advices for better implementation of the functionality would be of
great help.

Thanks,
Jade

Re: AjaxLink and Form Validation

Posted by Jade <ja...@gmail.com>.
Nope, I am not doing a setDefaultFormProcessing(true) for the button.

I am just doing the following onSubmit of the AjaxButton -
setRedirect(true);
setResponsePage(getApplication().getHomePage());

Thanks for your time Igor.

On Tue, Jun 9, 2009 at 4:56 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> onsubmit() is only called if validation passes or you called
> setdefaultformprocessing(true) on the button/submitlink.
>
> -igor
>
> On Tue, Jun 9, 2009 at 7:52 AM, Jade<ja...@gmail.com> wrote:
> > Well - I did try using the AjaxSubmitLink, the validation happens during
> the
> > link click and displays the error message..but even after the error
> message
> > is shown, when I click the AjaxButton in the form, the form submit
> happens
> > :-(
> >
> > Do I have to setDefaultFormProcessing(false) or something else I am
> getting
> > wrong here?
> >
> > On Tue, Jun 9, 2009 at 4:42 PM, Igor Vaynberg <igor.vaynberg@gmail.com
> >wrote:
> >
> >> if you need to submit the form use ajaxsubmitlink, if you dont then
> >> use the normal ajaxlink.
> >>
> >> -igor
> >>
> >> On Tue, Jun 9, 2009 at 7:39 AM, Jade<ja...@gmail.com> wrote:
> >> > Hi Igor,
> >> >
> >> >  Yes, I did understand that after a deeper look. But for my use case,
> >> which
> >> > would a better one to use?
> >> >
> >> >  I cannot use a normal link as it would reload the screen and the
> >> > modalwindow would vanish.
> >> >
> >> >  Please advise. Thanks for your time.
> >> >
> >> > Thanks,
> >> > J
> >> >
> >> > On Tue, Jun 9, 2009 at 4:34 PM, Igor Vaynberg <
> igor.vaynberg@gmail.com
> >> >wrote:
> >> >
> >> >> ajaxlink does not submit the form so no validation will happen and it
> >> >> doesnt have an onsubmit method. you are mixing up ajaxlink,
> >> >> ajaxsubmitlink, and ajaxbutton.
> >> >>
> >> >> -igor
> >> >>
> >> >> On Tue, Jun 9, 2009 at 2:30 AM, Jade<ja...@gmail.com> wrote:
> >> >> > Hi all,
> >> >> >
> >> >> >  I am having a issue with AjaxLink and thought would get help from
> >> you.
> >> >> >
> >> >> >  I have a modal window which has a form with two ajax links, few
> check
> >> >> boxes
> >> >> > and a AjaxButton.The check boxes are bound inside a list view.
> >> >> >
> >> >> >  Now, out of the two ajax links - one ajax link is for checking all
> >> the
> >> >> > check boxes and other is for unchecking all of them.
> >> >> >
> >> >> >  I also have validation added to the form to check at least one of
> the
> >> >> check
> >> >> > boxes is checked on submit. But the strange thing that happens is -
> >> >> whenever
> >> >> > the ajaxlink for none is clicked, the ajaxbutton's onSubmit  is not
> at
> >> >> all
> >> >> > called. And the validation does not happen in the form, which I
> came
> >> to
> >> >> know
> >> >> > by eclipse debug sequence.
> >> >> >
> >> >> >  Am I doing something wrong here, I am still very much confused why
> >> its
> >> >> not
> >> >> > called.
> >> >> >
> >> >> > Also, any advices for better implementation of the functionality
> would
> >> be
> >> >> of
> >> >> > great help.
> >> >> >
> >> >> > Thanks,
> >> >> > Jade
> >> >> >
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> 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
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: AjaxLink and Form Validation

Posted by Erik van Oosten <e....@grons.nl>.
Ok. I looked further in the thread.

I am not sure what goes wrong, but I think you should call 
setdefaultformprocessing(false) on the uncheckall AjaxSubmitLink. 
Otherwise the onSubmit of that button is only called when validation 
succeeded. If that doesn't work, just create a quickstart 
(http://wicket.apache.org/quickstart) for yourself to experiment in. 
That would also be an easy way to try out a newer Wicket versions.

No need to check if taget is null by the way. That only applies in 
AjaxFallback* components.

Regards,
    Erik.


Jade wrote:
> Oh yes will try to do that for sure Erik if my team and manager agrees for
> it :-)
>
> Otherwise, did you(guys) find any thing wrong in my code? or anything thats
> fishy?? I am a beginner to wickets, so its obvious I must have made some
> mistake :-s
>
> On Thu, Jun 11, 2009 at 12:58 AM, Erik van Oosten <e....@grons.nl>wrote:
>
>   

-- 
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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


Re: AjaxLink and Form Validation

Posted by Jade <ja...@gmail.com>.
Oh yes will try to do that for sure Erik if my team and manager agrees for
it :-)

Otherwise, did you(guys) find any thing wrong in my code? or anything thats
fishy?? I am a beginner to wickets, so its obvious I must have made some
mistake :-s

On Thu, Jun 11, 2009 at 12:58 AM, Erik van Oosten <e....@grons.nl>wrote:

> Ah, no that bug is not present in the 1.3 range. But upgrading to a later
> 1.3 version would perhaps help as well.
>
> See the migration guide on the wiki on how tough an 1.3 -> 1.4 upgrade will
> be for you. To give some perspective: I migrated a large project within a
> few hours.
>
> Regards,
>   Erik.
>
>
>
> Jade wrote:
>
>> Hi Erik,
>>
>>  I am using version 1.3.4. And I guess migration it to version 1.4 would
>> be
>> bit tough.
>>
>>  Anyways, that would have to be done if there is no other way around it.
>>
>>  Btw, any work around to over come this? Please suggest. Thanks all for
>> your
>> time in educating me.
>>
>> Regards,
>> Jade
>>
>> On Thu, Jun 11, 2009 at 12:41 AM, Erik van Oosten <e.vanoosten@grons.nl
>> >wrote:
>>
>>
>>
>>> Jade,
>>>
>>> There was a bug regarding this in one of the 1.4 rc's. I think it was
>>> rc2.
>>> Could upgrade to a newer 1.4 version and try again?
>>>
>>> Regards,
>>>  Erik.
>>>
>>>
>>> Jade wrote:
>>>
>>>
>>>
>>>> Guys,
>>>>
>>>>  I am still struggling with the same :-( please advise.
>>>>
>>>> Tia,
>>>> J
>>>>
>>>> On Wed, Jun 10, 2009 at 8:27 AM, Jade <ja...@gmail.com> wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> And, I also tried changing the AjaxButton to AjaxSubmitLink in the java
>>>>> code and with the same <input type.../> (as in for a submit button) in
>>>>> the
>>>>> HTML page.
>>>>> I am still having the same issue.
>>>>>
>>>>> All I am confused is, what happens such that the onSubmit method in the
>>>>> AjaxButton is never called once I click on any one of the
>>>>> AjaxSubmitLinks
>>>>> in
>>>>> the form :-(
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>> --
>>> Erik van Oosten
>>> http://www.day-to-day-stuff.blogspot.com/
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> Erik van Oosten
> http://www.day-to-day-stuff.blogspot.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: AjaxLink and Form Validation

Posted by Erik van Oosten <e....@grons.nl>.
Ah, no that bug is not present in the 1.3 range. But upgrading to a 
later 1.3 version would perhaps help as well.

See the migration guide on the wiki on how tough an 1.3 -> 1.4 upgrade 
will be for you. To give some perspective: I migrated a large project 
within a few hours.

Regards,
    Erik.


Jade wrote:
> Hi Erik,
>
>  I am using version 1.3.4. And I guess migration it to version 1.4 would be
> bit tough.
>
>  Anyways, that would have to be done if there is no other way around it.
>
>  Btw, any work around to over come this? Please suggest. Thanks all for your
> time in educating me.
>
> Regards,
> Jade
>
> On Thu, Jun 11, 2009 at 12:41 AM, Erik van Oosten <e....@grons.nl>wrote:
>
>   
>> Jade,
>>
>> There was a bug regarding this in one of the 1.4 rc's. I think it was rc2.
>> Could upgrade to a newer 1.4 version and try again?
>>
>> Regards,
>>   Erik.
>>
>>
>> Jade wrote:
>>
>>     
>>> Guys,
>>>
>>>  I am still struggling with the same :-( please advise.
>>>
>>> Tia,
>>> J
>>>
>>> On Wed, Jun 10, 2009 at 8:27 AM, Jade <ja...@gmail.com> wrote:
>>>
>>>
>>>
>>>       
>>>> And, I also tried changing the AjaxButton to AjaxSubmitLink in the java
>>>> code and with the same <input type.../> (as in for a submit button) in
>>>> the
>>>> HTML page.
>>>> I am still having the same issue.
>>>>
>>>> All I am confused is, what happens such that the onSubmit method in the
>>>> AjaxButton is never called once I click on any one of the AjaxSubmitLinks
>>>> in
>>>> the form :-(
>>>>
>>>>
>>>>         
>>>       
>> --
>> Erik van Oosten
>> http://www.day-to-day-stuff.blogspot.com/
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>     
>
>   


-- 
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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


Re: AjaxLink and Form Validation

Posted by Jade <ja...@gmail.com>.
Hi Erik,

 I am using version 1.3.4. And I guess migration it to version 1.4 would be
bit tough.

 Anyways, that would have to be done if there is no other way around it.

 Btw, any work around to over come this? Please suggest. Thanks all for your
time in educating me.

Regards,
Jade

On Thu, Jun 11, 2009 at 12:41 AM, Erik van Oosten <e....@grons.nl>wrote:

> Jade,
>
> There was a bug regarding this in one of the 1.4 rc's. I think it was rc2.
> Could upgrade to a newer 1.4 version and try again?
>
> Regards,
>   Erik.
>
>
> Jade wrote:
>
>> Guys,
>>
>>  I am still struggling with the same :-( please advise.
>>
>> Tia,
>> J
>>
>> On Wed, Jun 10, 2009 at 8:27 AM, Jade <ja...@gmail.com> wrote:
>>
>>
>>
>>> And, I also tried changing the AjaxButton to AjaxSubmitLink in the java
>>> code and with the same <input type.../> (as in for a submit button) in
>>> the
>>> HTML page.
>>> I am still having the same issue.
>>>
>>> All I am confused is, what happens such that the onSubmit method in the
>>> AjaxButton is never called once I click on any one of the AjaxSubmitLinks
>>> in
>>> the form :-(
>>>
>>>
>>
>>
>
> --
> Erik van Oosten
> http://www.day-to-day-stuff.blogspot.com/
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: AjaxLink and Form Validation

Posted by Erik van Oosten <e....@grons.nl>.
Jade,

There was a bug regarding this in one of the 1.4 rc's. I think it was 
rc2. Could upgrade to a newer 1.4 version and try again?

Regards,
    Erik.


Jade wrote:
> Guys,
>
>  I am still struggling with the same :-( please advise.
>
> Tia,
> J
>
> On Wed, Jun 10, 2009 at 8:27 AM, Jade <ja...@gmail.com> wrote:
>
>   
>> And, I also tried changing the AjaxButton to AjaxSubmitLink in the java
>> code and with the same <input type.../> (as in for a submit button) in the
>> HTML page.
>> I am still having the same issue.
>>
>> All I am confused is, what happens such that the onSubmit method in the
>> AjaxButton is never called once I click on any one of the AjaxSubmitLinks in
>> the form :-(
>>     
>


-- 
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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


Re: AjaxLink and Form Validation

Posted by Jade <ja...@gmail.com>.
Guys,

 I am still struggling with the same :-( please advise.

Tia,
J

On Wed, Jun 10, 2009 at 8:27 AM, Jade <ja...@gmail.com> wrote:

> And, I also tried changing the AjaxButton to AjaxSubmitLink in the java
> code and with the same <input type.../> (as in for a submit button) in the
> HTML page.
> I am still having the same issue.
>
> All I am confused is, what happens such that the onSubmit method in the
> AjaxButton is never called once I click on any one of the AjaxSubmitLinks in
> the form :-(
>
>
> On Tue, Jun 9, 2009 at 8:51 PM, Jade <ja...@gmail.com> wrote:
>
>> Here are the code snippets for a better understanding,
>>
>> //The form
>> Form form = new Form("form"){
>>
>>             /**
>>              *
>>              */
>>             private static final long serialVersionUID = 1L;
>>
>>             protected void validate(){
>>                 super.validate();
>>                 boolean isValid = false;
>>                 for(CheckModel cModel : checkModels){
>>                     if(cModel.getChecked()){
>>                         isValid = true;
>>                         break;
>>                     }
>>                 }
>>                 if(!isValid || checkModels.isEmpty()){
>>                     error("Atleast one checkbox is required!!");
>>                 }
>>             }
>>
>>         };
>>
>>
>> //The uncheck all ajax submit link
>> form.add(new AjaxSubmitLink("uncheckall") {
>>
>>             /**
>>              *
>>              */
>>             private static final long serialVersionUID = 1L;
>>
>>             @Override
>>             protected void onSubmit(AjaxRequestTarget target, Form form) {
>>                 checks.clear();
>>                 for(CheckModel cModel : checkModels){
>>                     cModel .setChecked(Boolean.FALSE);
>>                 }
>>                 if(target != null){
>>                     target.addComponent(CheckModalPanel.this);
>>                 }
>>             }
>>
>>         });
>>
>> //The ajaxbutton that is used
>> form.add(new IndicatingAjaxButton("setCheck", form) {
>>
>>             /**
>>                  */
>>             private static final long serialVersionUID = 1L;
>>
>>             protected void onSubmit(AjaxRequestTarget target, Form form) {
>>                 checks.clear();
>>                 for(CheckModel cModel : checkModels){
>>                     if(cModel.getChecked()){
>>                         //copy the checked models to session
>>                     }
>>                 }
>>                 setRedirect(true);
>>                 setResponsePage(getApplication().getHomePage());
>>             }
>>
>>             protected void onError(AjaxRequestTarget target, Form form) {
>>                 if (target != null) {
>>                     target.addComponent(feedback);
>>                     setRedirect(false);
>>                 }
>>             }
>>         });
>>
>>
>> On Tue, Jun 9, 2009 at 5:10 PM, Jade <ja...@gmail.com> wrote:
>>
>>> Oh...Anyways as of now, I am not setting the setDefaultProcessing on the
>>> AjaxButton...
>>>
>>> Thanks again!
>>>
>>> On Tue, Jun 9, 2009 at 5:06 PM, Igor Vaynberg <ig...@gmail.com>wrote:
>>>
>>>> woops, i meant setdefaultformprocessing(FALSE)
>>>>
>>>> -igor
>>>>
>>>> On Tue, Jun 9, 2009 at 7:56 AM, Igor Vaynberg<ig...@gmail.com>
>>>> wrote:
>>>> > onsubmit() is only called if validation passes or you called
>>>> > setdefaultformprocessing(true) on the button/submitlink.
>>>> >
>>>> > -igor
>>>> >
>>>> > On Tue, Jun 9, 2009 at 7:52 AM, Jade<ja...@gmail.com> wrote:
>>>> >> Well - I did try using the AjaxSubmitLink, the validation happens
>>>> during the
>>>> >> link click and displays the error message..but even after the error
>>>> message
>>>> >> is shown, when I click the AjaxButton in the form, the form submit
>>>> happens
>>>> >> :-(
>>>> >>
>>>> >> Do I have to setDefaultFormProcessing(false) or something else I am
>>>> getting
>>>> >> wrong here?
>>>> >>
>>>> >> On Tue, Jun 9, 2009 at 4:42 PM, Igor Vaynberg <
>>>> igor.vaynberg@gmail.com>wrote:
>>>> >>
>>>> >>> if you need to submit the form use ajaxsubmitlink, if you dont then
>>>> >>> use the normal ajaxlink.
>>>> >>>
>>>> >>> -igor
>>>> >>>
>>>> >>> On Tue, Jun 9, 2009 at 7:39 AM, Jade<ja...@gmail.com> wrote:
>>>> >>> > Hi Igor,
>>>> >>> >
>>>> >>> >  Yes, I did understand that after a deeper look. But for my use
>>>> case,
>>>> >>> which
>>>> >>> > would a better one to use?
>>>> >>> >
>>>> >>> >  I cannot use a normal link as it would reload the screen and the
>>>> >>> > modalwindow would vanish.
>>>> >>> >
>>>> >>> >  Please advise. Thanks for your time.
>>>> >>> >
>>>> >>> > Thanks,
>>>> >>> > J
>>>> >>> >
>>>> >>> > On Tue, Jun 9, 2009 at 4:34 PM, Igor Vaynberg <
>>>> igor.vaynberg@gmail.com
>>>> >>> >wrote:
>>>> >>> >
>>>> >>> >> ajaxlink does not submit the form so no validation will happen
>>>> and it
>>>> >>> >> doesnt have an onsubmit method. you are mixing up ajaxlink,
>>>> >>> >> ajaxsubmitlink, and ajaxbutton.
>>>> >>> >>
>>>> >>> >> -igor
>>>> >>> >>
>>>> >>> >> On Tue, Jun 9, 2009 at 2:30 AM, Jade<ja...@gmail.com> wrote:
>>>> >>> >> > Hi all,
>>>> >>> >> >
>>>> >>> >> >  I am having a issue with AjaxLink and thought would get help
>>>> from
>>>> >>> you.
>>>> >>> >> >
>>>> >>> >> >  I have a modal window which has a form with two ajax links,
>>>> few check
>>>> >>> >> boxes
>>>> >>> >> > and a AjaxButton.The check boxes are bound inside a list view.
>>>> >>> >> >
>>>> >>> >> >  Now, out of the two ajax links - one ajax link is for checking
>>>> all
>>>> >>> the
>>>> >>> >> > check boxes and other is for unchecking all of them.
>>>> >>> >> >
>>>> >>> >> >  I also have validation added to the form to check at least one
>>>> of the
>>>> >>> >> check
>>>> >>> >> > boxes is checked on submit. But the strange thing that happens
>>>> is -
>>>> >>> >> whenever
>>>> >>> >> > the ajaxlink for none is clicked, the ajaxbutton's onSubmit  is
>>>> not at
>>>> >>> >> all
>>>> >>> >> > called. And the validation does not happen in the form, which I
>>>> came
>>>> >>> to
>>>> >>> >> know
>>>> >>> >> > by eclipse debug sequence.
>>>> >>> >> >
>>>> >>> >> >  Am I doing something wrong here, I am still very much confused
>>>> why
>>>> >>> its
>>>> >>> >> not
>>>> >>> >> > called.
>>>> >>> >> >
>>>> >>> >> > Also, any advices for better implementation of the
>>>> functionality would
>>>> >>> be
>>>> >>> >> of
>>>> >>> >> > great help.
>>>> >>> >> >
>>>> >>> >> > Thanks,
>>>> >>> >> > Jade
>>>> >>> >> >
>>>> >>> >>
>>>> >>> >>
>>>> ---------------------------------------------------------------------
>>>> >>> >> 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
>>>> >>>
>>>> >>>
>>>> >>
>>>> >
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>
>

Re: AjaxLink and Form Validation

Posted by Jade <ja...@gmail.com>.
And, I also tried changing the AjaxButton to AjaxSubmitLink in the java code
and with the same <input type.../> (as in for a submit button) in the HTML
page.
I am still having the same issue.

All I am confused is, what happens such that the onSubmit method in the
AjaxButton is never called once I click on any one of the AjaxSubmitLinks in
the form :-(

On Tue, Jun 9, 2009 at 8:51 PM, Jade <ja...@gmail.com> wrote:

> Here are the code snippets for a better understanding,
>
> //The form
> Form form = new Form("form"){
>
>             /**
>              *
>              */
>             private static final long serialVersionUID = 1L;
>
>             protected void validate(){
>                 super.validate();
>                 boolean isValid = false;
>                 for(CheckModel cModel : checkModels){
>                     if(cModel.getChecked()){
>                         isValid = true;
>                         break;
>                     }
>                 }
>                 if(!isValid || checkModels.isEmpty()){
>                     error("Atleast one checkbox is required!!");
>                 }
>             }
>
>         };
>
>
> //The uncheck all ajax submit link
> form.add(new AjaxSubmitLink("uncheckall") {
>
>             /**
>              *
>              */
>             private static final long serialVersionUID = 1L;
>
>             @Override
>             protected void onSubmit(AjaxRequestTarget target, Form form) {
>                 checks.clear();
>                 for(CheckModel cModel : checkModels){
>                     cModel .setChecked(Boolean.FALSE);
>                 }
>                 if(target != null){
>                     target.addComponent(CheckModalPanel.this);
>                 }
>             }
>
>         });
>
> //The ajaxbutton that is used
> form.add(new IndicatingAjaxButton("setCheck", form) {
>
>             /**
>                  */
>             private static final long serialVersionUID = 1L;
>
>             protected void onSubmit(AjaxRequestTarget target, Form form) {
>                 checks.clear();
>                 for(CheckModel cModel : checkModels){
>                     if(cModel.getChecked()){
>                         //copy the checked models to session
>                     }
>                 }
>                 setRedirect(true);
>                 setResponsePage(getApplication().getHomePage());
>             }
>
>             protected void onError(AjaxRequestTarget target, Form form) {
>                 if (target != null) {
>                     target.addComponent(feedback);
>                     setRedirect(false);
>                 }
>             }
>         });
>
>
> On Tue, Jun 9, 2009 at 5:10 PM, Jade <ja...@gmail.com> wrote:
>
>> Oh...Anyways as of now, I am not setting the setDefaultProcessing on the
>> AjaxButton...
>>
>> Thanks again!
>>
>> On Tue, Jun 9, 2009 at 5:06 PM, Igor Vaynberg <ig...@gmail.com>wrote:
>>
>>> woops, i meant setdefaultformprocessing(FALSE)
>>>
>>> -igor
>>>
>>> On Tue, Jun 9, 2009 at 7:56 AM, Igor Vaynberg<ig...@gmail.com>
>>> wrote:
>>> > onsubmit() is only called if validation passes or you called
>>> > setdefaultformprocessing(true) on the button/submitlink.
>>> >
>>> > -igor
>>> >
>>> > On Tue, Jun 9, 2009 at 7:52 AM, Jade<ja...@gmail.com> wrote:
>>> >> Well - I did try using the AjaxSubmitLink, the validation happens
>>> during the
>>> >> link click and displays the error message..but even after the error
>>> message
>>> >> is shown, when I click the AjaxButton in the form, the form submit
>>> happens
>>> >> :-(
>>> >>
>>> >> Do I have to setDefaultFormProcessing(false) or something else I am
>>> getting
>>> >> wrong here?
>>> >>
>>> >> On Tue, Jun 9, 2009 at 4:42 PM, Igor Vaynberg <
>>> igor.vaynberg@gmail.com>wrote:
>>> >>
>>> >>> if you need to submit the form use ajaxsubmitlink, if you dont then
>>> >>> use the normal ajaxlink.
>>> >>>
>>> >>> -igor
>>> >>>
>>> >>> On Tue, Jun 9, 2009 at 7:39 AM, Jade<ja...@gmail.com> wrote:
>>> >>> > Hi Igor,
>>> >>> >
>>> >>> >  Yes, I did understand that after a deeper look. But for my use
>>> case,
>>> >>> which
>>> >>> > would a better one to use?
>>> >>> >
>>> >>> >  I cannot use a normal link as it would reload the screen and the
>>> >>> > modalwindow would vanish.
>>> >>> >
>>> >>> >  Please advise. Thanks for your time.
>>> >>> >
>>> >>> > Thanks,
>>> >>> > J
>>> >>> >
>>> >>> > On Tue, Jun 9, 2009 at 4:34 PM, Igor Vaynberg <
>>> igor.vaynberg@gmail.com
>>> >>> >wrote:
>>> >>> >
>>> >>> >> ajaxlink does not submit the form so no validation will happen and
>>> it
>>> >>> >> doesnt have an onsubmit method. you are mixing up ajaxlink,
>>> >>> >> ajaxsubmitlink, and ajaxbutton.
>>> >>> >>
>>> >>> >> -igor
>>> >>> >>
>>> >>> >> On Tue, Jun 9, 2009 at 2:30 AM, Jade<ja...@gmail.com> wrote:
>>> >>> >> > Hi all,
>>> >>> >> >
>>> >>> >> >  I am having a issue with AjaxLink and thought would get help
>>> from
>>> >>> you.
>>> >>> >> >
>>> >>> >> >  I have a modal window which has a form with two ajax links, few
>>> check
>>> >>> >> boxes
>>> >>> >> > and a AjaxButton.The check boxes are bound inside a list view.
>>> >>> >> >
>>> >>> >> >  Now, out of the two ajax links - one ajax link is for checking
>>> all
>>> >>> the
>>> >>> >> > check boxes and other is for unchecking all of them.
>>> >>> >> >
>>> >>> >> >  I also have validation added to the form to check at least one
>>> of the
>>> >>> >> check
>>> >>> >> > boxes is checked on submit. But the strange thing that happens
>>> is -
>>> >>> >> whenever
>>> >>> >> > the ajaxlink for none is clicked, the ajaxbutton's onSubmit  is
>>> not at
>>> >>> >> all
>>> >>> >> > called. And the validation does not happen in the form, which I
>>> came
>>> >>> to
>>> >>> >> know
>>> >>> >> > by eclipse debug sequence.
>>> >>> >> >
>>> >>> >> >  Am I doing something wrong here, I am still very much confused
>>> why
>>> >>> its
>>> >>> >> not
>>> >>> >> > called.
>>> >>> >> >
>>> >>> >> > Also, any advices for better implementation of the functionality
>>> would
>>> >>> be
>>> >>> >> of
>>> >>> >> > great help.
>>> >>> >> >
>>> >>> >> > Thanks,
>>> >>> >> > Jade
>>> >>> >> >
>>> >>> >>
>>> >>> >>
>>> ---------------------------------------------------------------------
>>> >>> >> 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
>>> >>>
>>> >>>
>>> >>
>>> >
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>

Re: AjaxLink and Form Validation

Posted by Jade <ja...@gmail.com>.
Here are the code snippets for a better understanding,

//The form
Form form = new Form("form"){

            /**
             *
             */
            private static final long serialVersionUID = 1L;

            protected void validate(){
                super.validate();
                boolean isValid = false;
                for(CheckModel cModel : checkModels){
                    if(cModel.getChecked()){
                        isValid = true;
                        break;
                    }
                }
                if(!isValid || checkModels.isEmpty()){
                    error("Atleast one checkbox is required!!");
                }
            }

        };


//The uncheck all ajax submit link
form.add(new AjaxSubmitLink("uncheckall") {

            /**
             *
             */
            private static final long serialVersionUID = 1L;

            @Override
            protected void onSubmit(AjaxRequestTarget target, Form form) {
                checks.clear();
                for(CheckModel cModel : checkModels){
                    cModel .setChecked(Boolean.FALSE);
                }
                if(target != null){
                    target.addComponent(CheckModalPanel.this);
                }
            }

        });

//The ajaxbutton that is used
form.add(new IndicatingAjaxButton("setCheck", form) {

            /**
                 */
            private static final long serialVersionUID = 1L;

            protected void onSubmit(AjaxRequestTarget target, Form form) {
                checks.clear();
                for(CheckModel cModel : checkModels){
                    if(cModel.getChecked()){
                        //copy the checked models to session
                    }
                }
                setRedirect(true);
                setResponsePage(getApplication().getHomePage());
            }

            protected void onError(AjaxRequestTarget target, Form form) {
                if (target != null) {
                    target.addComponent(feedback);
                    setRedirect(false);
                }
            }
        });

On Tue, Jun 9, 2009 at 5:10 PM, Jade <ja...@gmail.com> wrote:

> Oh...Anyways as of now, I am not setting the setDefaultProcessing on the
> AjaxButton...
>
> Thanks again!
>
> On Tue, Jun 9, 2009 at 5:06 PM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> woops, i meant setdefaultformprocessing(FALSE)
>>
>> -igor
>>
>> On Tue, Jun 9, 2009 at 7:56 AM, Igor Vaynberg<ig...@gmail.com>
>> wrote:
>> > onsubmit() is only called if validation passes or you called
>> > setdefaultformprocessing(true) on the button/submitlink.
>> >
>> > -igor
>> >
>> > On Tue, Jun 9, 2009 at 7:52 AM, Jade<ja...@gmail.com> wrote:
>> >> Well - I did try using the AjaxSubmitLink, the validation happens
>> during the
>> >> link click and displays the error message..but even after the error
>> message
>> >> is shown, when I click the AjaxButton in the form, the form submit
>> happens
>> >> :-(
>> >>
>> >> Do I have to setDefaultFormProcessing(false) or something else I am
>> getting
>> >> wrong here?
>> >>
>> >> On Tue, Jun 9, 2009 at 4:42 PM, Igor Vaynberg <igor.vaynberg@gmail.com
>> >wrote:
>> >>
>> >>> if you need to submit the form use ajaxsubmitlink, if you dont then
>> >>> use the normal ajaxlink.
>> >>>
>> >>> -igor
>> >>>
>> >>> On Tue, Jun 9, 2009 at 7:39 AM, Jade<ja...@gmail.com> wrote:
>> >>> > Hi Igor,
>> >>> >
>> >>> >  Yes, I did understand that after a deeper look. But for my use
>> case,
>> >>> which
>> >>> > would a better one to use?
>> >>> >
>> >>> >  I cannot use a normal link as it would reload the screen and the
>> >>> > modalwindow would vanish.
>> >>> >
>> >>> >  Please advise. Thanks for your time.
>> >>> >
>> >>> > Thanks,
>> >>> > J
>> >>> >
>> >>> > On Tue, Jun 9, 2009 at 4:34 PM, Igor Vaynberg <
>> igor.vaynberg@gmail.com
>> >>> >wrote:
>> >>> >
>> >>> >> ajaxlink does not submit the form so no validation will happen and
>> it
>> >>> >> doesnt have an onsubmit method. you are mixing up ajaxlink,
>> >>> >> ajaxsubmitlink, and ajaxbutton.
>> >>> >>
>> >>> >> -igor
>> >>> >>
>> >>> >> On Tue, Jun 9, 2009 at 2:30 AM, Jade<ja...@gmail.com> wrote:
>> >>> >> > Hi all,
>> >>> >> >
>> >>> >> >  I am having a issue with AjaxLink and thought would get help
>> from
>> >>> you.
>> >>> >> >
>> >>> >> >  I have a modal window which has a form with two ajax links, few
>> check
>> >>> >> boxes
>> >>> >> > and a AjaxButton.The check boxes are bound inside a list view.
>> >>> >> >
>> >>> >> >  Now, out of the two ajax links - one ajax link is for checking
>> all
>> >>> the
>> >>> >> > check boxes and other is for unchecking all of them.
>> >>> >> >
>> >>> >> >  I also have validation added to the form to check at least one
>> of the
>> >>> >> check
>> >>> >> > boxes is checked on submit. But the strange thing that happens is
>> -
>> >>> >> whenever
>> >>> >> > the ajaxlink for none is clicked, the ajaxbutton's onSubmit  is
>> not at
>> >>> >> all
>> >>> >> > called. And the validation does not happen in the form, which I
>> came
>> >>> to
>> >>> >> know
>> >>> >> > by eclipse debug sequence.
>> >>> >> >
>> >>> >> >  Am I doing something wrong here, I am still very much confused
>> why
>> >>> its
>> >>> >> not
>> >>> >> > called.
>> >>> >> >
>> >>> >> > Also, any advices for better implementation of the functionality
>> would
>> >>> be
>> >>> >> of
>> >>> >> > great help.
>> >>> >> >
>> >>> >> > Thanks,
>> >>> >> > Jade
>> >>> >> >
>> >>> >>
>> >>> >>
>> ---------------------------------------------------------------------
>> >>> >> 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
>> >>>
>> >>>
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

Re: AjaxLink and Form Validation

Posted by Jade <ja...@gmail.com>.
Oh...Anyways as of now, I am not setting the setDefaultProcessing on the
AjaxButton...

Thanks again!

On Tue, Jun 9, 2009 at 5:06 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> woops, i meant setdefaultformprocessing(FALSE)
>
> -igor
>
> On Tue, Jun 9, 2009 at 7:56 AM, Igor Vaynberg<ig...@gmail.com>
> wrote:
> > onsubmit() is only called if validation passes or you called
> > setdefaultformprocessing(true) on the button/submitlink.
> >
> > -igor
> >
> > On Tue, Jun 9, 2009 at 7:52 AM, Jade<ja...@gmail.com> wrote:
> >> Well - I did try using the AjaxSubmitLink, the validation happens during
> the
> >> link click and displays the error message..but even after the error
> message
> >> is shown, when I click the AjaxButton in the form, the form submit
> happens
> >> :-(
> >>
> >> Do I have to setDefaultFormProcessing(false) or something else I am
> getting
> >> wrong here?
> >>
> >> On Tue, Jun 9, 2009 at 4:42 PM, Igor Vaynberg <igor.vaynberg@gmail.com
> >wrote:
> >>
> >>> if you need to submit the form use ajaxsubmitlink, if you dont then
> >>> use the normal ajaxlink.
> >>>
> >>> -igor
> >>>
> >>> On Tue, Jun 9, 2009 at 7:39 AM, Jade<ja...@gmail.com> wrote:
> >>> > Hi Igor,
> >>> >
> >>> >  Yes, I did understand that after a deeper look. But for my use case,
> >>> which
> >>> > would a better one to use?
> >>> >
> >>> >  I cannot use a normal link as it would reload the screen and the
> >>> > modalwindow would vanish.
> >>> >
> >>> >  Please advise. Thanks for your time.
> >>> >
> >>> > Thanks,
> >>> > J
> >>> >
> >>> > On Tue, Jun 9, 2009 at 4:34 PM, Igor Vaynberg <
> igor.vaynberg@gmail.com
> >>> >wrote:
> >>> >
> >>> >> ajaxlink does not submit the form so no validation will happen and
> it
> >>> >> doesnt have an onsubmit method. you are mixing up ajaxlink,
> >>> >> ajaxsubmitlink, and ajaxbutton.
> >>> >>
> >>> >> -igor
> >>> >>
> >>> >> On Tue, Jun 9, 2009 at 2:30 AM, Jade<ja...@gmail.com> wrote:
> >>> >> > Hi all,
> >>> >> >
> >>> >> >  I am having a issue with AjaxLink and thought would get help from
> >>> you.
> >>> >> >
> >>> >> >  I have a modal window which has a form with two ajax links, few
> check
> >>> >> boxes
> >>> >> > and a AjaxButton.The check boxes are bound inside a list view.
> >>> >> >
> >>> >> >  Now, out of the two ajax links - one ajax link is for checking
> all
> >>> the
> >>> >> > check boxes and other is for unchecking all of them.
> >>> >> >
> >>> >> >  I also have validation added to the form to check at least one of
> the
> >>> >> check
> >>> >> > boxes is checked on submit. But the strange thing that happens is
> -
> >>> >> whenever
> >>> >> > the ajaxlink for none is clicked, the ajaxbutton's onSubmit  is
> not at
> >>> >> all
> >>> >> > called. And the validation does not happen in the form, which I
> came
> >>> to
> >>> >> know
> >>> >> > by eclipse debug sequence.
> >>> >> >
> >>> >> >  Am I doing something wrong here, I am still very much confused
> why
> >>> its
> >>> >> not
> >>> >> > called.
> >>> >> >
> >>> >> > Also, any advices for better implementation of the functionality
> would
> >>> be
> >>> >> of
> >>> >> > great help.
> >>> >> >
> >>> >> > Thanks,
> >>> >> > Jade
> >>> >> >
> >>> >>
> >>> >>
> ---------------------------------------------------------------------
> >>> >> 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
> >>>
> >>>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: AjaxLink and Form Validation

Posted by Igor Vaynberg <ig...@gmail.com>.
woops, i meant setdefaultformprocessing(FALSE)

-igor

On Tue, Jun 9, 2009 at 7:56 AM, Igor Vaynberg<ig...@gmail.com> wrote:
> onsubmit() is only called if validation passes or you called
> setdefaultformprocessing(true) on the button/submitlink.
>
> -igor
>
> On Tue, Jun 9, 2009 at 7:52 AM, Jade<ja...@gmail.com> wrote:
>> Well - I did try using the AjaxSubmitLink, the validation happens during the
>> link click and displays the error message..but even after the error message
>> is shown, when I click the AjaxButton in the form, the form submit happens
>> :-(
>>
>> Do I have to setDefaultFormProcessing(false) or something else I am getting
>> wrong here?
>>
>> On Tue, Jun 9, 2009 at 4:42 PM, Igor Vaynberg <ig...@gmail.com>wrote:
>>
>>> if you need to submit the form use ajaxsubmitlink, if you dont then
>>> use the normal ajaxlink.
>>>
>>> -igor
>>>
>>> On Tue, Jun 9, 2009 at 7:39 AM, Jade<ja...@gmail.com> wrote:
>>> > Hi Igor,
>>> >
>>> >  Yes, I did understand that after a deeper look. But for my use case,
>>> which
>>> > would a better one to use?
>>> >
>>> >  I cannot use a normal link as it would reload the screen and the
>>> > modalwindow would vanish.
>>> >
>>> >  Please advise. Thanks for your time.
>>> >
>>> > Thanks,
>>> > J
>>> >
>>> > On Tue, Jun 9, 2009 at 4:34 PM, Igor Vaynberg <igor.vaynberg@gmail.com
>>> >wrote:
>>> >
>>> >> ajaxlink does not submit the form so no validation will happen and it
>>> >> doesnt have an onsubmit method. you are mixing up ajaxlink,
>>> >> ajaxsubmitlink, and ajaxbutton.
>>> >>
>>> >> -igor
>>> >>
>>> >> On Tue, Jun 9, 2009 at 2:30 AM, Jade<ja...@gmail.com> wrote:
>>> >> > Hi all,
>>> >> >
>>> >> >  I am having a issue with AjaxLink and thought would get help from
>>> you.
>>> >> >
>>> >> >  I have a modal window which has a form with two ajax links, few check
>>> >> boxes
>>> >> > and a AjaxButton.The check boxes are bound inside a list view.
>>> >> >
>>> >> >  Now, out of the two ajax links - one ajax link is for checking all
>>> the
>>> >> > check boxes and other is for unchecking all of them.
>>> >> >
>>> >> >  I also have validation added to the form to check at least one of the
>>> >> check
>>> >> > boxes is checked on submit. But the strange thing that happens is -
>>> >> whenever
>>> >> > the ajaxlink for none is clicked, the ajaxbutton's onSubmit  is not at
>>> >> all
>>> >> > called. And the validation does not happen in the form, which I came
>>> to
>>> >> know
>>> >> > by eclipse debug sequence.
>>> >> >
>>> >> >  Am I doing something wrong here, I am still very much confused why
>>> its
>>> >> not
>>> >> > called.
>>> >> >
>>> >> > Also, any advices for better implementation of the functionality would
>>> be
>>> >> of
>>> >> > great help.
>>> >> >
>>> >> > Thanks,
>>> >> > Jade
>>> >> >
>>> >>
>>> >> ---------------------------------------------------------------------
>>> >> 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
>>>
>>>
>>
>

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


Re: AjaxLink and Form Validation

Posted by Igor Vaynberg <ig...@gmail.com>.
onsubmit() is only called if validation passes or you called
setdefaultformprocessing(true) on the button/submitlink.

-igor

On Tue, Jun 9, 2009 at 7:52 AM, Jade<ja...@gmail.com> wrote:
> Well - I did try using the AjaxSubmitLink, the validation happens during the
> link click and displays the error message..but even after the error message
> is shown, when I click the AjaxButton in the form, the form submit happens
> :-(
>
> Do I have to setDefaultFormProcessing(false) or something else I am getting
> wrong here?
>
> On Tue, Jun 9, 2009 at 4:42 PM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> if you need to submit the form use ajaxsubmitlink, if you dont then
>> use the normal ajaxlink.
>>
>> -igor
>>
>> On Tue, Jun 9, 2009 at 7:39 AM, Jade<ja...@gmail.com> wrote:
>> > Hi Igor,
>> >
>> >  Yes, I did understand that after a deeper look. But for my use case,
>> which
>> > would a better one to use?
>> >
>> >  I cannot use a normal link as it would reload the screen and the
>> > modalwindow would vanish.
>> >
>> >  Please advise. Thanks for your time.
>> >
>> > Thanks,
>> > J
>> >
>> > On Tue, Jun 9, 2009 at 4:34 PM, Igor Vaynberg <igor.vaynberg@gmail.com
>> >wrote:
>> >
>> >> ajaxlink does not submit the form so no validation will happen and it
>> >> doesnt have an onsubmit method. you are mixing up ajaxlink,
>> >> ajaxsubmitlink, and ajaxbutton.
>> >>
>> >> -igor
>> >>
>> >> On Tue, Jun 9, 2009 at 2:30 AM, Jade<ja...@gmail.com> wrote:
>> >> > Hi all,
>> >> >
>> >> >  I am having a issue with AjaxLink and thought would get help from
>> you.
>> >> >
>> >> >  I have a modal window which has a form with two ajax links, few check
>> >> boxes
>> >> > and a AjaxButton.The check boxes are bound inside a list view.
>> >> >
>> >> >  Now, out of the two ajax links - one ajax link is for checking all
>> the
>> >> > check boxes and other is for unchecking all of them.
>> >> >
>> >> >  I also have validation added to the form to check at least one of the
>> >> check
>> >> > boxes is checked on submit. But the strange thing that happens is -
>> >> whenever
>> >> > the ajaxlink for none is clicked, the ajaxbutton's onSubmit  is not at
>> >> all
>> >> > called. And the validation does not happen in the form, which I came
>> to
>> >> know
>> >> > by eclipse debug sequence.
>> >> >
>> >> >  Am I doing something wrong here, I am still very much confused why
>> its
>> >> not
>> >> > called.
>> >> >
>> >> > Also, any advices for better implementation of the functionality would
>> be
>> >> of
>> >> > great help.
>> >> >
>> >> > Thanks,
>> >> > Jade
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>>
>>
>

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


Re: AjaxLink and Form Validation

Posted by Jade <ja...@gmail.com>.
Well - I did try using the AjaxSubmitLink, the validation happens during the
link click and displays the error message..but even after the error message
is shown, when I click the AjaxButton in the form, the form submit happens
:-(

Do I have to setDefaultFormProcessing(false) or something else I am getting
wrong here?

On Tue, Jun 9, 2009 at 4:42 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> if you need to submit the form use ajaxsubmitlink, if you dont then
> use the normal ajaxlink.
>
> -igor
>
> On Tue, Jun 9, 2009 at 7:39 AM, Jade<ja...@gmail.com> wrote:
> > Hi Igor,
> >
> >  Yes, I did understand that after a deeper look. But for my use case,
> which
> > would a better one to use?
> >
> >  I cannot use a normal link as it would reload the screen and the
> > modalwindow would vanish.
> >
> >  Please advise. Thanks for your time.
> >
> > Thanks,
> > J
> >
> > On Tue, Jun 9, 2009 at 4:34 PM, Igor Vaynberg <igor.vaynberg@gmail.com
> >wrote:
> >
> >> ajaxlink does not submit the form so no validation will happen and it
> >> doesnt have an onsubmit method. you are mixing up ajaxlink,
> >> ajaxsubmitlink, and ajaxbutton.
> >>
> >> -igor
> >>
> >> On Tue, Jun 9, 2009 at 2:30 AM, Jade<ja...@gmail.com> wrote:
> >> > Hi all,
> >> >
> >> >  I am having a issue with AjaxLink and thought would get help from
> you.
> >> >
> >> >  I have a modal window which has a form with two ajax links, few check
> >> boxes
> >> > and a AjaxButton.The check boxes are bound inside a list view.
> >> >
> >> >  Now, out of the two ajax links - one ajax link is for checking all
> the
> >> > check boxes and other is for unchecking all of them.
> >> >
> >> >  I also have validation added to the form to check at least one of the
> >> check
> >> > boxes is checked on submit. But the strange thing that happens is -
> >> whenever
> >> > the ajaxlink for none is clicked, the ajaxbutton's onSubmit  is not at
> >> all
> >> > called. And the validation does not happen in the form, which I came
> to
> >> know
> >> > by eclipse debug sequence.
> >> >
> >> >  Am I doing something wrong here, I am still very much confused why
> its
> >> not
> >> > called.
> >> >
> >> > Also, any advices for better implementation of the functionality would
> be
> >> of
> >> > great help.
> >> >
> >> > Thanks,
> >> > Jade
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> 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: AjaxLink and Form Validation

Posted by Igor Vaynberg <ig...@gmail.com>.
if you need to submit the form use ajaxsubmitlink, if you dont then
use the normal ajaxlink.

-igor

On Tue, Jun 9, 2009 at 7:39 AM, Jade<ja...@gmail.com> wrote:
> Hi Igor,
>
>  Yes, I did understand that after a deeper look. But for my use case, which
> would a better one to use?
>
>  I cannot use a normal link as it would reload the screen and the
> modalwindow would vanish.
>
>  Please advise. Thanks for your time.
>
> Thanks,
> J
>
> On Tue, Jun 9, 2009 at 4:34 PM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> ajaxlink does not submit the form so no validation will happen and it
>> doesnt have an onsubmit method. you are mixing up ajaxlink,
>> ajaxsubmitlink, and ajaxbutton.
>>
>> -igor
>>
>> On Tue, Jun 9, 2009 at 2:30 AM, Jade<ja...@gmail.com> wrote:
>> > Hi all,
>> >
>> >  I am having a issue with AjaxLink and thought would get help from you.
>> >
>> >  I have a modal window which has a form with two ajax links, few check
>> boxes
>> > and a AjaxButton.The check boxes are bound inside a list view.
>> >
>> >  Now, out of the two ajax links - one ajax link is for checking all the
>> > check boxes and other is for unchecking all of them.
>> >
>> >  I also have validation added to the form to check at least one of the
>> check
>> > boxes is checked on submit. But the strange thing that happens is -
>> whenever
>> > the ajaxlink for none is clicked, the ajaxbutton's onSubmit  is not at
>> all
>> > called. And the validation does not happen in the form, which I came to
>> know
>> > by eclipse debug sequence.
>> >
>> >  Am I doing something wrong here, I am still very much confused why its
>> not
>> > called.
>> >
>> > Also, any advices for better implementation of the functionality would be
>> of
>> > great help.
>> >
>> > Thanks,
>> > Jade
>> >
>>
>> ---------------------------------------------------------------------
>> 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: AjaxLink and Form Validation

Posted by Jade <ja...@gmail.com>.
Hi Igor,

 Yes, I did understand that after a deeper look. But for my use case, which
would a better one to use?

 I cannot use a normal link as it would reload the screen and the
modalwindow would vanish.

 Please advise. Thanks for your time.

Thanks,
J

On Tue, Jun 9, 2009 at 4:34 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> ajaxlink does not submit the form so no validation will happen and it
> doesnt have an onsubmit method. you are mixing up ajaxlink,
> ajaxsubmitlink, and ajaxbutton.
>
> -igor
>
> On Tue, Jun 9, 2009 at 2:30 AM, Jade<ja...@gmail.com> wrote:
> > Hi all,
> >
> >  I am having a issue with AjaxLink and thought would get help from you.
> >
> >  I have a modal window which has a form with two ajax links, few check
> boxes
> > and a AjaxButton.The check boxes are bound inside a list view.
> >
> >  Now, out of the two ajax links - one ajax link is for checking all the
> > check boxes and other is for unchecking all of them.
> >
> >  I also have validation added to the form to check at least one of the
> check
> > boxes is checked on submit. But the strange thing that happens is -
> whenever
> > the ajaxlink for none is clicked, the ajaxbutton's onSubmit  is not at
> all
> > called. And the validation does not happen in the form, which I came to
> know
> > by eclipse debug sequence.
> >
> >  Am I doing something wrong here, I am still very much confused why its
> not
> > called.
> >
> > Also, any advices for better implementation of the functionality would be
> of
> > great help.
> >
> > Thanks,
> > Jade
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: AjaxLink and Form Validation

Posted by Igor Vaynberg <ig...@gmail.com>.
ajaxlink does not submit the form so no validation will happen and it
doesnt have an onsubmit method. you are mixing up ajaxlink,
ajaxsubmitlink, and ajaxbutton.

-igor

On Tue, Jun 9, 2009 at 2:30 AM, Jade<ja...@gmail.com> wrote:
> Hi all,
>
>  I am having a issue with AjaxLink and thought would get help from you.
>
>  I have a modal window which has a form with two ajax links, few check boxes
> and a AjaxButton.The check boxes are bound inside a list view.
>
>  Now, out of the two ajax links - one ajax link is for checking all the
> check boxes and other is for unchecking all of them.
>
>  I also have validation added to the form to check at least one of the check
> boxes is checked on submit. But the strange thing that happens is - whenever
> the ajaxlink for none is clicked, the ajaxbutton's onSubmit  is not at all
> called. And the validation does not happen in the form, which I came to know
> by eclipse debug sequence.
>
>  Am I doing something wrong here, I am still very much confused why its not
> called.
>
> Also, any advices for better implementation of the functionality would be of
> great help.
>
> Thanks,
> Jade
>

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


AjaxLink and Form Validation

Posted by Jade <ja...@gmail.com>.
Hi all,

 I am having a issue with AjaxLink and thought would get help from you.

 I have a modal window which has a form with two ajax links, few check boxes
and a AjaxButton.The check boxes are bound inside a list view.

 Now, out of the two ajax links - one ajax link is for checking all the
check boxes and other is for unchecking all of them.

 I also have validation added to the form to check at least one of the check
boxes is checked on submit. But the strange thing that happens is - whenever
the ajaxlink for none is clicked, the ajaxbutton's onSubmit  is not at all
called. And the validation does not happen in the form, which I came to know
by eclipse debug sequence.

 Am I doing something wrong here, I am still very much confused why its not
called.

Also, any advices for better implementation of the functionality would be of
great help.

Thanks,
Jade