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
fromSEAfromSEA 

how to create wrapper class to display survey results

I have query results coming as following: for contact 1 for three questions and answers.

 

for Contact 1

 Q1  - ans1

 Q2 - ans2

  Q3 - ans3

 

for Contact 2

 Q1  - ans1

 Q2 - ans2

  Q3 - ans3

I want to dislay the above results as following:

       Q1    Q2    Q3

C1   ans1 ans2 ans3

C3   ans1 ans2 ans3

 can someone please help me create a class in my controller that help create this display in my apex page? How to display column values as row hearders..

 

I really appreciate any suggestions?

 

 

MiddhaMiddha

You need to create 3 wrapper classes here, which look like something like this (at a high level):

 

 

public class ContactRows{ Map<Contact, Questions> cqMap; //Keep adding all the contacts in this with objects of questions.}public class Questions{ Map<Question__c, Answers> qaMap; Same as cqMap, add Questions and answers in this map}public class AnswerCells{ Add the answers.}

 

 I have done many applications like this where matrix of data has to be displayed. If this doesnt solves your problem, mail me directly i'll send you the complete sample code.

 

/G 

 

fromSEAfromSEA

GreatG ,

thanks for the suggestion. But I could not figure out how to display value in the page.

I do not know how to use the map in the visual force page.

 

which class do I use to display results on page?

Message Edited by fromSEA on 03-29-2010 08:49 AM
bcgbcg

Please send me code to disply table as mentioned above.Plz

 

 

 

 

Thanks

Varun Gupta

bcgbcg

Hello GreatG,

 

I am also facing sam problem as mentioned. Will you pls send me the code for the same as you mention in your reply...

 

 

Thanks In advance.