You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by SantiagoA <s....@gmx.de> on 2007/12/06 13:13:50 UTC

Ajax Feedback Problem in 1.3

Hi,
I have a "FeedbackTextField" which extends TextField and implements
IValidator (build with 1.2.5).
If the textfield lose the focus, an Ajax call is submitted. The Validator
looks if the textfield is left empty and throws a FeedbackMessage and the
backgroundcolor of the TextField changes to yellow.
First everything works as suspected.

Then I changed the version to 1.3beta3.
>From that moment, there was no longer an AjaxCall when the TextField lost
the Focus when its  empty, if it wasn´t empty Ajax call worked fine.
So the backgroundcolor didn´t change and the FeedbackMessage was not
displayed until a formSubmit was called( by a button, e.g.). On a form
submit, the feedbackMessage works correctly, and the Color changes.

Then I changed to 1.3rc1
Now the same happens like 1.3beta3 (ajax + feedback problem), but on form
submit, the feedbackMessage works, but the color does not change anymore for
any reason.

I guess the validator prevents the ajax call, but why does the color doesn´t
change anymore.

thanks in advance,

Santiago
-- 
View this message in context: http://www.nabble.com/Ajax-Feedback-Problem-in-1.3-tf4955701.html#a14191234
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: Ajax Feedback Problem in 1.3

Posted by SantiagoA <s....@gmx.de>.
Done.

https://issues.apache.org/jira/browse/WICKET-1325
-- 
View this message in context: http://www.nabble.com/Ajax-Feedback-Problem-in-1.3-tp14191234p15331770.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: Ajax Feedback Problem in 1.3

Posted by Johan Compagner <jc...@gmail.com>.
can't you attach those to a jira issue. Then it is not getting lost.



On Feb 6, 2008 8:16 AM, SantiagoA <s....@gmx.de> wrote:

>
> http://www.nabble.com/file/p15306186/ValidationTest1.iamzip
> ValidationTest1.iamzip
> http://www.nabble.com/file/p15306186/ValidationTest2.iamzip
> ValidationTest2.iamzip
>
> Sorry, have to make two zips, ´cause packed to one file was too big to
> upload.
>
> Ok.
> ValidationTest1 runs with wicket 1.3.0 final and ValidationTest2 with the
> old 1.2.6 .
>
> Thanks for taking a look,
> Santiago
>
>
> rename your foo.zip to foo.iamzip and attach it to the email.
>
> -igor
>
>
> --
> View this message in context:
> http://www.nabble.com/Ajax-Feedback-Problem-in-1.3-tp14191234p15306186.html
>  Sent from the Wicket - User mailing list archive at Nabble.com<http://nabble.com/>
> .
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Ajax Feedback Problem in 1.3

Posted by SantiagoA <s....@gmx.de>.
http://www.nabble.com/file/p15306186/ValidationTest1.iamzip
ValidationTest1.iamzip 
http://www.nabble.com/file/p15306186/ValidationTest2.iamzip
ValidationTest2.iamzip 

Sorry, have to make two zips, ´cause packed to one file was too big to
upload.

Ok. 
ValidationTest1 runs with wicket 1.3.0 final and ValidationTest2 with the
old 1.2.6 .

Thanks for taking a look,
Santiago


rename your foo.zip to foo.iamzip and attach it to the email.

-igor


-- 
View this message in context: http://www.nabble.com/Ajax-Feedback-Problem-in-1.3-tp14191234p15306186.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: Ajax Feedback Problem in 1.3

Posted by SantiagoA <s....@gmx.de>.

Okay.
I made a jira issue and attach one zipfile with both examples.
JIRA-Issue WICKET-1325
Hope that works. Never worked with jira before.
-


rename your foo.zip to foo.iamzip and attach it to the email.

-igor

-- 
View this message in context: http://www.nabble.com/Ajax-Feedback-Problem-in-1.3-tp14191234p15306477.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: Ajax Feedback Problem in 1.3

