You need to sign in to do that
Don't have an account?

unable to show Checboxes from wrapper.
I am unable to checkboxes from a wrapper class to visualforce page. I am getting unknown property error everytime.
Here is the Visual Force Page
<apex:page controller="chkBox"> <apex:form > <apex:pageBlock > <apex:pageBlockTable value="{!getVal}" var="p" > <apex:repeat value="{!p.box}" var="a"> <apex:column > <apex:inputCheckbox value="{!a}"/> </apex:column> </apex:repeat> </apex:pageBlockTable> <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Save"/></apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>
The Controller
public class chkBox { list<wrapbox> wrp= new list<wrapbox>(); public PageReference save() { String test = ApexPages.currentPage().getParameters().get('test'); system.debug('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'+test); return null; } public list<wrapbox> getGetVal() { system.debug('::::::::::::::::::::::::::::::'+wrp); wrapbox mywrp = new wrapbox(); for(integer i =0;i <10; i++){ mywrp = new wrapbox(); for(integer j =0;j <10; j++){ mywrp.box.add(true); } wrp.add(mywrp); } return wrp; } }
The Wrapper Class:
public class wrapBox{ public List<Boolean> box{get;set;} public wrapBox(){ box = new List<Boolean>(); } } public class wrapBox{public List<Boolean> box{get;set;} public wrapBox(){box = new List<Boolean>();}}
Please suggest how to show the Boolean list from wrapper class to the visual force. I am expecting a table of checkboxes.