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

Populating records

How can I write a visual page which list all the records that I have on custom object called Hotel with check box next to each record.


So for instance, the display will look like below


check box  hotelid1 hotel name1 

check box  hotelid2 hotel name2

check box  hotelid3 hotel name3

check box  hotelid4 hotel name4

check box  hotelid5 hotel name 5



I do hope it makes sense and I would extremely appreiciate if someone can let me know wheather it is possible or not.




You need to create a nested wrapper class in your controller that has a boolean property as well as a property

that is a reference to an instance of hotel type.


When you display a List of instances of your wrapper class, the boolean property is displayed as an apex inputCheckBox.

If you then perform some processing in your controller, you can loop through the List of instances of your wrapper class and find out which records are checked.


Hope this helps!


Many thanks for your reply.

It is really beyond me....but thanks anyway..