Note that there are some explanatory texts on larger screens.

plurals
  1. POwhy not refresh jsf page
    primarykey
    data
    text
    <p>I create a bean as</p> <pre><code>@ManagedBean @RequestScoped public class KhachHangMB implements Serializable { @PersistenceContext(unitName = "XoSoWebPU") private EntityManager em; private List&lt;KhachHang&gt; l; public KhachHangMB() { l = new ArrayList&lt;KhachHang&gt;(); } @PostConstruct public void init() { l = new ArrayList&lt;KhachHang&gt;(); l = em.createNamedQuery("KhachHang.findAll").getResultList(); MsgShow.showMsg("", "Init " + Math.random()); } public List&lt;KhachHang&gt; retriveAllKhachHang() { return l; } </code></pre> <p>}</p> <p>And my jsf page:</p> <pre><code>&lt;h:form&gt; &lt;h1&gt;&lt;h:outputText value="List"/&gt;&lt;/h1&gt; &lt;h:dataTable value="#{khachHangMB.retriveAllKhachHang()}" var="item"&gt; &lt;h:column&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="Idkh"/&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{item.idkh}"/&gt; &lt;/h:column&gt; &lt;h:column&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="TenKH"/&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{item.tenKH}"/&gt; &lt;/h:column&gt; &lt;h:column&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="Cmnd"/&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{item.cmnd}"/&gt; &lt;/h:column&gt; &lt;h:column&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="DiaChi"/&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{item.diaChi}"/&gt; &lt;/h:column&gt; &lt;h:column&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="SoDT"/&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{item.soDT}"/&gt; &lt;/h:column&gt; &lt;h:column&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="Email"/&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{item.email}"/&gt; &lt;/h:column&gt; &lt;h:column&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="MaDuThuong"/&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{item.maDuThuong}"/&gt; &lt;/h:column&gt; &lt;h:column&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="GhiChu"/&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{item.ghiChu}"/&gt; &lt;/h:column&gt; &lt;h:column&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="MatKhau"/&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{item.matKhau}"/&gt; &lt;/h:column&gt; &lt;/h:dataTable&gt; &lt;h:commandLink value="Click" action="home" /&gt; &lt;/h:form&gt; </code></pre> <p>And my faces-config</p> <pre><code>&lt;navigation-rule&gt; &lt;navigation-case&gt; &lt;from-outcome&gt;trungthuong_list&lt;/from-outcome&gt; &lt;to-view-id&gt;/f_trungthuong/trungthuong_list.xhtml&lt;/to-view-id&gt; &lt;redirect/&gt; &lt;/navigation-case&gt; &lt;/navigation-rule&gt; &lt;navigation-rule&gt; &lt;navigation-case&gt; &lt;from-outcome&gt;home&lt;/from-outcome&gt; &lt;to-view-id&gt;index.xhtml&lt;/to-view-id&gt; &lt;redirect/&gt; &lt;/navigation-case&gt; &lt;/navigation-rule&gt; </code></pre> <p>I click on command link the random was called but the data on page was not change although i have been edited data on database. Another case, i navigate to other page after that i return but the data is old (not using back of web browser, i'm using command link)! Please help me!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload