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 691821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:35:08+00:00 2026-05-14T02:35:08+00:00

<h:dataTable cellpadding=0 cellspacing=0 styleClass=list_table id=OuterItems value=#{valueList.values} var=item border=0> <h:column rendered=#{item.typeA}> <h:dataTable cellpadding=0 cellspacing=0 styleClass=list_table

  • 0
<h:dataTable cellpadding="0" cellspacing="0"
    styleClass="list_table" id="OuterItems"
    value="#{valueList.values}" var="item" border="0">
    <h:column rendered="#{item.typeA}">
        <h:dataTable cellpadding="0" cellspacing="0"
        styleClass="list_table" id="InnerItems"
        value="#{item.options}" var="option" border="0">
            <h:column >
                <h:outputText value="Option: #{option.displayValue}"/>
            </h:column>
        </h:dataTable>
    </h:column>
    <h:column rendered="#{item.typeB}">
        <h:dataTable cellpadding="0" cellspacing="0"
        styleClass="list_table" id="InnerItems"
        value="#{item.demands}" var="demand" border="0">
            <h:column >
                <h:outputText value="Demand: #{demand.displayValue}"/>
            </h:column>
        </h:dataTable>
    </h:column>
</h:dataTable>

public class Item{
    ...
    public boolean isTypeA(){
        return this instanceof TypeA;
    }

    public boolean isTypeB(){
        return this instanceof TypeB;
    }
    ...

}

public class typeA extends Item(){
    ...
    public List getOptions(){
        ....
    }
    ...
}

public class typeB extends Item(){
    ...
    public List getDemands(){
        ...
    }
    ....
}

I’m having an issue with JSF. I’ve abstracted the problem out here, and I’m hoping someone can help me understand how what I’m doing fails. I’m looping over a list of Items. These Items are actually instances of the subclasses TypeA and TypeB. For Type A, I want to display the options, for Type B I want to display the demands. When rendering the page for the first time, this works fine. However, when I post back to the page for some action, I get an error:

[3/26/10 12:52:32:781 EST] 0000008c SystemErr     R   javax.faces.FacesException: Error getting property 'options' from bean of type TypeB
    at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:89)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java(Compiled Code))
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
    at com.ibm.faces.portlet.FacesPortlet.processAction(FacesPortlet.java:193)

My grasp on the JSF lifecyle is very rough. At this point, i understand there is an error in the ApplyRequestValues Phases which is very early and so the previous state is restored and nothing changes.

What I don’t understand is that in order to fufill the condition for rendering “item.typeA” that object has to be an instance of TypeA. But here, it looks like that object passed the condition even though it was an instance of TypeB. It is like it is evaluating the inner dataTable (InnerItems) before evaluating the outer (outerItems). My working assumption is that I just don’t understand how/when the rendered attribute is actually evaluated.

  • 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-14T02:35:08+00:00Added an answer on May 14, 2026 at 2:35 am
     <h:column rendered="#{item.typeA}">
            <h:dataTable cellpadding="0" cellspacing="0"
            styleClass="list_table" id="InnerItems"
            value="#{item.options}" var="option" border="0"
            rendered="#{item.typeA}"> <!--  THIS IS THE CHANGE -->
                <h:column >
                    <h:outputText value="Option: #{option.displayValue}"/>
                </h:column>
            </h:dataTable>
        </h:column>
    

    Somehow adding the rendered condition directly to the datatable didn’t occur to me in my many hour iteration of guesses / egg hunt (I was really desperate). I still don’t understand why this didn’t work in the first place, but it is working.

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

Sidebar

Related Questions

This is what the code looks like: <h:dataTable value=#{movie.movieItems} var=item border=0 cellpadding=2 cellspacing=0 rowClasses=jsfcrud_odd_row,jsfcrud_even_row
<h:dataTable id=dt1 value=#{StudentMark.stuList} var=stuList bgcolor=#9AC8E6 border=10 cellpadding=5 cellspacing=3 rows=18 width=120% dir=LTR frame=hsides> <h:column> <f:facet
In Visualforce, I'm using an <apex:dataTable> component as follows: <apex:dataTable value={!Qualifications} var=qual styleClass=cv_table >
h:datatable created table like this column 1 column 2 item 1 item 1 item
<table cellpadding=0 cellspacing=0 border=1 class=display id=FormsData style=margin-bottom:5px;> <thead> <tr id=thFormsData> </tr> <tr> </tr> </thead>
I have a DataTable. I want to get every rows first column value and
I have a DataTable with a Name column. I want to generate a collection
I'm binding a datatable to a gridview control, and when I format each column
I have a DataTable that has a boolean column called [Invalid]. I need to
I have a datatable. I am populating some values into that. e.g. DataTable dt

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.