function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ngabraningabrani 

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

rmehrmeh

Hi,

 

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>