ui:repeat doesn't work, nothing in DOM as well

46 Views Asked by At

I have this simple code which uses ui:repeat and based on the list of items, it is supposed to output some data using h:outputText.

XHTML code

<p:fragment id="tail_content" rendered="#{cBean.activated}">
 <ui:fragment rendered="#{mBean.stubMytile}">
  <div id="detail_information_mytile" class="data-sidebar">
   <ul>
    #{mBean.dataList.size()} <!-- This prints correctly based on the elements present in the list -->
    <ui:repeat var="info" value="#{mBean.dataList}">
      <li> <!- not present in DOM -->
       <div class="float-container">
        test <!- not present in DOM -->
        <div class="pull-left">
         <h:outputText id="outputText_Type" value="#{info.type}"/>
        </div>
        
        <div class="pull-right"> 
         <h:panelGroup styleClass="tile_spinner">
          <!-- some h:outputs displaying data from the bean -->
         </h:panelGroup>
        </div>
       </div>
      </li>
      <li>
       <div class="float-container">
        <div class="pull-left">
         <h:outputText value="#{info.nickname}" />
        </div>
       </div>
      </li>
    </ui:repeat>        
   </ul>
  </div>
 </ui:fragment>
</p:fragment>

mBean

private List<DataInfo> dataList; //Getter setters have been generated.

DataInfo attributes - the class is serialized

//Getter setters have been generated.
private String type;
private String integer;
private String decimal;
private String nickname;

Output - DOM view - notice that there is no 'li' tags present in the DOM, even when the size of the list is 2.

<div id="viewns_Z7_80E418O0L04R30A3DRP3GU12C4_:leftSideBar_form:tail_content">
 <div id="detail_information_mytile" class="data-sidebar">
  <ul>
   2

  </ul>
 </div>
</div>

With this I suspect that the problem is with ui:repeat as it is unable to loop through the elements and print them. Have tried various things, yet no success.

Some additional information

  1. xmlns used is xmlns:ui="http://java.sun.com/jsf/facelets"
    1. tried printing the values as #{mBean.dataList.get(0).type} and this works.
    2. size() method is not overridden.
    3. Version of jsf-api used is 2.0.3-b05 - Yes, this is quite old (but, Refer #5)
    4. The same piece of code is deployed on 3 servers, it works on 2 of them, but not on one. And, this question is related to that one server where it doesnt work.
    5. Server (all 3) : IBM Portal 8

Let me know your findings and any suggestions which I can try.

0

There are 0 best solutions below