p:dataTable inside p:dataList

UI Components for JSF
Post Reply
kolec
Posts: 1
Joined: 26 Jun 2011, 15:11

27 Jun 2011, 10:06

Hi,

I'm a new primefaces user and I've got a following problem:
My code:

Code: Select all

    <p:dataList value="#{myBean.questions}" var="questionVar">
         <p:dataTable var="answerVar"
                              id="myTable_#{questionVar.questionId}"
                              value="#{questionVar.answersList}"
                              selection="#{myBean.selectedAnswer}"
                              selectionMode="single"
                              rowSelectListener="#{myBean.onRowSelect}">
              <p:column>
                  <h:outputText value="#{questionVar.questionId}"/>
              </p:column>
              <p:column>
                   <h:outputText value="#{answerVar.content}"/>
              </p:column>
              <p:column>
                    <h:outputText value="#{answerVar.contentTranslation}"/>
              </p:column>
    </p:dataTable>
</p:dataList>
My all generated tables have one id = "myTable_" and #{questionVar.questionId} is not empty. It's possible to set a variable value to ID attribiute of p:dataTable ? It's any other way to set different id for each table?

I want to catch a row selection event for each table but i they have te same id it won't work.

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

28 Jun 2011, 13:55

try wrapping the datatable in its own form. Sometimes that helps

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

28 Jun 2011, 14:29

Which version do you use? 3.0.M1 had an issue with nested data components. Try 3.0.M2 nightly.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 26 guests