Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    For ValidatorType ISUNIQUE, how to specify criteriaFields from the client

    Hi there,

    In a server-side DataSource descriptor (.ds.xml file) I can successfully specify criteriaFields for an ISUNIQUE ValidatorType.

    However, I need to be able to dynamically switch between different criteriaFields from the client side, but I cannot find any client side api to set the criteriaFields property on a Validator:

    Code:
    ListGridField listGridField = new ListGridField("Name");
    
    Validator validator = new Validator();
    validator.setType(ValidatorType.ISUNIQUE);
    // HOW TO SET criteriaFields ???
    
    listGridField.setValidators(validator);

    #2
    If you were able to set the criteria fields from the client, you could bypass the validator, creating a security hole.

    You could implement a type:"serverCustom" validator that uses different sets of criteria fields in different circumstances - just be sure to think carefully about security.

    If you are just trying to determine uniqueness from the client-side, just use DataSource.fetchData().

    Comment


      #3
      Thank you, I've implemented a type:"serverCustom" validator and was able to accomplish what I needed.

      Comment

      Working...
      X