user745235
user745235

Reputation:

ui:repeat or p:dataTable not working with list<>

I have this method:

public List<RequestItemVO> getRequestItem() {
        //compiled code
        throw new RuntimeException("Compiled Code");
}

When I try this:

<ui:repeat value=#{requestController.backing.requestVO.requestItem} var="item">
    <h:outputText value="#{item.id}" />
<ui:repeat>

I don't have any results, nothing is generated on my HTML (checked the source).

But if I do this:

<h:outputText value="#{requestController.backing.requestVO.requestItem.get(0).getMaterial().getDescription()}"/>

I have the material description.

Why it is not working on the <ui:repeat> or <p:dataTable>? I need it to work there to list all request items.

Upvotes: 0

Views: 525

Answers (1)

BalusC
BalusC

Reputation: 1109695

As per the comments you were attempting to use <ui:repeat> inside a <p:panelGrid>. This would only have worked if you have wrapped it in a <p:row><p:column>. Inside a <p:dataTable> this would only have worked if you have wrapped it in a <p:column>.

Upvotes: 1

Related Questions