You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Christopher Hlubek (JIRA)" <my...@incubator.apache.org> on 2005/07/17 18:14:10 UTC

[jira] Created: (MYFACES-335) dataTable values are not properly updated if immediate action is used

dataTable values are not properly updated if immediate action is used
---------------------------------------------------------------------

         Key: MYFACES-335
         URL: http://issues.apache.org/jira/browse/MYFACES-335
     Project: MyFaces
        Type: Bug
    Versions: 1.0.9 beta    
 Environment: Windows XP, Tomcat 5.0.27, Java SDK 1.4.2.
    Reporter: Christopher Hlubek


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(i);
	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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-335) dataTable values are not properly updated if immediate action is used

Posted by "Christopher Hlubek (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-335?page=comments#action_12315994 ] 

Christopher Hlubek commented on MYFACES-335:
--------------------------------------------

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

> dataTable values are not properly updated if immediate action is used
> ---------------------------------------------------------------------
>
>          Key: MYFACES-335
>          URL: http://issues.apache.org/jira/browse/MYFACES-335
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>  Environment: Windows XP, Tomcat 5.0.27, Java SDK 1.4.2.
>     Reporter: Christopher Hlubek

>
> 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(i);
> 	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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-335) dataTable values are not properly updated if immediate action is used

Posted by "David Green (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-335?page=comments#action_12365951 ] 

David Green commented on MYFACES-335:
-------------------------------------

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.

> dataTable values are not properly updated if immediate action is used
> ---------------------------------------------------------------------
>
>          Key: MYFACES-335
>          URL: http://issues.apache.org/jira/browse/MYFACES-335
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9m9
>  Environment: Windows XP, Tomcat 5.0.27, Java SDK 1.4.2.
>     Reporter: Christopher Hlubek

>
> 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(i);
> 	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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (MYFACES-335) dataTable values are not properly updated if immediate action is used

Posted by "Mathias Broekelmann (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-335?page=all ]
     
Mathias Broekelmann closed MYFACES-335:
---------------------------------------

    Resolution: Fixed

fixed in the current svn repository

> dataTable values are not properly updated if immediate action is used
> ---------------------------------------------------------------------
>
>          Key: MYFACES-335
>          URL: http://issues.apache.org/jira/browse/MYFACES-335
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>  Environment: Windows XP, Tomcat 5.0.27, Java SDK 1.4.2.
>     Reporter: Christopher Hlubek

>
> 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(i);
> 	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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira