You need to sign in to do that
Don't have an account?
Sophia 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>
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>
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
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
https://www.namanmathur.com/
https://trvibes.xyz/
Attitude Status (https://www.desifunsun.com/attitude-status/)
Life Status in Hindi (https://www.desifunsun.com/life-status/)
Love Status (https://www.desifunsun.com/love-status/)
DesiFunSun (https://www.desifunsun.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/
https://ilovestatusking.in/
https://ilovestatusking.in/mohabbat-shayari-in-hindi/
https://ilovestatusking.in/royal-attitude-status-in-hindi/
Love Shayari in hindi (https://jaanishayari.com/love-shayari-in-hindi/)
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.
Stylish standard whatsapp dp (https://bestgovjobs.com/standard-whatsapp-dp-best-new-whatsapp-dp/)
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/)
Hindi Lyrics (https://www.lyricsdownload.in/category/hindi)
Hindi Ringtones (https://www.mp3ringtonedownload.in/hindi-ringtone)
Gujarati Bewafa Song (https://www.newgujaratisong.in/category/gujarati-bewafa-song-2019)
continue reading (https://shayariholic.com/hindi-love-shayari/)
blog link (https://shayariholic.com/sharabi-shayari-in-hindi/)
click this link here now (https://shayariholic.com/bewafa-shayari-in-hindi/)
hop over to here (https://shayariholic.com/attitude-shayari-in-hindi/)
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