3

today i need your help for an issue I'm facing.

I have the following custom controller

public with sharing myCustomController {

public Map<String, wrapperObj> myMap {
    get {
        // populate map...
    set;
}

// methods and stuffs...

public class wrapperObj {
    public String label;

    public wrapperObj() {}
}

}

And the following VF page associated with the controller

<apex:page showHeader="true" sidebar="true" controller="myCustomController">
<apex:form id="myForm">
    <apex:pageBlock >
            <!-- Map values -->
            <apex:repeat value="{!myMap}" var="key">                                    
                // this works fine
                <apex:outputText value="{!key}" />
                // this works too
                <apex:outputText value="{!myMap[key]}" />
                // this not !!
                <apex:outputText value="{!myMap[key].label}" />

            </apex:repeat>
    </apex:pageBlock>
</apex:form>

Basically the problem is that I'm not able to get field values from the wrapper class defined inside the controller...

Anyone can help with us?

Thank you very much!!

0

1 Answer 1

2

You need a getter/setter for your label property. Eg:

public class wrapperObj {
    public String label {get;set;}

    public wrapperObj() {}
}
1

You must log in to answer this question.

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