2 Replies Latest reply on Jan 5, 2008 9:15 AM by Pete Muir

    List within a list

    Oded S. Newbie

      Hi,

      I'm trying to create a simple JSF page where there's a list of questions, and in each question, there's a list of possible answers. I manage to get the questions list, but the "inner" list of possible answers is not presented at all.


      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:s="http://jboss.com/products/seam/taglib">
      <body>
      
      <h2>Quiz</h2>
      
      <h:form>
      Please select your answers<br />
      
       <s:selectItems value="#{questions}" var="selectedQuestion">
       <h:outputText value="#{selectedQuestion.questionText}"></h:outputText>
       <p/>
       <ui:repeat value="#{selectedQuestion.possibleAnswers}" var="possibleAnswer">
       <h:outputText value="#{possibleAnswer.answerText}"></h:outputText>
       </ui:repeat>
       </s:selectItems>
       <h:commandButton type="submit" value="Submit"
       action="#{manager.checkAllAnswers}" />
      </h:form>
      </body>
      </html>
      


      What am I missing here? The object does have the list of possible answers inside, but it is not displayed.

      Thanks.