[
https://issues.apache.org/jira/browse/TOMAHAWK-1257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652832#action_12652832
]
Michael Heinen commented on TOMAHAWK-1257:
------------------------------------------
I noticed the same bug today with tomahawk 1.1.7
It is caused by an if statement in HtmlDataTableHack. The internal dataModelMap
is not cleared if there is any error message in the current faces context. This
means that deprecated data is shown or in my case that
IndexOutOfBoundsException occur because the new model contains less rows.
can be easily reproduced:
- create a new DataModel in an ActionListener
- add an error message to the context
Method encodeBegin(FacesContext fc) in HtmlDataTableHack contains following
statements:
if (_isValidChilds && !hasErrorMessages(context))
{
//Refresh DataModel for rendering:
_dataModelMap.clear();
...
This means that error messages cannot be added anymore or the whole processing
does not work as expected!
>From my point of view this an critical error
> Tomahawk datatable not refreshing after error
> --------------------------------------------------
>
> Key: TOMAHAWK-1257
> URL: https://issues.apache.org/jira/browse/TOMAHAWK-1257
> Project: MyFaces Tomahawk
> Issue Type: Bug
> Components: Extended Datatable
> Affects Versions: 1.1.6
> Environment: Windows XP, IBM Rational Developer 6.01.
> Reporter: David Moberg
> Assignee: Hazem Saleh
>
> I have a JSF application that is using a Tomahawk datatable. Everything works
> perfectly except for after an error has occurred. The error can be conversion
> or validation error or something else, it does not matter. Once one of these
> errors occur and the page reloads with the error message it is no longer
> possible to update the datatable.
> When I submit the page with new filtering options (and of course removing
> what caused the error) the page just reloads but nothing changes. The error
> message no longer displays.
> Here is the datatable:
> <t:dataTable var="request" styleClass="datatable fullwidth"
> headerClass="tablesubheadopt4"
> rowClasses="list-row-even, list-row-odd"
> columnClasses="column-1, column-2, column-3, column-4, column-5, column-6,
> column-7, column-8, column-9, column-10, column-11, column-12, column-13,
> column-14, column-15, column-16, column-17, column-18"
> rows="#{BuViewBean.numOfRows2}" value="#{BuViewBean.list}"
> id="dataTable" preserveDataModel="false" preserveSort="true"
> sortable="true">
> The main problem is that once I have had an error on the page, the
> BuViewBean.list method is never called. I have verified this with debugger.
> What is weird is that BuViewBean.numOfRows2 is called and all other beans on
> the page are called. Basically all getters and setters are executed except
> for BuViewBean.list.
> And as I mentioned above, everything works perfectly until an error is
> encountered.
> I can also add that I added a Phase Listener and was able to determine that a
> successful reload of the datatable (pre error) contains the exact same phases
> as the unsuccessful reload after the error has been generated.
> This sounds like a bug in Tomahawk datatable to me.
> I am using Tomahawk-1.1.6.jar.
> Ok, I tried to do some debugging but with no success. I am not sure what is
> going on.
> I was able to determine that the createDataModel() method in
> HtmlDatatableHack.class does not get executed after an error has occured. I
> was not able to tell from where/how the createDataModel() method is called.
> Some code is preventing the datatable from being refreshed.
> I can also add that I tried to switch to the standard datatable (h:) and that
> works as it should but does not have any of the fancy features that Tomahawk
> datatable has.
> Am I really the first person encountering the problem?
> http://forum.java.sun.com/thread.jspa?threadID=5295295
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.