myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Hlubek (JIRA)" <myfaces-...@incubator.apache.org>
Subject [jira] Commented: (MYFACES-335) dataTable values are not properly updated if immediate action is used
Date Sun, 17 Jul 2005 16:14:10 GMT
    [ 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


Mime
View raw message