Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.1.8
-
None
-
None
-
Tomcat 6, JSF RI 1.2_12
Description
If a page containing a data table with preserved data model has a validation error on submit, the preserved data is lost and no rows are rendered. (e.g. if a required field is empty)
Simple replication:
<h:inputText id="Name" value="#
{bean.name}" required="true" />
<t:dataTable
value="#
"
preserveDataModel="true"
var="obj">
......
bean:
public class Bean
{
private DataModel dataModel;
private String name = null;
public String edit()
{ dataModel = new ListDataModel(values); return "edit"; }......
The page is view by an action calling edit() then the page above is submitted with name being blank causing a validation error.
I have done some probing but am confused by the way the data is preserved so can't hack a solution...
In the SUN RI UIData the following is called:
public void encodeBegin(FacesContext context) throws IOException {
setDataModel(null); // re-evaluate even with server-side state saving
if (!keepSaved(context))
super.encodeBegin(context);
}
And the saved model is reset by an earlier call to AbstractHtmlDataTable
protected DataModel getDataModel()
{
if (_preservedDataModel != null)
return super.getDataModel();
}
Attachments
Attachments
Issue Links
- duplicates
-
TOMAHAWK-1533 Add preserveRowComponentState to t:dataTable
- Closed