Announcement

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

    How to perform validation explicitely in ListGrid

    Hi,

    I have a ListGrid control. I don't want to use validation on cell change (setValidateOnChange(false)). Once I do that, how can I force the validators hooked to each ListGridField to run on each column?

    Regards,
    Maxime

    #2
    See ListGrid.setValidateByCell().

    Comment


      #3
      Here is the documentation of ListGrid.setValidateByCell:

      Code:
      public void setValidateByCell(java.lang.Boolean validateByCell)
      
          Whether client-side validation checks should be performed when the user moves between cells in the current edit row. If unset, defaults to editByCell.
          Note that if false validation occurs on row-transition rather than cell transitions. Validation also always occurs when a row is to be saved.
      
          Parameters:
              validateByCell - validateByCell Default value is null
      I don't see how this should help me. I want to perform the validation on the content of the grid when the user clicks on a button. I don't want to do the validation on row or cell changes whatsoever. So, I am looking for something like ListGrid.validate. Note that I tried ListGrid.validate but it didn't work for me.

      Regards,
      Maxime

      Comment


        #4
        To turn validation off entirely use setNeverValidate(true). To then trigger validation for any given row, call validateRow().
        Last edited by Isomorphic; 20 Apr 2009, 13:32.

        Comment


          #5
          Note: corrected previous advice.

          See also autoSaveEdits and saveByCell, and note that saving generally triggers validation, so you may need to disable automatic saving as well.

          Comment


            #6
            Originally posted by Isomorphic
            To turn validation off entirely use setNeverValidate(true). To then trigger validation for any given row, call validateRow().
            Where is the validateRow() method?

            Comment


              #7
              Added the following methods to ListGrid in SVN :

              validateRow
              validateCell
              cellHasErrors
              clearFieldError

              Sanjiv

              Comment

              Working...
              X