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
Sophia GSophia G 

Wrapper trouble - Unknown Property 'NFOSDisplayDivisions2Controller.Division_Space2__c'

Hi,
I am having trouble with my Visualforce page and Apex Class. Everything seems to be fine apart from the error Unknown Property 'NFOSDisplayDivisions2Controller.Division_Space2__c'. I can't seem to figure out what is going on, could someone please help me out. Thank you.

Apex Class:
public with sharing class NFOSDisplayDivisions2Controller {
    
    public List<DivisionWrapper> listDivisionWrapper{get;set;}
    public List<Division_Space2__c> selectedDivisions{get;set;}

    public NFOSDisplayDivisions2Controller ()
    {
            listDivisionWrapper = new List<DivisionWrapper>();
            searchRecord();
    }
    
    public void searchRecord()
    {
        listDivisionWrapper.clear();
            for(Division_Space2__c a: [select Id, Name,Number_of_Competitors__c, Availability__c, RecordTypeID ,Active__c from Division_Space2__c limit 30]) 
            {
                listDivisionWrapper.add(new DivisionWrapper(a));
            }
    }

    public void processSelected() 
    {
        selectedDivisions = new List<Division_Space2__c>();
        selectedDivisions.clear();
        for(DivisionWrapper wrapDivisionObj : listDivisionWrapper) 
        {
            if(wrapDivisionObj.selected == true) 
            {
                selectedDivisions.add(wrapDivisionObj.acc);
                // Here you can add the counter or you check the selectedAccounts.size()
            }
        }
    }

    public void ActivateData() 
    {
        for(Division_Space2__c acc : selectedDivisions )
        {
            acc.Active__c= true;
        }
        update selectedDivisions ;
        searchRecord();
    }

    public void DeActivateData() 
    {
        for(Division_Space2__c acc : selectedDivisions )
        {
            acc.Active__c = false;
        }
        update selectedDivisions ;
        searchRecord();
    }
    


    // This is our wrapper/container class. 
    public class DivisionWrapper 
    {
        public Division_Space2__c acc {get;set;}
        public Boolean selected {get;set;}
        public DivisionWrapper(Division_Space2__c a) 
        {
            acc = a;
            selected = false;
        }
    }

}

Visualforce Page:
<apex:page controller= "NFOSDisplayDivisions2Controller">
    
<script type="text/javascript">
        function selectAllCheckboxes(obj,receivedInputID){
            var inputCheckBox = document.getElementsByTagName("input");
            for(var i=0; i<inputCheckBox.length; i++){
                if(inputCheckBox[i].id.indexOf(receivedInputID)!=-1){
                    inputCheckBox[i].checked = obj.checked;
                }
            }
        }
    </script>
    <apex:form >
        <apex:pageBlock id="PB1">
            <apex:pageBlockButtons >
                <apex:commandButton value="Add to Grid" action="{!processSelected}" rerender="table2,PB2"/>
            </apex:pageBlockButtons>

            <apex:pageblockSection title="Division Types" collapsible="false" columns="1">
                <apex:pageBlockTable value="{!listDivisionWrapper}" var="accWrap" id="table" title="Division Types">
                    <apex:column >
                        <apex:facet name="header">
                            <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
                        </apex:facet>
                        <apex:inputCheckbox value="{!accWrap.selected}" id="inputId"/>
                    </apex:column>
                    <apex:column value="{!Division_Space2__c.acc.Name}" />
                    <apex:column value="{!Division_Space2__c.acc.Number_of_Competitors__c}" />
                    <apex:column value="{!Division_Space2__c.acc.Availability__c}" />
                    <apex:column value="{!Division_Space2__c.acc.Active__c}" />
                </apex:pageBlockTable>


            </apex:pageblockSection>
        </apex:pageBlock>
        
        <apex:pageBlock id="PB2" >
            <apex:pageBlockButtons >
                <apex:commandButton value="Activate" action="{!ActivateData}" rerender="PB1,PB2"/>
                <apex:commandButton value="DeActivate" action="{!DeActivateData}" rerender="PB1,PB2"/>
            </apex:pageBlockButtons>

                <apex:pageBlockTable value="{!selectedDivisions}" var="c" id="table2" title="Selected Divisions">
                    <apex:column value="{!c.Name}" headerValue="Division Type"/>
                    <apex:column value="{!c.Number_of_Competitors__c}" headerValue="Number of Competitors"/>
                    <apex:column value="{!c.Availability}" headerValue="Availability"/>
                    <apex:column value="{!c.Active__c}" headerValue="Active"/>
                </apex:pageBlockTable>
        </apex:pageBlock>

        
    </apex:form>
