3

My visual force code is: The object variable is of the type list and it contains a list of my subclass objects.

 <apex:inputText id="test" value="{!object.value}" rendered="{!contains(object.type, 'String')}" >
 </apex:inputText>

Controller:

 Public Class SubClass{
     public string value {get; set;}

}

The object is a sub-class in my controller and the value is a field of my sub-class object. The inputText seems to to be not passing the value to the appropriate field. Why is this happening? Please help! Thank you.

1
  • 1
    How is this page being submitted to the controller? Can we see a little more of your code? Aug 30, 2014 at 21:09

1 Answer 1

1

Try use instance of subclass as varible in your controller

public SubClass object {get; set;}

And subclass as

Public Class SubClass{
     public string value;

}
3
  • 2
    as an aside, 'object' is listed as an Apex reserved word marked for future use per Spring 14 doc - implying it should not be used as an identifier
    – cropredy
    Mar 3, 2014 at 16:53
  • good point :) Sorry I just copied @ths code Mar 3, 2014 at 19:53
  • 1
    I think in the OP, they are iterating over a list of SubClass objects (using var="object" in the VF tag), rather than one individual instance. Aug 30, 2014 at 21:07

You must log in to answer this question.

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