Possibility to edit and update any kind of datalist or datatable at the same time
The requirement:
-I want to display a list of dataobjects (don't know how many at that time) that are created asynchronous.
-The JSF view should be updated if there is a new dataobject. (any push possiblity out there?) -The dataobjects that are already shown in t开发者_高级运维he JSF view can be edited. <p:dataGrid var="page" value="#{viewBean.dataobjects}" columns="1" id="grid"
paginator="false" effect="true">
<p:column>
<p:panel header="#{page.name}" style="text-align:center">
<h:panelGrid columns="1" style="width:100%">
<p:inplace editor="true">
<p:inputText value="#{page.url}" required="true" label="text"/>
</p:inplace>
</h:panelGrid>
</p:panel>
</p:column>
</p:dataGrid>
<p:poll interval="3" update="grid" />
This is the way I tried it. Using a primefaces datagrid in combination with a primefaces ajax poll. The problem: While editing one of the shown dataobjects, the poll updates the complete datagrid and my changes are lost.
Any idea?
Building the form dynamically from the bean? Any other component? Building an own component?How would you solve it?
One solution would be to stop the ajax poll while an object is being edited, then restart the poll when editing is finished.
onclick="poll.stop();"
onclick="poll.start();"
http://www.primefaces.org/showcase/ui/pollStartStop.jsf
精彩评论