Hi people,

I run into a funny behavior of <af:table>

I have a setActionListener that triggers a method initTable() which then
changes the columns of the table in question. the table is defined in
the jsp without columns. Inside the dynamically generated columns i
placed CoreInputText elements. value bindings and method bindings are in
place.

Everything works fine except when i try to save the data. My input is
just ignored. However if I go and reload the jsp page without closing
the browser then everything works as intended.
I think I am missing something about the jsf life cycle here

Any clue?

thanks a lot

Daniele

Here the relevant code:


public void initTable(){
System.out.println(" ---------------- Reinit Table");
if (entityTable != null && entityType != null){
refreshEntities();
for (Iterator it = entityTable.getChildren().iterator(); it.hasNext();){
Object child = it.next();
if (child.getClass().equals(CoreColumn.class)) {
it.remove();
}
}
addTableColumn(entityTable,"name","#{entity.name}","string","name");
addTableColumn(entityTable,"description","#{entity.description}","string","description");
for (Iterator it = entityType.getAttributes().iterator();
it.hasNext();){
String attributeName = (String)it.next();
addTableColumn(entityTable,attributeName,"#{entity.attributeValues['" +
attributeName + "']}","string");
}
}
}
        
}
    

<af:menuBar binding="#{entityTableView.entityTypesMenu}">
<af:forEach items="#{entityTableView.rootEntityTypes}" var="rootType">
<af:commandMenuItem immediate="true" text="#{rootType.name}"
action="#{entityTableView.initTable}">
<af:setActionListener from="#{rootType}"
to="#{entityTableView.entityType}"/>
</af:commandMenuItem>
</af:forEach>
</af:menuBar>

<af:table rendered="#{entityTableView.entityType != null}"
binding="#{entityTableView.entityTable}"
value="#{entityTableView.entities}" var="entity" rows="10"
banding="row">
<f:facet name="selection">
<af:tableSelectOne>
<af:commandButton text="delete"
action="#{entityTableView.deleteEntity}"/>
</af:tableSelectOne>
</f:facet>
</af:table>


Reply via email to