Posted by Igor Vaynberg <ig...@gmail.com>.
rename your foo.zip to foo.iamzip and attach it to the email.

-igor


On Feb 4, 2008 3:48 AM, SantiagoA <s....@gmx.de> wrote:
>
> Hi again,
>
> I made a little example project with eclipse where you could take a look at
> the problem, because maybe my english is not good enough to explain right.
> Is there a possibility that I can send you the example as a zip-file?
> I made to little examples, one running with the 1.3.0 final version, one
> with the 1.2.6 version.
>
> thanks again for your time,
> Santiago
> --
> View this message in context: http://www.nabble.com/Ajax-Feedback-Problem-in-1.3-tp14191234p15266481.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


Re: Ajax Feedback Problem in 1.3

Posted by SantiagoA <s....@gmx.de>.
Hi again,

I made a little example project with eclipse where you could take a look at
the problem, because maybe my english is not good enough to explain right.
Is there a possibility that I can send you the example as a zip-file?
I made to little examples, one running with the 1.3.0 final version, one
with the 1.2.6 version.

thanks again for your time,
Santiago
-- 
View this message in context: http://www.nabble.com/Ajax-Feedback-Problem-in-1.3-tp14191234p15266481.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: Ajax Feedback Problem in 1.3

Posted by Johan Compagner <jc...@gmail.com>.
onUpdate or onError are always called, also is validators are causing the
component to be invalid:

*

try
*

{

formComponent.inputChanged();

formComponent.validate();

*if* (formComponent.hasErrorMessage())

{

formComponent.invalid();

onError(target, *null*);

}

*else
*

{

formComponent.valid();

*if* (getUpdateModel())

{

formComponent.updateModel();

}

onUpdate(target);

}

}

*catch* (RuntimeException e)

{

onError(target, e);

}

