1 Reply Latest reply on Jan 28, 2009 12:33 PM by m4c0

    DataTable example does not clean form with validation error

    m4c0 Newbie

      Since I don't know if it is a bug on RF or on live demo, I'm posting on forum first.

      Steps to reproduce the error:
      1. Go to DataTable demo "Edit Table with ModalPanel" (great demo - I love it)
      2. Click on any "edit" button
      3. Replace "Make" and "Model" with anything (let's say "XXX" and "YYY")
      4. Replace "Price" with an invalid value (like "AAA")
      5. Click "store" (it will give a validation error)
      5. Cancel by clicking on "X"
      6. Try to edit any row

      Expected result: the modal panel must show information from the selected row

      Actual result: the "price" shows the correct value, but "make" and "model" shows "XXX" and "YYY"

      I tested on FF and I didn't find any workaround, yet... Any ideas?

        • 1. Re: DataTable example does not clean form with validation er
          m4c0 Newbie

          After a lot of trial-and-error, I found a solution. The problem is the component tree, that keeps invalid values when a validation error occurs. What do you do when a branch is rotten? Cut it off:

          public String cancel() {
           UIComponent uic = FacesContext.getCurrentInstance().getViewRoot().findComponent("editForm");
           uic.getChildren().clear();
           return null;
          }