</apex:page>
Best Answer chosen by Sophia G
Maharajan CMaharajan C
Hi Sophia,

In the first pageblocktable you are wrongly refering the properties:

 <apex:column value="{!Division_Space2__c.acc.Name}" />  ==>  <apex:column value="{!accWrap.acc.Name}" />


Visualforce Page:
<apex:page controller= "NFOSDisplayDivisions2Controller">
    
<script type="text/javascript">
        function selectAllCheckboxes(obj,receivedInputID){
            var inputCheckBox = document.getElementsByTagName("input");
            for(var i=0; i<inputCheckBox.length; i++){
                if(inputCheckBox[i].id.indexOf(receivedInputID)!=-1){
                    inputCheckBox[i].checked = obj.checked;
                }
            }
        }
    </script>
    <apex:form >
        <apex:pageBlock id="PB1">
            <apex:pageBlockButtons >
                <apex:commandButton value="Add to Grid" action="{!processSelected}" rerender="table2,PB2"/>
            </apex:pageBlockButtons>

            <apex:pageblockSection title="Division Types" collapsible="false" columns="1">
                <apex:pageBlockTable value="{!listDivisionWrapper}" var="accWrap" id="table" title="Division Types">
                    <apex:column >
                        <apex:facet name="header">
                            <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
                        </apex:facet>
                        <apex:inputCheckbox value="{!accWrap.selected}" id="inputId"/>
                    </apex:column>
                    <apex:column value="{!accWrap.acc.Name}" />
                    <apex:column value="{!accWrap.acc.Number_of_Competitors__c}" />
                    <apex:column value="{!accWrap.acc.Availability__c}" />
                    <apex:column value="{!accWrap.acc.Active__c}" />

                </apex:pageBlockTable>


            </apex:pageblockSection>
        </apex:pageBlock>
        
        <apex:pageBlock id="PB2" >
            <apex:pageBlockButtons >
                <apex:commandButton value="Activate" action="{!ActivateData}" rerender="PB1,PB2"/>
                <apex:commandButton value="DeActivate" action="{!DeActivateData}" rerender="PB1,PB2"/>
            </apex:pageBlockButtons>

                <apex:pageBlockTable value="{!selectedDivisions}" var="c" id="table2" title="Selected Divisions">
                    <apex:column value="{!c.Name}" headerValue="Division Type"/>
                    <apex:column value="{!c.Number_of_Competitors__c}" headerValue="Number of Competitors"/>
                    <apex:column value="{!c.Availability}" headerValue="Availability"/>
                    <apex:column value="{!c.Active__c}" headerValue="Active"/>
                </apex:pageBlockTable>
        </apex:pageBlock>

        
    </apex:form>
</apex:page>

Thanks,
Maharajan.C

 

All Answers

Maharajan CMaharajan C
Hi Sophia,

In the first pageblocktable you are wrongly refering the properties:

 <apex:column value="{!Division_Space2__c.acc.Name}" />  ==>  <apex:column value="{!accWrap.acc.Name}" />


Visualforce Page:
<apex:page controller= "NFOSDisplayDivisions2Controller">
    
