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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]