another weird jsf problem. my code looks something like this: Java Bean:
class Bean {
private ArrayList<OutageTableHeader> outageTableHeaderData;
public ArrayList<OutageTableHeader> getOutageTableHeaderData() {
return outageTableHeaderData;
}
public void setOutageTableHeaderData(ArrayList<OutageTableHeader> value) {
this.outageTableHeaderData = value;
}
public List<OutageRowData> getOutageDataForTable() {
createOutageTableHeader(); // method which populates outageTableHeaderData with data
...
return(); // returns a list of OutageRowData objects, each for every row
}
}
my xhtml file:
...
<h:form>
<rich:dataTable id="outageOvervi开发者_JAVA技巧ewTable"
value="#{mapOverviewManager.getOutageDataForTable()}" var="outageRow"
rendered="#{mapOverviewManager.outageDataForTable.size() > 0}"
headerClass="overviewHeader" cellpadding="0" cellspacing="0"
rowClasses="areaRowOdd, areaRowEven" style="width: auto">
<f:facet name="header">
<rich:columnGroup style="background: #ffffff">
<rich:column>
<h:outputText>TEST</h:outputText>
</rich:column>
<c:forEach items="#{mapOverviewManager.outageTableHeaderData}"
var="outHeader">
<rich:column colspan="#{outHeader.colSpan}">
<h:outputText value="#{outHeader.displayName}" />
</rich:column>
</c:forEach>
</rich:columnGroup>
</f:facet>
</rich:dataTable>
</h:form>
mapOverviewManager is my bean. Now I'm confronted with two problems 1) when I initally load the page, only "TEST" appears (the entry that is hard coded) 2) every time I press F5 to reload the page, the table expands itself. That is, exactly 32 entries (always the same) are appended to the end of the table and I don't know why?
This is rather strange because on the same page is a similar table, from which I basically copied the whole structure. Any suggestions?
You did not provide any meaningful data (not the scope of the bean, not even the code outageDataForTable property, not to mention the code that fetches data). But let me play a psychic for a second: the bean is session (or view) scoped, and you fetch the data in your getter?
精彩评论