Hello Shree,

My managed-bean has a method: public List<Message> getMessagesForList().
To get the content of the messages rendered I use the t:dataTable like
this:


<t:dataTable 
        id="messageList"
        value="#{messagesListBean.messagesForList}" 
        var="message" 
        rows="10" 
        rowClasses="odd, even"
      width="420">

        <t:column width="280">
                <f:facet name="header">
                <h:outputText value="${bundle.lblSubject}"/>   
                </f:facet>

                <h:outputText value="#{message.subject}" />
        </t:column>             
                            
        <t:column width="80">
                <f:facet name="header">
                <h:outputText value="${bundle.lblDate}" />
                </f:facet>

                <h:outputText value="#{message.createDate}">
                        <f:convertDateTime type="date"
pattern="dd-MM-yyyy" />
                </h:outputText>
        </t:column>             
</t:dataTable>


If you just want to iterate over your values, you might want to take a
look at the dataList, which would be something this:


<h4>Messages</h4>
<ul>
        <t:dataList 
                value="#{messagesListBean.messagesForList}" 
                var="message" 
                layout="simple">
        
                <li>
                        <h:outputText value="#{message.subject}" />
                        <h:outputText value="#{message.createDate}">
                                <f:convertDateTime type="date"
pattern="dd-MM-yyyy" />
                        </h:outputText>
                </li>
        </t:dataList>
</ul>


I hope this might help.
For more example take a look at: http://www.irian.at/myfaces/home.jsf


With kind regards,
  Marco

-----Original Message-----
From: shree [mailto:[EMAIL PROTECTED] 
Sent: donderdag 12 april 2007 8:11
To: [EMAIL PROTECTED]
Subject: regarding <h:dataTable>


hi all,
can any one please post a complete example for how to use <h:dataTable>
to
iterate the values from the bean.
I have been searching the net for that.but the code they have given is
not
clear.

Please some body help me.

thanks in advance,
Shree.
-- 
View this message in context:
http://www.nabble.com/regarding-%3Ch%3AdataTable%3E-tf3563628.html#a9953
570
Sent from the MyFaces - Users mailing list archive at Nabble.com.




------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD
and in Japan, as Banyu - direct contact information for affiliates is 
available at http://www.merck.com/contact/contacts.html) that may be 
confidential, proprietary copyrighted and/or legally privileged. It is 
intended solely for the use of the individual or entity named on this 
message. If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then 
delete it from your system.

------------------------------------------------------------------------------

Reply via email to