Menu

#3 StyleAction removed styles added to non customObjects

open
None
5
2009-11-24
2009-11-23
Anonymous
No

When adding a StyleAction("add", "remove", customObject) to a MultiStringsEqualsValidator(object1, object2), and calling validator.validate() twice (with error condition), the "remove" style is added to the object1 and object2.

Discussion

  • Anatol Mayen

    Anatol Mayen - 2009-11-24

    I will have a look at it these days

     
  • Anatol Mayen

    Anatol Mayen - 2009-11-24
    • assigned_to: nobody --> amayen
     
  • Anonymous

    Anonymous - 2009-11-24

    I think here's the mistake (I copy from ValidationAction<O> class):

    * This method should be used by <code>MultiFieldValidators</code> to
    * reset an action that was used on more than one <code>UIObject</code>.
    *
    * So every action that wants to support MultiField validators should
    * implement this method
    *
    */
    public void reset(UIObject o) {
    }

    The only thing that the actions must do to support the MultiField validators, is apply the reset() code to all the objects passed to the invoke method, if necessary, or the customObjects if they exist.
    So, the ValidationAction<O> class shoud only have the public abstract void invoke(ValidationResult result, O object) and the public void reset() methods.
    I'll try to send a patch later.

     
  • Anatol Mayen

    Anatol Mayen - 2009-11-29

    Hi! I've uploaded a snapshot release with some modifications for the StyleAction. But I was not able to reproduce your problem. Anyway in your code example it looks like you are trying to omit the fields for adding/removing styles that are given to the MultiStringsEqualsValidator and instead only want them to be applied to the customObject given to the StyleAction constructor? Is that what you want to do? If you want that thats fine, but if you instead want object1 and object2 to be styled you need to omit the customObject parameter of the StyleAction.

    I have uploaded the snapshot with some fixes to the homepage:
    http://gwt-vl.sourceforge.net/?to=resources

    Please download it and tell me if it fixes your problem. If it doesn't please give me the sourcecode which shows the behaviour you are describing.

    Kind regards, Anatol

     

Log in to post a comment.