+ Start a Discussion

Questions related to Controller extensions and Visualforce

1. Is there a way to explicitly call a Apex setter method from Visualforce. Lets say there is a field i of type Integer in a Controller Extension Apex code. I want to set the value of i from the corresponding Visualforce by explicitly calling setI. Is this possible?

2. I have defined a getter method in a Controller Extension. This method takes an argument. I want to call this getter method from Visualforce and pass a value. Is this supported?

3. Does Apex support two dimensional Lists. Can I declare something like -
      List<10><Rate_Set__c> roomRates;


Much Appreciated




1. You can call a setter method from Visualforce. Try and make use of the inputHidden to set a property if it cannot be used directly.

2. No, VisualForce does not support getter methods with arguments.

3. Apex also does not support Two Dimensional Lists, but you can make use of maps.

    For Example:

    Map<Integer, Rate_Set__c> mapRateSet  = new Map<Integer, Rate_Set__c>