Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7196949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:52:35+00:00 2026-05-28T20:52:35+00:00

I’m using richFaces 3.3 and JSF 1.2. In my sample application I need to

  • 0

I’m using richFaces 3.3 and JSF 1.2.

In my sample application I need to display List of items in and contains also
i.e( 2 columns having and third one is )

If I try to give List with in another List as value for rich:columns means its not working but direct bean value is working ???

mainClass

having getter , setter of String item1 , String item2, List priceList

mainList

 contains item 1
          item 2
          List<price>  priceList like that...

so in  <rich:dataTable> if i try to  give value like 

                            <rich:dataTable  id="positions" value="#{bean.mainList}" var="var">


                                    <rich:column>
                                        <f:facet name="header">
                                            <h:outputText   value="item1"/>
                                        </f:facet>
                                        <h:outputText id="contname" value="#{var.item1}">
                                    </rich:column>


                                    <rich:column>
                                        <f:facet name="header">
                                            <h:outputText   value="item2"/>
                                        </f:facet>
                                        <h:outputText id="contname" value="#{var.item2}">
                                    </rich:column>

                                    <rich:columns value="#{var.priceList}" var="partnerPriceItem"  columns="2" index="ind">
                                        <f:facet name="header">
                                                <h:outputText id="output#{ind}" value="#{partnerPriceItem.id}"  />
                                            </f:facet>
                                                <h:outputText id="price#{ind}" value="#{partnerPriceItem.price}" />
                                    </rich:columns>

                                    </rich:dataTable>

here for first 2 columns working fine. but when I try to give referencing from another List means not working ??

output like

item 1 item 2 price1 price2 price3

1 2 100 200 300

2 2 50 100 75

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:52:36+00:00Added an answer on May 28, 2026 at 8:52 pm

    To resolve your problem, you need to use the rich:dataTable and rich:subTable. There is an example in the exadel live demo site.

    Let’s have a look in the code (this is not the real code of the site, it’s just an example to get the idea):

    Java Classes

    //POJOs
    public class Expenses {
        private Date day;
        private decimal meals;
        private decimal hotels;
        private decimal transports;
        //getters and setters for the attributes;
    }
    
    public class Record {
        private String city;
        private List<Expenses> items;
        private decimal totalMeals;
        private decimal totalHotels;
        private decimal totalTransport;
        private decimal total;
        //getters and setters for the attributes;
    }
    
    public class ExpReport {
        private List<Record> records;
        private decimal totalMeals;
        private decimal totalHotels;
        private decimal totalTransport;
        private decimal grandTotal;
        //getters and setters for the attributes;
    }
    
    //Managed Bean
    public class Report {
        private ExpReport expReport;
        //getter and setter for the attribute;
    }
    

    We have the managed bean Report that contains an instance of ExpReport. Inside ExpReport we have a List of Records (the list we want to display in the table), but each record has its own inner List of Expenses (the list we want to display along with the records). Now, we just need to set up our rich:dataTable and the rich:subTable in it to get the magic flowing in our jsp.

    Note: You can get more info on the documentation of rich:column.

    <!-- Here we set the data list for the dataTable as the list of records of our
         object expReport. Also, the name of the iterator will be 'record' -->
    <rich:dataTable width="100%" value="#{report.expReport.records}" var="record">
        <f:facet name="header">
            <!-- This columnGroup tag component will define a group of columns for
                 the header of the dataTable (the body of the dataTable can has
                 more columns, for this example there will be the same).-->
            <rich:columnGroup>
                <rich:column rowspan="2">
                    <rich:spacer />
                </rich:column>
                <rich:column colspan="3">
                    <h:outputText value="Expenses" />
                </rich:column>
                <rich:column rowspan="2">
                    <h:outputText value="subtotals" />
                </rich:column>
                <!-- The 'breakBefore' attribute tells the column  to start from the
                     next row to be rendered in the dataTable. This attribute doesn't
                     affect the rows generated in rich:extendedDataTable. For more
                     info, see the documentation (link above the code). -->
                <rich:column breakBefore="true">
                    <h:outputText value="Meals" />
                </rich:column>
                <rich:column>
                    <h:outputText value="Hotels" />
                </rich:column>
                <rich:column>
                    <h:outputText value="Transport" />
                </rich:column>
            </rich:columnGroup>
        </f:facet>
        <!-- Now, let's set the content of the rows of the dataTable -->
    
        <!-- This column will show city from our 'record' iterator. -->
        <rich:column colspan="5">
            <h:outputText value="#{record.city}" />
        </rich:column>
        <!-- After printing the city, we want to show the data from the expenses
             made in this record. For this, we will use the subTable tag
             component, setting the 'record.items' list as the data list for
             subTable and naming the inner iterator 'expense'. The syntax for the
             subTable is like the dataTable. -->
        <rich:subTable value="#{record.items}" var="expense">
            <rich:column>
                <h:outputText value="#{expense.day}" />
            </rich:column>
            <rich:column>
                <h:outputText value="#{expense.meals}">
                    <f:convertNumber pattern="$####.00" />
                </h:outputText>
            </rich:column>
            <rich:column>
                <h:outputText value="#{expense.hotels}">
                    <f:convertNumber pattern="$####.00" />
                </h:outputText>
            </rich:column>
            <rich:column>
                <h:outputText value="#{expense.transport}">
                    <f:convertNumber pattern="$####.00" />
                </h:outputText>
            </rich:column>
            <rich:column>
                <rich:spacer />
            </rich:column>
        </rich:subTable>
    </rich:dataTable>
    

    Sorry for my bad english, I hope this can be helpful in your application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.