MyFaces Core
  1. MyFaces Core
  2. MYFACES-335

dataTable values are not properly updated if immediate action is used

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.9m9
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP, Tomcat 5.0.27, Java SDK 1.4.2.

      Description

      The bug appears in the following scenario:

      In my view I have a dataTable displaying a List of beans with a column to enter a new value and one with two buttons to delete and edit each row.

      <h:form>
      <h:dataTable value="#

      {handler.listModel}

      " var="bean" width="100%">
      <h:column>
      <f:facet name="header">
      Label
      </f:facet>
      <h:inputText value="#

      {bean.value}

      " />
      </h:column>
      <h:column>
      <f:facet name="header">
      <h:outputText value="-" />
      </f:facet>
      <h:commandButton
      action="#

      {handler.updateRow}

      "
      value="Update" />
      <h:commandButton
      action="#

      {handler.deleteRow}

      "
      immediate="true" value="Delete" />
      </h:column>
      </h:dataTable>
      </h:form>

      And this is the code I am using in the handler:

      ListDataModel listModel =...

      ...

      public String deleteRow() {
      int i = listModel.getRowIndex();
      List l = (List)listModel.getWrappedData();
      l.remove;
      return "success";
      }

      And now the issue:

      Every time the delete button is clicked, the correct row is deleted but the values shown in the dataTable are the old ones, except the table is one row shorter!

      I am using a redirect navigation case to handle this shortcoming right now and then it is working as expected.

      I think the immediate action doesn't properly update the view values, I have debuged the application and the DataModel is updated perfectly fine.

        Issue Links

          Activity

          Hide
          Christopher Hlubek added a comment -

          By the way: if I set immediate="false" to the commandButton, everything works fine, even without using a redirect.

          Show
          Christopher Hlubek added a comment - By the way: if I set immediate="false" to the commandButton, everything works fine, even without using a redirect.
          Hide
          Mathias Broekelmann added a comment -

          fixed in the current svn repository

          Show
          Mathias Broekelmann added a comment - fixed in the current svn repository
          Hide
          David Green added a comment -

          Created related issue http://issues.apache.org/jira/browse/MYFACES-1109

          I would have reopened this issue, but it seems that with my JIRA permissions I cannot.

          Show
          David Green added a comment - Created related issue http://issues.apache.org/jira/browse/MYFACES-1109 I would have reopened this issue, but it seems that with my JIRA permissions I cannot.

            People

            • Assignee:
              Unassigned
              Reporter:
              Christopher Hlubek
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development