<script type="text/javascript">
        function selectAllCheckboxes(obj,receivedInputID){
            var inputCheckBox = document.getElementsByTagName("input");
            for(var i=0; i<inputCheckBox.length; i++){
                if(inputCheckBox[i].id.indexOf(receivedInputID)!=-1){
                    inputCheckBox[i].checked = obj.checked;
                }
            }
        }
    </script>
    <apex:form >
        <apex:pageBlock id="PB1">
            <apex:pageBlockButtons >
                <apex:commandButton value="Add to Grid" action="{!processSelected}" rerender="table2,PB2"/>
            </apex:pageBlockButtons>

            <apex:pageblockSection title="Division Types" collapsible="false" columns="1">
                <apex:pageBlockTable value="{!listDivisionWrapper}" var="accWrap" id="table" title="Division Types">
                    <apex:column >
                        <apex:facet name="header">
                            <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
                        </apex:facet>
                        <apex:inputCheckbox value="{!accWrap.selected}" id="inputId"/>
                    </apex:column>
                    <apex:column value="{!accWrap.acc.Name}" />
                    <apex:column value="{!accWrap.acc.Number_of_Competitors__c}" />
                    <apex:column value="{!accWrap.acc.Availability__c}" />
                    <apex:column value="{!accWrap.acc.Active__c}" />

                </apex:pageBlockTable>


            </apex:pageblockSection>
        </apex:pageBlock>
        
        <apex:pageBlock id="PB2" >
            <apex:pageBlockButtons >
                <apex:commandButton value="Activate" action="{!ActivateData}" rerender="PB1,PB2"/>
                <apex:commandButton value="DeActivate" action="{!DeActivateData}" rerender="PB1,PB2"/>
            </apex:pageBlockButtons>

                <apex:pageBlockTable value="{!selectedDivisions}" var="c" id="table2" title="Selected Divisions">
                    <apex:column value="{!c.Name}" headerValue="Division Type"/>
                    <apex:column value="{!c.Number_of_Competitors__c}" headerValue="Number of Competitors"/>
                    <apex:column value="{!c.Availability}" headerValue="Availability"/>
                    <apex:column value="{!c.Active__c}" headerValue="Active"/>
                </apex:pageBlockTable>
        </apex:pageBlock>

        
    </apex:form>
</apex:page>

