ivan
(ivan bolcina)
October 5, 2009, 8:29am
1
Hi.
I am experiencing strange behaviour on component, when I set error in this was
void do()
{
…
component1.setComponentError(null);
…
…
if (erroroccured) component1.setComponentError(someError);
…
}
the component doesnt have error,however, when I refresh window (via browser) error appears…
I suspect that vaadin sends only first “event” (like set error to null) to client, and ignores second call.
changing method to
void do()
{
…
…
…
if (erroroccured) component1.setComponentError(someError); else component1.setComponentError(null);
…
}
works fine. However, my recepy for error indicators was allways to clean up everything, and then turn them on case by case
bye,ivan
This sounds strange - the first case should work too. Could you give a complete test case for it and create bug report?
ivan
(ivan bolcina)
October 6, 2009, 5:53pm
3
Thanks for response.
I am still trying to find out what exactly went wrong. As far as I was able to diagnose, removing setImmediate did the trick.
However, I believe that nomater what (with immediate or not) the picture should be the same before and after refresh button.
But, Vaadin rocks, and this little bugs I can live with.
bye,ivan
Marc
(Marc Englund)
October 6, 2009, 8:55pm
4
Hi,
Have you by any chance done the above in a Validator?
I’m asking because Validators can not make changes to the UI as a side-effect, and doing so might cause strange results, like the ones you describe.
http://vaadin.com/api/com/vaadin/data/Validator.html
The reason for this is that the Validators can be called in the paint-phase, and any changes to the UI at that point will (usually) not make it to the client - it’s ‘too late’, and doing so is likely to cause strange behavior.
Best Regards,
Marc
ivan
(ivan bolcina)
October 14, 2009, 7:20am
5
No, I am not using validators.
It turned out that problem was with layouting.
I have something like
Label1: Text1 Label2: Text2.
increasing space between Text1 and label2 provided enought space for indicator
Thanks!