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
neao18neao18 

How to get Data from a Static wrapper Object in Visualforce page.

Hi all,

 

I have a small query that :

 

My senario is that I am using javascript remoting to pass data from page to controller and then fill a wrapper class(json parser).

but in javascript we can only use static variables so i made my wrapper object as public static. 

Every thing work and I get the Data in controller but when I tried to write it to VF page it give me "Unknown property 'fbIntegrationDataController.id'"

So how to get Data from it I also have getter setter for that but still not able to do so.

Public static fbIntegrationDataController fbClassObj{get;set;}

    public static void setfbClassObj(fbIntegrationDataController f){
        fbClassObj = f;
    }
    public static fbIntegrationDataController getfbClassObj (){
        return fbClassObj;
    }

@RemoteAction
    global static string getsetfbData(String tokenname) {
        fbData = tokenname; 
        fbClassObj = parse(fbData);
        return '';
}

public String name;
    public String email;
    public String id;
    public Picture picture;
    
    public class Picture {
        public Data data;
    }

    public class Data {
        public String url;
        public Integer width;
        public Integer height;
        public Boolean is_silhouette;
    }

    public static fbIntegrationDataController parse(String json) {
        return (fbIntegrationDataController) System.JSON.deserialize(json, fbIntegrationDataController.class);
    }

 

Best Answer chosen by Admin (Salesforce Developers) 
Prafull G.Prafull G.
You are trying to access "id" property on vf page which is not public but not marked as gettable. Could you please update the property to say

public String id {get; set;}

Let me know if it helps.

All Answers

neao18neao18

Sorry, but didn't founf any thing relevent.

Prafull G.Prafull G.
You are trying to access "id" property on vf page which is not public but not marked as gettable. Could you please update the property to say

public String id {get; set;}

Let me know if it helps.
This was selected as the best answer
neao18neao18

Hi Thanks man,

 

forgot to do that !! :)