Have review(for adding review or comments) component in my application.
When add review, that p:dataTable
is updated with ajax.
before adding review:
after adding first review
refresh page(F5):
after adding second review:
jsf:
<h:form onsubmit="return commValidator();">
<h:inputText value="#{comment.commentator}"/>
<h:inputTextarea value="#{comment.body}";"/>
<p:commandButton value="send" action="#{showProducts.addComment}" update="comms"/>
<p:dataTable id="comms" value="#{showProducts.comments}" var="com">
<p:column>#{com.commentator}(
<h:outputText value="#{com.postDate}">
</h:outputText>):
</p:column>
<p:column>#{com.body}</p:column>
</p:dataTable>
</h:form>
The problem is p:dataTable
component is displayed twice on page.
After new review been added, that newly created p:dataTable
displayed.
How to make p:dataTable
displayed already after go to page and once time?
Thanks.
p:dataList
component resolves this problem
It displays ones and new elem. is added to already existing list instead of creating new one list as with p:dataTable
!