Note that there are some explanatory texts on larger screens.

plurals
  1. POprimefaces jsf 2 return empaty data
    primarykey
    data
    text
    <p>i have made jsf 2 webpage using primefaces 3.5 UI , so the webpage are worikng but my dataTable give empaty rows value , it should give me the values that's returned from database query .</p> <p>note , i have tested the database query and it's working fine , but i think there is problem in sending this data to HTML beans . </p> <p>my full code : </p> <pre><code>@ManagedBean @SessionScoped public class TableBean implements Serializable { private static final long serialVersionUID = 1L; public int model() throws ClassNotFoundException, ReflectiveOperationException, Exception{ try { // i'm sure the following query return acutal data ! Dbconnection NewConnect = new Dbconnection(); Connection con = NewConnect.MakeConnect(); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery(" select student_id , teacher_id , apssent_date , interval_id , Day_id from Apsent where class_id = 1" ) ; int StudentID ; int ClassID ; while(rs.next()){ StudentID = rs.getInt(1); ClassID = rs.getInt(2); return StudentID ; // or 0 or any value but the web page still give empaty rows value in data grid } } catch (SQLException e){ } return 0000; } </code></pre> <p>my full html code :</p> <pre><code>&lt;h:form&gt; &lt;p:dataTable var="car" value="#{tableBean}"&gt; &lt;p:column headerText="Model"&gt; &lt;h:outputText value="#{model.StudentID}" /&gt; &lt;/p:column&gt; &lt;p:column headerText="Year"&gt; &lt;h:outputText value="#{model.StudentID}" /&gt; &lt;/p:column&gt; &lt;p:column headerText="Manufacturer"&gt; &lt;h:outputText value="#{model.StudentID}" /&gt; &lt;/p:column&gt; &lt;p:column headerText="Color"&gt; &lt;h:outputText value="#{model.StudentID}" /&gt; &lt;/p:column&gt; &lt;/p:dataTable&gt; </code></pre> <p> </p>
    singulars
    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.
    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