-
1. Re: ExtendedDatatable reRender : tableState property not cal
ilya_shaikovsky Dec 18, 2008 10:24 AM (in response to nfeybesse)so reopen the issue. if you sure that you checked on the latest snapshot.
-
2. Re: ExtendedDatatable reRender : tableState property not cal
nfeybesse Dec 18, 2008 12:56 PM (in response to nfeybesse)Yes, I am sure.
SNAPSHOT and BETA4 have still the problem.
You can see that with this code :<h:form id="form"> <rich:extendedDataTable value="#{test.rows}" var="row" tableState="#{test.tableState}"> <rich:columns value="#{test.columns}" var="column" index="ind"> <f:facet name="header"> <h:outputText value="#{column.name}" /> </f:facet> <h:outputText value="#{row[ind]}" /> </rich:columns> </rich:extendedDataTable> <a:commandButton value="Add column" action="#{test.addAColumn}" reRender="form" /> <a:commandButton value="Remove column" action="#{test.removeAColumn}" reRender="form" /> <a:commandButton value="Rerender only" reRender="form" /> </h:form>
and backBean :import java.util.ArrayList; import java.util.Arrays; import java.util.List; import javax.faces.model.DataModel; import javax.faces.model.ListDataModel; import org.jboss.seam.ScopeType; import org.jboss.seam.annotations.Create; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.Scope; import org.jboss.seam.log.Log; import org.jboss.seam.log.Logging; import org.richfaces.event.DropEvent; @Name("test") @Scope(ScopeType.SESSION) public class Test { private static final Log log=Logging.getLog(Test.class); private String tableState; private List<Column> columns; private List<List<String>> rows; @Create public void init(){ removeAColumn(); } public List<Column> getColumns(){ return columns; } public List<List<String>> getRows(){ log.info("Call getRows !!!"); return rows; } public void addAColumn(){ columns=Arrays.asList(new Column[]{new Column("Col1"),new Column("Col2"),new Column("Col3")}); rows=Arrays.asList( Arrays.asList( new String[]{"a","b","c"}), Arrays.asList( new String[]{"a","b","c"}), Arrays.asList( new String[]{"a","b","c"}), Arrays.asList(new String[]{"d","e","f"})); } public void removeAColumn(){ columns=Arrays.asList(new Column[]{new Column("Col1"),new Column("Col2")}); rows=Arrays.asList( Arrays.asList(new String[]{"a","b"}), Arrays.asList(new String[]{"a","b"}), Arrays.asList(new String[]{"a","b"}), Arrays.asList(new String[]{"d","e"})); } public String getTableState() { log.info("Get table state : "+tableState); return tableState; } public void setTableState(String tableState) { log.info("Set table state : "+tableState); this.tableState = tableState; } public class Column { private String name; public Column(String name){ this.name=name; } public String getName(){ return name; } } }
-
3. Re: ExtendedDatatable reRender : tableState property not cal
nfeybesse Dec 18, 2008 1:14 PM (in response to nfeybesse)Sorry Ilya, I have not the permissions to reopen the issue.
Could you do that for me ? Or give me the permission ?
NF -
4. Re: ExtendedDatatable reRender : tableState property not cal
pgolawski Dec 19, 2008 4:53 AM (in response to nfeybesse)tableState property is called only on table initial render,
So this state is stored inside component between requests via saveState/restoreState mechanism.
What is the purpose to call getter for tableState property on every request?
Do you want to change "manually" the property value in backing bean? -
5. Re: ExtendedDatatable reRender : tableState property not cal
pgolawski Dec 19, 2008 8:38 AM (in response to nfeybesse)The component was changed to call getting tableState property on every request.
Changes will be available in new snapshot version. -
6. Re: ExtendedDatatable reRender : tableState property not cal
nfeybesse Dec 22, 2008 4:46 AM (in response to nfeybesse)Hi,
I have now another problem :
tableState property don't reflect changes made on columns width.
It seems that tableState property getter is called before table state property setter and erases the state changes we have possibly made.
I think tableState property getter must be called just before render phase, after the invoke application phase has ended (in the same time the datamodel getter is called).
NF -
7. Re: ExtendedDatatable reRender : tableState property not cal
nfeybesse Dec 24, 2008 4:37 AM (in response to nfeybesse)Hi.
Pawel Golawsky has commtitted a patch.
All is ok now.
Thanks.