0

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.

user3701861
  • 151
  • 1
  • 7
  • This cannot be explained by what you posted. Please read [ask] and [mcve]. If dataList is a custom type and size() is a method you implemented, it could be a reason things do not work. Hence to always create a [mcve] (add a bean, minimal, yet complete and reduce the xhtml page to the bare minimum yet also complete to run. See also http://www.stackoverflow.com/tags/jsf/info – Kukeltje Jun 30 '18 at 15:38
  • Oh and did you try to see if the code above is really the code that is running? Not some older version or whatever – Kukeltje Jun 30 '18 at 15:38
  • @Kukeltje - Yes, this code runs, modifications to it are reflected but ui:repeat doesnt loop at all. – user3701861 Jun 30 '18 at 15:48
  • Very, very weird. What is your JSF version and implementation? And still create a [mcve].... Please for our and your sake. – Kukeltje Jun 30 '18 at 15:49
  • _"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"_ Find the differences then. As stated it cannot be explained from the code and we cannot find the differences for you. Oh and did you check the real source of the page (not the 'dom view'). Check network traffic. Anything visible in there? – Kukeltje Jul 03 '18 at 09:23

0 Answers0