[
http://issues.apache.org/jira/browse/TOMAHAWK-493?page=comments#action_12435672
]
Martin Marinschek commented on TOMAHAWK-493:
--------------------------------------------
Wouldn't it be more correct to change the code in the following snippet to
exclude:
if(rowIndex!=-1)
I tried it with this patch; if it's not working, please reopen.
regards,
Martin
public void setRowIndex(int rowIndex)
{
FacesContext facesContext = FacesContext.getCurrentInstance();
if (rowIndex < -1)
{
throw new IllegalArgumentException("rowIndex is less than -1");
}
UIComponent facet = getFacet(HtmlTableRenderer.DETAIL_STAMP_FACET_NAME);
/*Just for obtaining an iterator which must be passed to
saveDescendantComponentStates()*/
Set set = new HashSet();
set.add(facet);
if (rowIndex != -1 && facet != null)
{
_detailRowStates.put(getClientId(facesContext),
saveDescendantComponentStates(set.iterator(), false));
}
> detailStamp facet in the last row not decoded/validated/updated
> ---------------------------------------------------------------
>
> Key: TOMAHAWK-493
> URL: http://issues.apache.org/jira/browse/TOMAHAWK-493
> Project: MyFaces Tomahawk
> Issue Type: Bug
> Affects Versions: 1.1.2
> Reporter: Val Blant
>
> There is a problem with the state saving algorithm in
> org.apache.myfaces.component.html.ext.HtmlDataTable. setRowIndex(int) method
> saves the state of the component in the context of the previous index and
> then retrieves the appropriate state for the component in the context of the
> current index. This ensures that components will have appropriate values for
> each row before doing the work for any given phase.
> The problem is that this algorithm will never store the state of the very
> last row on the current page. This can be easily verified if you put some
> input fields into the detailStamp facet, expand the last row on the page,
> update a value and do something to cause a postback. The values in the facet
> will revert back to what they were before and the model will not be updated.
> The fix to this is simple:
> In processDetails() method, after this line:
> "process(context,facet,processAction);" put:
> if ( rowIndex == (last - 1) ) {
> Set set = new HashSet();
> set.add(facet);
> hidableRowStates.put(
>
> getClientId(FacesContext.getCurrentInstance()),
>
> saveDescendantComponentStates(set.iterator(),false));
> }
> This if-statement defines the special case that stores the state of the facet
> in the last row on the page.
--
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