2 Replies Latest reply on Aug 11, 2009 5:46 AM by bbasdeo

    Number of datamodels in a class

      Hello

      I have to display the dates for a particular month dynamically using datamodels as shown below:

      <table>
       <tr>
       <td> June</td>
       <a:repeat id="calheader" value="#{calendarHeader}" var="header" rendered="#{not empty calendarHeader}">
       <td><h:outputText value="#{header.leaveDate}" /></td>
       </a:repeat>
       </tr>
       </table>
       <a:repeat id="requestTable" border="1" var="requests"
       rendered="#{not empty leavesRequestPerEmployee}"
       value="#{leavesRequestPerEmployee}">
       <table border="1" width="100%">
       <tr>
       <td width="250" bgcolor="" align="justify">
       <h:outputText value="#{requests.employeeName}" />
       </td>
       <a:repeat value="#{requests.leaves}" var="item" >
       <td width="" bgcolor="#{item.leaveType}" ><rich:toolTip onmouseover="alert('Neerou')">
      
       </rich:toolTip>
        
       </td>
       </a:repeat>
       </tr>
       </table>
       </a:repeat>


      The calheader tag is used to display dates for a particular month through the code :
       @Factory("calendarHeader")
       public void displayCalendarHeader(){
       //Current Month : June
       Calendar cal = new GregorianCalendar(2009, Calendar.JUNE, 1);
       int days = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
       calendarHeader = new ArrayList<LmsLeaveDate>(days);
       for(int i =0 ;i<days; i++){
       LmsLeaveDate header = new LmsLeaveDate();
       header.setLeaveDate(i+1+"");
       calendarHeader.add(header);
       }
       }


      The row with dates is not being displayed.
      I doubt because am using 2 datamodels. Is that so?