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
Megha SachaniaMegha Sachania 

Visualforce Access to Property

Hello All,

How can i access getter setter property of apex controller in visualforce remoting action of visualforce page without using Action Function?

please help me out.

AnudeepAnudeep (Salesforce Developers) 
When you define a getter and setter it can be accessed anywhere on the vf page in general

https://www.forcetree.com/2009/07/getter-and-setter-methods-what-are-they.html
 
public with sharing class clsGetViewData {
    public String something { get; set; }

    public clsGetViewData(){
        something = [Query].field;
    }

    public List<sObject> getSomeOtherData() {
        return [Query];
    }

    @RemoteAction
    public static List<sObject> MyRemoteAction() {
       clsGetViewData Controller=nwe clsGetViewData ();
       String Value=Controller.something;
       List<sObject> listSObjects=Controller.getSomeOtherData();
       // your stuff's 
       return [Query];
    } 
}

 
Megha SachaniaMegha Sachania
Thanks anudeep but i dont want to use apex:form or any other apex elements i am using simple html elements and making callout using javascript remoting where i want the apex properties values