So if an exception or an validations fails -> onError() is called
else onUpdate().
This is a change from 1.2 i think. There onUpdate was always called, also
for validation failures and onError was only called on exceptions (which
don't happen that much)

johan





On Dec 20, 2007 9:04 AM, SantiagoA <s....@gmx.de> wrote:

>
> As long as setRequired(true), nope. That was what I meant with Validators
> block Ajax(onUpdate).
>
> For now I make the validation on my own in onUpdate and set
> setRequired(false) on the Component. This works for now, but it seems to
> me
> that working with the Wicket-Validators would be the better, cleaner way.
>
> Thanks for sharing your time,
> and btw
> Wicket is nevertheless a great framework and you guys do a great job on
> that.
> -Santiago
>
>
> igor.vaynberg wrote:
> >
> > is onupdate called?
> >
> > -igor
> >
> >
> > On Dec 19, 2007 12:34 AM, SantiagoA <s....@gmx.de> wrote:
> >>
> >> No exceptions in the console. Debug shows that the onError() is never
> >> called.
> >>
> >> -Santiago
> >>
> >>
> >>
> >> igor.vaynberg wrote:
> >> >
> >> > any exceptions in the log/console? seems pretty damn strange to me.
> >> > can you verify onerror() is being called on the ajax behavior?
> >> >
> >> > -igor
> >> >
> >> >
> >> > On Dec 18, 2007 11:27 PM, SantiagoA <s....@gmx.de> wrote:
> >> >>
> >> >> Thanks for the answer, but that doesn´t work either.
> >> >> It´s a bit strange, but if I set the component to be required, the
> >> >> feedbackPanel will not be rendered.
> >> >> If I make the validation in
> >> >>       protected void onUpdate(AjaxRequestTarget target){
> >> >> like
> >> >>         if(vwd == null)
> >> >>                 vwdComponent.error(vwdErrorMessage);
> >> >>      }
> >> >> and set the component to not required, the feedbackPanel shows up.
> >> >> Is there another way, where I can use the setRequired-method and the
> >> >> NumberValidator and nevertheless the AjaxCall won´t get blocked or
> the
> >> >> feedbackPanel gets rendered immediately?
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> igor.vaynberg wrote:
> >> >> >
> >> >> > On Dec 18, 2007 1:25 AM, SantiagoA <s....@gmx.de> wrote:
> >> >> >>
> >> >> >>     vwdComponent.add(new
> >> AjaxFormComponentUpdatingBehavior("onblur"){
> >> >> >>       private static final long serialVersionUID =
> >> >> 4932149086847602955L;
> >> >> >>       @Override
> >> >> >>       protected void onUpdate(AjaxRequestTarget target){
> >> >> >>         log.debug("VWD-Ajax Update");
> >> >> >>         if (vwd > 0) {
> >> >> >>                        // Here are some calculations
> >> >> >>         }
> >> >> >>        target.addComponent(myOutDate);
> >> >> >>        target.addComponent(vwdComponent);
> >> >> >>        target.addComponent(myFeedbackPanel);
> >> >> >>        target.addComponent(myForm);
> >> >> >>       }
> >> >> >
> >> >> >         protected void onError(AjaxRequestTarget target ){
> >> >> >             target.addComponent(myFeedbackPanel);
> >> >> >         }
> >> >> >
> >> >> >
> >> >> >
> >> >> > -igor
> >> >> >
> >> >> >
> >> ---------------------------------------------------------------------
> >> >> > 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/Ajax-Feedback-Problem-in-1.3-tp14191234p14412309.html
> >> >>
> >> >> Sent from the Wicket - User mailing list archive at Nabble.com<http://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/Ajax-Feedback-Problem-in-1.3-tp14191234p14412962.html
> >>
> >> Sent from the Wicket - User mailing list archive at Nabble.com<http://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/Ajax-Feedback-Problem-in-1.3-tp14191234p14432230.html
>  Sent from the Wicket - User mailing list archive at Nabble.com<http://nabble.com/>
> .
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Ajax Feedback Problem in 1.3

Posted by SantiagoA <s....@gmx.de>.
As long as setRequired(true), nope. That was what I meant with Validators
block Ajax(onUpdate).

For now I make the validation on my own in onUpdate and set
setRequired(false) on the Component. This works for now, but it seems to me
that working with the Wicket-Validators would be the better, cleaner way.

Thanks for sharing your time,
and btw 
Wicket is nevertheless a great framework and you guys do a great job on
that.
-Santiago


igor.vaynberg wrote:
> 
> is onupdate called?
> 
> -igor
> 
> 
> On Dec 19, 2007 12:34 AM, SantiagoA <s....@gmx.de> wrote:
>>
>> No exceptions in the console. Debug shows that the onError() is never
>> called.
>>
>> -Santiago
>>
>>
>>
>> igor.vaynberg wrote:
>> >
>> > any exceptions in the log/console? seems pretty damn strange to me.
>> > can you verify onerror() is being called on the ajax behavior?
>> >
>> > -igor
>> >
>> >
>> > On Dec 18, 2007 11:27 PM, SantiagoA <s....@gmx.de> wrote:
>> >>
>> >> Thanks for the answer, but that doesn´t work either.
>> >> It´s a bit strange, but if I set the component to be required, the
>> >> feedbackPanel will not be rendered.
>> >> If I make the validation in
>> >>       protected void onUpdate(AjaxRequestTarget target){
>> >> like
>> >>         if(vwd == null)
>> >>                 vwdComponent.error(vwdErrorMessage);
>> >>      }
>> >> and set the component to not required, the feedbackPanel shows up.
>> >> Is there another way, where I can use the setRequired-method and the
>> >> NumberValidator and nevertheless the AjaxCall won´t get blocked or the
>> >> feedbackPanel gets rendered immediately?
>> >>
>> >>
>> >>
>> >>
>> >> igor.vaynberg wrote:
>> >> >
>> >> > On Dec 18, 2007 1:25 AM, SantiagoA <s....@gmx.de> wrote:
>> >> >>
>> >> >>     vwdComponent.add(new
>> AjaxFormComponentUpdatingBehavior("onblur"){
>> >> >>       private static final long serialVersionUID =
>> >> 4932149086847602955L;
>> >> >>       @Override
>> >> >>       protected void onUpdate(AjaxRequestTarget target){
>> >> >>         log.debug("VWD-Ajax Update");
>> >> >>         if (vwd > 0) {
>> >> >>                        // Here are some calculations
>> >> >>         }
>> >> >>        target.addComponent(myOutDate);
>> >> >>        target.addComponent(vwdComponent);
>> >> >>        target.addComponent(myFeedbackPanel);
>> >> >>        target.addComponent(myForm);
>> >> >>       }
>> >> >
>> >> >         protected void onError(AjaxRequestTarget target ){
>> >> >             target.addComponent(myFeedbackPanel);
>> >> >         }
>> >> >
>> >> >
>> >> >
>> >> > -igor
>> >> >
>> >> >
>> ---------------------------------------------------------------------
>> >> > 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/Ajax-Feedback-Problem-in-1.3-tp14191234p14412309.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/Ajax-Feedback-Problem-in-1.3-tp14191234p14412962.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/Ajax-Feedback-Problem-in-1.3-tp14191234p14432230.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: Ajax Feedback Problem in 1.3

Posted by Igor Vaynberg <ig...@gmail.com>.
is onupdate called?

-igor


On Dec 19, 2007 12:34 AM, SantiagoA <s....@gmx.de> wrote:
>
> No exceptions in the console. Debug shows that the onError() is never called.
>
> -Santiago
>
>
>
> igor.vaynberg wrote:
> >
> > any exceptions in the log/console? seems pretty damn strange to me.
> > can you verify onerror() is being called on the ajax behavior?
> >
> > -igor
> >
> >
> > On Dec 18, 2007 11:27 PM, SantiagoA <s....@gmx.de> wrote:
> >>
> >> Thanks for the answer, but that doesn´t work either.
> >> It´s a bit strange, but if I set the component to be required, the
> >> feedbackPanel will not be rendered.
> >> If I make the validation in
> >>       protected void onUpdate(AjaxRequestTarget target){
> >> like
> >>         if(vwd == null)
> >>                 vwdComponent.error(vwdErrorMessage);
> >>      }
> >> and set the component to not required, the feedbackPanel shows up.
> >> Is there another way, where I can use the setRequired-method and the
> >> NumberValidator and nevertheless the AjaxCall won´t get blocked or the
> >> feedbackPanel gets rendered immediately?
> >>
> >>
> >>
> >>
> >> igor.vaynberg wrote:
> >> >
> >> > On Dec 18, 2007 1:25 AM, SantiagoA <s....@gmx.de> wrote:
> >> >>
> >> >>     vwdComponent.add(new AjaxFormComponentUpdatingBehavior("onblur"){
> >> >>       private static final long serialVersionUID =
> >> 4932149086847602955L;
> >> >>       @Override
> >> >>       protected void onUpdate(AjaxRequestTarget target){
> >> >>         log.debug("VWD-Ajax Update");
> >> >>         if (vwd > 0) {
> >> >>                        // Here are some calculations
> >> >>         }
> >> >>        target.addComponent(myOutDate);
> >> >>        target.addComponent(vwdComponent);
> >> >>        target.addComponent(myFeedbackPanel);
> >> >>        target.addComponent(myForm);
> >> >>       }
> >> >
> >> >         protected void onError(AjaxRequestTarget target ){
> >> >             target.addComponent(myFeedbackPanel);
> >> >         }
> >> >
> >> >
> >> >
> >> > -igor
> >> >
> >> > ---------------------------------------------------------------------
> >> > 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/Ajax-Feedback-Problem-in-1.3-tp14191234p14412309.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/Ajax-Feedback-Problem-in-1.3-tp14191234p14412962.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


Re: Ajax Feedback Problem in 1.3

Posted by SantiagoA <s....@gmx.de>.
No exceptions in the console. Debug shows that the onError() is never called.

-Santiago


igor.vaynberg wrote:
> 
> any exceptions in the log/console? seems pretty damn strange to me.
> can you verify onerror() is being called on the ajax behavior?
> 
> -igor
> 
> 
> On Dec 18, 2007 11:27 PM, SantiagoA <s....@gmx.de> wrote:
>>
>> Thanks for the answer, but that doesn´t work either.
>> It´s a bit strange, but if I set the component to be required, the
>> feedbackPanel will not be rendered.
>> If I make the validation in
>>       protected void onUpdate(AjaxRequestTarget target){
>> like
>>         if(vwd == null)
>>                 vwdComponent.error(vwdErrorMessage);
>>      }
>> and set the component to not required, the feedbackPanel shows up.
>> Is there another way, where I can use the setRequired-method and the
>> NumberValidator and nevertheless the AjaxCall won´t get blocked or the
>> feedbackPanel gets rendered immediately?
>>
>>
>>
>>
>> igor.vaynberg wrote:
>> >
>> > On Dec 18, 2007 1:25 AM, SantiagoA <s....@gmx.de> wrote:
>> >>
>> >>     vwdComponent.add(new AjaxFormComponentUpdatingBehavior("onblur"){
>> >>       private static final long serialVersionUID =
>> 4932149086847602955L;
>> >>       @Override
>> >>       protected void onUpdate(AjaxRequestTarget target){
>> >>         log.debug("VWD-Ajax Update");
>> >>         if (vwd > 0) {
>> >>                        // Here are some calculations
>> >>         }
>> >>        target.addComponent(myOutDate);
>> >>        target.addComponent(vwdComponent);
>> >>        target.addComponent(myFeedbackPanel);
>> >>        target.addComponent(myForm);
>> >>       }
>> >
>> >         protected void onError(AjaxRequestTarget target ){
>> >             target.addComponent(myFeedbackPanel);
>> >         }
>> >
>> >
>> >
>> > -igor
>> >
>> > ---------------------------------------------------------------------
>> > 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/Ajax-Feedback-Problem-in-1.3-tp14191234p14412309.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/Ajax-Feedback-Problem-in-1.3-tp14191234p14412962.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: Ajax Feedback Problem in 1.3

Posted by Igor Vaynberg <ig...@gmail.com>.
any exceptions in the log/console? seems pretty damn strange to me.
can you verify onerror() is being called on the ajax behavior?

-igor


On Dec 18, 2007 11:27 PM, SantiagoA <s....@gmx.de> wrote:
>
> Thanks for the answer, but that doesn´t work either.
> It´s a bit strange, but if I set the component to be required, the
> feedbackPanel will not be rendered.
> If I make the validation in
>       protected void onUpdate(AjaxRequestTarget target){
> like
>         if(vwd == null)
>                 vwdComponent.error(vwdErrorMessage);
>      }
> and set the component to not required, the feedbackPanel shows up.
> Is there another way, where I can use the setRequired-method and the
> NumberValidator and nevertheless the AjaxCall won´t get blocked or the
> feedbackPanel gets rendered immediately?
>
>
>
>
> igor.vaynberg wrote:
> >
> > On Dec 18, 2007 1:25 AM, SantiagoA <s....@gmx.de> wrote:
> >>
> >>     vwdComponent.add(new AjaxFormComponentUpdatingBehavior("onblur"){
> >>       private static final long serialVersionUID = 4932149086847602955L;
> >>       @Override
> >>       protected void onUpdate(AjaxRequestTarget target){
> >>         log.debug("VWD-Ajax Update");
> >>         if (vwd > 0) {
> >>                        // Here are some calculations
> >>         }
> >>        target.addComponent(myOutDate);
> >>        target.addComponent(vwdComponent);
> >>        target.addComponent(myFeedbackPanel);
> >>        target.addComponent(myForm);
> >>       }
> >
> >         protected void onError(AjaxRequestTarget target ){
> >             target.addComponent(myFeedbackPanel);
> >         }
> >
> >
> >
> > -igor
> >
> > ---------------------------------------------------------------------
> > 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/Ajax-Feedback-Problem-in-1.3-tp14191234p14412309.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


Re: Ajax Feedback Problem in 1.3

Posted by SantiagoA <s....@gmx.de>.
Thanks for the answer, but that doesn´t work either.
It´s a bit strange, but if I set the component to be required, the
feedbackPanel will not be rendered. 
If I make the validation in 
      protected void onUpdate(AjaxRequestTarget target){
like
        if(vwd == null)
        	vwdComponent.error(vwdErrorMessage);
     }
and set the component to not required, the feedbackPanel shows up.
Is there another way, where I can use the setRequired-method and the
NumberValidator and nevertheless the AjaxCall won´t get blocked or the
feedbackPanel gets rendered immediately?



igor.vaynberg wrote:
> 
> On Dec 18, 2007 1:25 AM, SantiagoA <s....@gmx.de> wrote:
>>
>>     vwdComponent.add(new AjaxFormComponentUpdatingBehavior("onblur"){
>>       private static final long serialVersionUID = 4932149086847602955L;
>>       @Override
>>       protected void onUpdate(AjaxRequestTarget target){
>>         log.debug("VWD-Ajax Update");
>>         if (vwd > 0) {
>>                        // Here are some calculations
>>         }
>>        target.addComponent(myOutDate);
>>        target.addComponent(vwdComponent);
>>        target.addComponent(myFeedbackPanel);
>>        target.addComponent(myForm);
>>       }
> 
>         protected void onError(AjaxRequestTarget target ){
>             target.addComponent(myFeedbackPanel);
>         }
> 
> 
> 
> -igor
> 
> ---------------------------------------------------------------------
> 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/Ajax-Feedback-Problem-in-1.3-tp14191234p14412309.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: Ajax Feedback Problem in 1.3

Posted by Igor Vaynberg <ig...@gmail.com>.
On Dec 18, 2007 1:25 AM, SantiagoA <s....@gmx.de> wrote:
>
>     vwdComponent.add(new AjaxFormComponentUpdatingBehavior("onblur"){
>       private static final long serialVersionUID = 4932149086847602955L;
>       @Override
>       protected void onUpdate(AjaxRequestTarget target){
>         log.debug("VWD-Ajax Update");
>         if (vwd > 0) {
>                        // Here are some calculations
>         }
>        target.addComponent(myOutDate);
>        target.addComponent(vwdComponent);
>        target.addComponent(myFeedbackPanel);
>        target.addComponent(myForm);
>       }

        protected void onError(AjaxRequestTarget target ){
            target.addComponent(myFeedbackPanel);
        }



-igor

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


Re: Ajax Feedback Problem in 1.3

Posted by SantiagoA <s....@gmx.de>.
Hi again.
Here are some Code snippets:

***this TextField extends TextField and implements IFeedback to change the
backgroundcolor of the TextField when an error occurres***
    final FeedbackTextField vwdComponent = new FeedbackTextField("vwd");

    vwdComponent.setRequired(true); 
    vwdComponent.setType(Integer.class);
    vwdComponent.add(NumberValidator.minimum(1));
    vwdComponent.setOutputMarkupId(true);

***this one makes an AjaxCall when the TextField lose the Focus(by pressing
enter or tab)***
    vwdComponent.add(new EnterAsTabBehavior());

*** Then I added some AjaxBehavior ***

    vwdComponent.add(new AjaxFormComponentUpdatingBehavior("onblur"){
      private static final long serialVersionUID = 4932149086847602955L;
      @Override
      protected void onUpdate(AjaxRequestTarget target){
        log.debug("VWD-Ajax Update");
        if (vwd > 0) {
                       // Here are some calculations
        }       
       target.addComponent(myOutDate);
       target.addComponent(vwdComponent);
       target.addComponent(myFeedbackPanel);
       target.addComponent(myForm);
      }

By now, I found out, that the setRequired-method and the NumberValidator
blocks the onUpdate-Methode (what I think is expected), but the thrown
Exceptions (from the validators) don´t activate the feedbackPanel to get
redrawn and the validation implemented to the textField won´t change the
backgroundcolor, too.
While working with Wicket Version 1.2.6 the feedbackPanel receives the
Exception-messages and gets rendered (and the backgroundColor changes),
working with 1.3 (beta3, beta4, rc1 and rc2), the feedbackPanel will not be
rendered and the color won´t be changed.

Is there a way to get the feedbackPanel to be redrawn, when any validator
throws an exception?
Especially when the validation-action happens in its own class, without the
knowledge which page is active at the moment, just as a return to that page
which 'made' the call?

thanks for spending the time on that,
Santiago




Martijn Dashorst wrote:
> 
> We need some code to go with your problem to correctly diagnose your
> problem.
> Martijn
> 
> On Dec 6, 2007 1:13 PM, SantiagoA <s....@gmx.de> wrote:
> 
>>
>> Hi,
>> I have a "FeedbackTextField" which extends TextField and implements
>> IValidator (build with 1.2.5).
>> If the textfield lose the focus, an Ajax call is submitted. The Validator
>> looks if the textfield is left empty and throws a FeedbackMessage and the
>> backgroundcolor of the TextField changes to yellow.
>> First everything works as suspected.
>>
>> Then I changed the version to 1.3beta3.
>> From that moment, there was no longer an AjaxCall when the TextField lost
>> the Focus when its  empty, if it wasn´t empty Ajax call worked fine.
>> So the backgroundcolor didn´t change and the FeedbackMessage was not
>> displayed until a formSubmit was called( by a button, e.g.). On a form
>> submit, the feedbackMessage works correctly, and the Color changes.
>>
>> Then I changed to 1.3rc1
>> Now the same happens like 1.3beta3 (ajax + feedback problem), but on form
>> submit, the feedbackMessage works, but the color does not change anymore
>> for
>> any reason.
>>
>> I guess the validator prevents the ajax call, but why does the color
>> doesn´t
>> change anymore.
>>
>> thanks in advance,
>>
>> Santiago
>> --
>> View this message in context:
>> http://www.nabble.com/Ajax-Feedback-Problem-in-1.3-tf4955701.html#a14191234
>> 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
>>
>>
> 
> 
> -- 
> Buy Wicket in Action: http://manning.com/dashorst
> Apache Wicket 1.3.0-rc1 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/
> 
> 

-- 
View this message in context: http://www.nabble.com/Ajax-Feedback-Problem-in-1.3-tp14191234p14387671.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: Ajax Feedback Problem in 1.3

Posted by Martijn Dashorst <ma...@gmail.com>.
We need some code to go with your problem to correctly diagnose your
problem.
Martijn

On Dec 6, 2007 1:13 PM, SantiagoA <s....@gmx.de> wrote:

>
> Hi,
> I have a "FeedbackTextField" which extends TextField and implements
> IValidator (build with 1.2.5).
> If the textfield lose the focus, an Ajax call is submitted. The Validator
> looks if the textfield is left empty and throws a FeedbackMessage and the
> backgroundcolor of the TextField changes to yellow.
> First everything works as suspected.
>
> Then I changed the version to 1.3beta3.
> From that moment, there was no longer an AjaxCall when the TextField lost
> the Focus when its  empty, if it wasn´t empty Ajax call worked fine.
> So the backgroundcolor didn´t change and the FeedbackMessage was not
> displayed until a formSubmit was called( by a button, e.g.). On a form
> submit, the feedbackMessage works correctly, and the Color changes.
>
> Then I changed to 1.3rc1
> Now the same happens like 1.3beta3 (ajax + feedback problem), but on form
> submit, the feedbackMessage works, but the color does not change anymore
> for
> any reason.
>
> I guess the validator prevents the ajax call, but why does the color
> doesn´t
> change anymore.
>
> thanks in advance,
>
> Santiago
> --
> View this message in context:
> http://www.nabble.com/Ajax-Feedback-Problem-in-1.3-tf4955701.html#a14191234
> 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
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-rc1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/