Restorer une vue avec un acion ajax.
J'ai un treeview en sélectionnant un noeud je dois faire un mise à jour d'un rich:datatable.
Le dataTable est créer dynamiquement avec l'attribut binding.
En cliquant sur le noeud un problème est survenu lors de restauration de la vue(page).
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| 28 oct. 2010 11:32:22 com.sun.faces.lifecycle.Phase doPhase
GRAVE: JSF1054: (Phase ID: RESTORE_VIEW 1, View ID: /pages/treeComponent.xhtml) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@1ea0c8b]
28 oct. 2010 11:32:22 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: "Servlet.service()" pour la servlet Faces Servlet a g�n�r� une exception
javax.el.PropertyNotFoundException: /pages/treeComponent.xhtml @17,88 binding="#{uITreeViewImpl.actionDataTable}": Property 'actionDataTable' not writable on type org.richfaces.component.html.HtmlDataTable
at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:95)
at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:238)
at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:243)
at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:243)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:198)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:102)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source) |
Sachant que le code est pour le Xhtml:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| <f:view>
<h:form id="aa" >
<rich:tree binding="#{uITreeViewImpl.treeView}"></rich:tree>
<rich:dataTable width="100%" binding="#{uITreeViewImpl.actionDataTable}" id= "ahmed"/>
<!--<rich:dataTable width="100%" value="#{uITreeViewImpl.lstGen}" id="tab" rowKeyVar="row"
rows="15" var="item" >
<rich:column>
<f:facet name="header">
<h:outputText value="aaaa" />
</f:facet>
<h:outputText value="#{item.col2}" id="login" />
</rich:column>
</rich:dataTable>
<td style="COLOR: #0081ff;" width="50%" align="left" valign="150px">
<h:outputText value="Page: #{uITreeViewImpl.codeFonc}"
id="selectedNode" /></td>
-->
</h:form>
</f:view> |
Le code du rich:datatable
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| public org.richfaces.component.html.HtmlDataTable getAfficheComponent() {
org.richfaces.component.html.HtmlDataTable actionDataTable =
new org.richfaces.component.html.HtmlDataTable();
actionDataTable.setValueExpression("value", createValueExpression("#{"
+ managedBean + "." + nameListDao + "}", List.class));
actionDataTable.setVar("dataItem");
actionDataTable.setWidth(with);
for (int i = 0; i <= listColumn.size() - 1; i++)
{
System.out.println("je suis dans iteration" + i);
actionDataTable.getChildren().add((UIComponent) listColumn.get(i));
}
return actionDataTable;
} |