0

I have a list of items. I want to display using t:datalist.

    <t:dataList value="#{ManageBean.selectItems}" var="feed"   rows="3" >
           <t:outputText>
           <h:outputText value="#{feed.value}"/>
           </t:outputText> 
     </t:dataList>

But all the items are displayed in one single row. I want to display each item in a new row.

How can I achieve this?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Parag Phadtare
  • 117
  • 1
  • 3
  • 9

1 Answers1

3

t:datalist not working properly

This is not true. It's in this case working exactly as specified and documented. The <t:dataList> generates by default no additional HTML at all. Please try to not act as if you didn't make any mistakes.

You're not clear on your definition of "row" either, so it's hard to point out the right solution. You seem to not understand/see either that JSF is merely a HTML code generator.

If you intend to generate a HTML <ul><li>, then you should be setting its layout attribute to unorderedList.

<t:dataList ... layout="unorderedList">

Or, if you intend to generate a HTML <ol><li>, then you should be setting its layout attribute to orderedList.

<t:dataList ... layout="orderedList">

Or, if you intend to generate a simple HTML <br> between each item, then just write the desired HTML code accordingly.

<t:dataList ...>
    <h:outputText value="#{feed.value}" /><br />
</t:dataList>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555