I am trying to update a table by using RequestContext.update() The following code is working (jsf):
<h:panelGrid columns="2" style="width: 100%" columnClasses="treeColumn,tableColumn">
<h:panelGroup id="treePanel">
<p:tree id="tree"
value="#{bean.root}"
var="node"
dynamic="true"
cache="true"
animate="true"
selectionMode="single"
selection="#{bean.selectedNode}"
rendered="#{bean.renderTree}">
<p:ajax event="select" listener="#{bean.onNodeSelect}" update=":mainForm:treePanel,:mainForm:tablePanel"/>
<p:ajax event="collapse" listener="#{bean.onNodeCollapse}"/>
<p:treeNode expandedIcon="ui-icon-folder-open"
collapsedIcon="ui-icon-folder-collapsed">
<h:outputText value="#{node.name}" styleClass="tableTreeText"/>
</p:treeNode>
<p:treeNode expandedIcon="ui-icon-folder-open"
collapsedIcon="ui-icon-folder-collapsed">
<h:outputText value="#{node.name}" styleClass="tableTreeText"/>
</p:treeNode>
</p:tree>
</h:panelGroup>
<h:panelGroup id="tablePanel" styleClass="acqPanelTable">
<p:dataTable id="acqDataTable"
widgetVar="acqTablehdsWidget"
var="acq"
value="#{bean.list}"
rendered="#{bean.renderTable}"
filteredValue="#{bean.filteredList}"
paginator="true"
paginatorPosition="bottom"
.....
....
...
..
.
But not via the server side:
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.update(":mainForm:tablePanel");
renderTable = true;
I don’t understand what is the different ?
Appreciate your help for any advice
Thanks
Remove the leading colon.
requestContext.update("mainForm:tablePanel");
It's always resolved relative to UIViewRoot
. The leading colon is only valid when you're currently sitting in an UINamingContainer
component in the view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With