Announcement

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

    Issue with ListGrid

    Using SmartClient Version: v8.3p_2013-02-08/PowerEdition Deployment (built 2013-02-08)

    I am having a ListGrid with two fields, Max Qty and Qty. I am having a Validation here that Qty will not be greater than Max Qty.

    When I am trying to add Qty greater then Max Qty, its give me Max Quantity error(i.e. “Error message”), which is correct and as expected.

    Now I modify the quantity to be less than max Quantity, but still I am getting the Old Value not the modified one.

    Please suggest.

    Regards,
    Deepak Singh

    #2
    This is far too little context to help. Please add more information.

    Comment


      #3
      Coping the content from below thread, facing the same problem. This problem is still replicable in 3.1p version.
      http://forums.smartclient.com/showthread.php?t=17002&highlight=client+side+grid+editing

      There is a validation bug when editing the row inside the grid using the 'serverCustom' type validator. I discovered this problem in my application when validating the date field. However, the same bug happens when validating the text field.

      The problem is that the SmartGWT code correctly identifies the validation error, but when the error is fixed it does not removes the error code. It still shows the error and does not update the record in the db table.

      In order to make it easier to reproduce this error I used one of the SmartGWT sample applications - "built-in-ds" application.

      I made only one modification - defined the following "serverCustom" validator to the field "EmployeeType" in the employe.ds.xml file:

      <field name="EmployeeType" title="Employee Type" type="text" length="40">
      <validators>
      <validator type="serverCustom">
      <serverCondition><![CDATA[
      $value == $record.EmployeeStatus
      ]]></serverCondition>
      <errorMessage>Must be the same as EmployeeStatus</errorMessage>
      </validator>
      </validators>
      </field>

      This validator requires the EmployeeType field to have the same value as the value of the field EmployeeStatus.

      Then I performed the following steps.
      1. Started the builtInDS application in development mode.
      2. Selected a DataSource "Employees" in the Select a DataSource grid.
      3. Started editing the row for the employe "Joan Little" inside the grid by double-clicking the field "Employe Type" in this row.
      4. Changed the value from "full time" to "full time1".
      5. Clicked outside the row being edited.
      6. The validator correctly displayed the error.
      7. Changed the value of the field "Employe Type" to "active" and clicked outside the row.
      8. The error was still displayed even though the fields "EmployeeType" and "Status" now had the same values.
      9. If I now change the value of the field Status to "active1" and then change it again to "active" the error disappears.

      The validation works correctly when editing the record in the form.

      Regards,
      Deepak Singh

      Comment


        #4
        You need to declare dependentFields on the validator so that the system knows the validator needs to be rerun when another field is changed.

        Also note that there's no need for a custom validator here - you've implemented the same check as the built-in validator matchesField.

        Comment

        Working...
        X