I have an interesting problem. I have a visual force component where i am looping through a list of data objects say MenuItem data object for now. Now i populate this list on a property in the visual force component controller. Now on the visual force component, as i loop through the collection, i need to render an output text or menu item of a particular style class based on the menuitem data objects status class variable. I am creating an if statement on the render and the code is not recognizing it. The code is below and it is not compiling on the menuData.menuItemState property. This is a custom object class variable and is not defined as a property on the component controller?

<apex:outputPanel layout="block">
<apex:dataList value="{!lstMenuItemData}}" var="menuData">  
    <div id="subNavContainer">
        <apex:outputText styleClass = "subNavSection selected" 

1 Answer 1


You should post your class to get a solid response, but make sure the class member is itself an accessible property:

public with sharing SomeController
  public MyClass
    public String menuItemState {get; set;}
    // etc.

Also you can simplify your render conditional:

rendered="{!menuData.menuItemState == 'S'}"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .