-2
public class Employeewrapper {
    public string name{get;set;}
    public decimal salary{get;set;}
    public decimal exp{get;set;}
    public string technology{get;set;}
}

====================

public class addresswrapper {
    public string city {get;set;}
    public string place{get;set;}
    public string state{get;set;}
    public integer pin{get;set;}

}

==============================

public class empaddress {
    public Employeewrapper emp1 {get;set;}
    public addresswrapper add1 {get;set;}

    public empaddress(){
        emp1 =  new Employeewrapper();
        add1 = new addresswrapper();
    }

    public void setempdata(){
      emp1.name='ASVR'  ;
      emp1.exp=5;
      emp1.salary=50000;
      emp1.technology='Salesforce'  ;
    }

    public void setaddress(){
      add1.city = 'Hyderabad'  ;
      add1.place = 'Madhapur'  ;
      add1.state = 'Telangana'  ;
      add1.pin   = 500004;  
    }
}
  • 1
    your question is not clear what you are trying to achieve – Santanu Boral Sep 7 '17 at 19:39
  • hi santanu I am trying to display the information in empaddress class . – siva Sep 7 '17 at 19:48
  • But it is not showing the output.It is showing only lables. – siva Sep 7 '17 at 19:48
  • 1
    Can you show us your visualforce code – Dan Kowalski Sep 7 '17 at 19:49
  • 1
    Adding code (like Apex or Visualforce markup) doesn't work so well in comments because of the limited formatting options (and length restriction). This would be an example of something you should add to your question via an edit (that's the same link that appears right under the tags for your question). – Derek F Sep 7 '17 at 19:53
1

From the code you have provided it looks like you are not calling your set methods called setempdata and setaddress methods.

So the code would look something like this:

    public class empaddress {
    public Employeewrapper emp1 {get;set;}
    public addresswrapper add1 {get;set;}

    public empaddress(){
        emp1 =  new Employeewrapper();
        add1 = new addresswrapper();
        setempdata();
        setaddress();
    }

    public void setempdata(){
      emp1.name='ASVR'  ;
      emp1.exp=5;
      emp1.salary=50000;
      emp1.technology='Salesforce'  ;
    }

    public void setaddress(){
      add1.city = 'Hyderabad'  ;
      add1.place = 'Madhapur'  ;
      add1.state = 'Telangana'  ;
      add1.pin   = 500004;  
    }
}
  • You are Suuuuuuuuuuuuuper. Its Working .Thx a lot for your solution. – siva Sep 7 '17 at 20:03
  • Great! Glad to help. When you get a chance can you mark this as the answer. – Dan Kowalski Sep 7 '17 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.