Thanks,
Maharajan.C

 
This was selected as the best answer
Asim RiazAsim Riaz
Your Response is Amazing at Best Breweries in Vancouver (https://trafoos.com/mustvisit/best-breweries-in-vancouver/)
Desi FunSunDesi FunSun
tr vibestr vibes
good
https://trvibes.xyz/
tr vibestr vibes
good tr vibes (https://trvibes.xyz/)
Asim Riaz 6Asim Riaz 6
I am also facing the same issue on my website article of Best Nespresso Machine For Latte (https://bestbuyerguides.com/best-nespresso-machine-for-latte). kindly help me
sanjay kumar 300sanjay kumar 300
FAUG Game Download. How can I download FAUG Game Download APK (https://appszx.com/faug-game-download/) for mobile? Like PUBG Mobile, Garena Free fire and fortnite, FAU-G game can FAUG GAME APP DOWNLOAD ( best PUBG alternative ): Bollywood super star Akshay kumar ने multiplayer action game FAUG Faug Game Download apk (https://androidji.com/faug-game-download-apk/)
 
shayari nowshayari now
right the first-page block table you are wrongly referring to the properties shayarinow.com
weare weshareweare weshare
https://weareweshare.com/

Love status in hindi Heart Touching shayari vist my website  https://weareweshare.com/success-status-in-hindi/
https://weareweshare.com/breakup-shayari/
https://weareweshare.com/motivation-in-hindi/
https://weareweshare.com/best-quotes-in-hindi/
https://weareweshare.com/love-quotes-in-hindi/
https://weareweshare.com/attitude-quotes/
https://weareweshare.com/quotes-on-attitude/
https://weareweshare.com/lonely-quotes/
https://weareweshare.com/nature-quotes/
https://weareweshare.com/positive-thoughts-in-hindi/
https://weareweshare.com/very-sad-status/
https://weareweshare.com/dosti-shayri/
https://weareweshare.com/sad-quotes-in-hindi/
https://weareweshare.com/emotional-status/
https://weareweshare.com/motivation-status/
https://weareweshare.com/motivational-status-in-hindi/
https://weareweshare.com/attitude-status-for-boys/
https://weareweshare.com/sad-status/
https://weareweshare.com/life-quotes-in-hindi/
https://weareweshare.com/motivational-thoughts-in-hindi/
https://weareweshare.com/inspirational-quotes-in-hindi/
https://weareweshare.com/breakup-quotes/
https://weareweshare.com/hindi-quotes/
https://weareweshare.com/motivational-quotes-in-hindi/
https://weareweshare.com/love-status-in-hindi/
pyar shayaripyar shayari
Trouble are solved. Good. Sacha Pyar Shayari (https://ilovestatusking.in/pyar-shayari-pyar-bhari-shayari/) in hindi with photos - images - dp. Pyar Bhari Shayari download 2021. Ek tarfa pyaar ki shayari hindi mai in this post.
Jaani ShayariJaani Shayari
The helps me a lot. Thank you for solving my problem
Love Shayari in hindi (https://jaanishayari.com/love-shayari-in-hindi/)
 
Jaani ShayariJaani Shayari
There is some problem with my code please help.
Archana Singh 86Archana Singh 86
Great Place For Status : https://upgrademystatus.com/
Tansa RudaraTansa Rudara
Hindimen (https://www.hinfimen.in) is best Hindi website but it have some html problem with this pages Goldfish ka scientific name kya hai (https://www.hindimen.in/2021/10/Goldfish-ka-scientific-name-kya-price.html)
In this pages we have faced some html problem so pls solve it.
 
poetry shayaripoetry shayari
Really enjoy your content, its very Informative and skills are really impressive

Standard whatsapp dp | Best whatsapp dp (https://bestgovjobs.com/standard-whatsapp-dp-best-new-whatsapp-dp/)

Bewafa shayari, Dhoka shayari, Attitude shayari,Dost shayari, Nafrat poetry, Shayari in english, Gulzar shayari, Galib Shayari, Jaun Elia shayari, John Elia
shayari, Standard WhatsApp DP, Best New Whatsapp DP, Love DP, Best Love DP, Top Love DP.
poetry shayaripoetry shayari
Really enjoy your content, its very Informative and skills are really impressive
Stylish standard whatsapp dp (https://bestgovjobs.com/standard-whatsapp-dp-best-new-whatsapp-dp/)
raty singhraty singh

Thanks For Sharing The Amazing content. I Will also share with my friends. Great Content thanks a lot.
Anniversary Wishes mummy papa : https://www.digitalkhabar.in/marriage-anniversary-wishes-for-mummy-papa-in-hindi/
Happy Marriage Anniversary Bhaiya Bhabhi Wishes and Messages : https://www.digitalkhabar.in/happy-marriage-anniversary-bhaiya-bhabhi/ (http://https://www.digitalkhabar.in/marriage-anniversary-wishes-for-mummy-papa-in-hindi/)
Birthday Wishes for Mother in Hindi : https://www.digitalkhabar.in/birthday-wishes-for-mother-in-hindi/
Birthday Wishes for Daughter in Hindi : ​​​​​​​https://www.digitalkhabar.in/birthday-wishes-for-daughter-in-hindi/ (https://www.digitalkhabar.in/birthday-wishes-for-mother-in-hindi/
amit kumar 2616amit kumar 2616
This link can be used to login to the admin page of the router. 192.168.l.l (https://192-168-l-l.co/)
amit kumar 2616amit kumar 2616
Excelente Articulo, llegare a mi casa y lo pondré en Marcha, de verdad que bueno que publican artículos como este. GB Whatsapp Download (https://appszx.com/gb-whatsapp-download/)
Anuja SharmaAnuja Sharma
Sinar BerkatSinar Berkat
SAP Adalah (https://mazmur.id/sap-adalah/)singkatan dari System Application and Processing yang jika di bahasa Indonesianya berarti aplikasi sistem dan pemrosesan.

Untuk Implementasi SAP Pertama kali membuat pusing, namun bisa di atasi dengan es krim mixue terdekat (https://cemmygo.com/daftar-harga-menu-mixue-serta-alamat-terdekat/) yang bisa kalian order dengan aplikasi online.

Dijamin deh, setelah makan es krim mixue, otak kalian akan terang lagi seperti lampu pju solar cell 100 watt (https://www.sinarberkat.co.id/jual-lampu-pju-all-in-one-solar-cell-100-watt-sni/

Salam

Mazmur.id
Shayari FeedShayari Feed
Great, Keep it up. ShayariFeed (https://shayarifeed.com/)