You need to sign in to do that
Don't have an account?
Rafael Franco Moreno 24
visualforce page error Unknown property 'mensajeController.mensajeContenido'
why I got this message?
Unknown property 'mensajeController.mensajeContenido'
this the vf page
<apex:page controller="mensajeController" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Process Selected" action="{!processSelected}" rerender="test"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!contacts}" var="c" >
<apex:column >
<apex:inputCheckbox value="{!c.selected}"/>
</apex:column>
<apex:column value="{!c.con.Name}" />
<apex:column value="{!c.con.Email}" />
<apex:column value="{!c.con.Phone}" />
</apex:pageBlockTable>
</apex:pageBlock>
<apex:pageBlock>
<p>Current description: {!mensajeContenido}</p>
<p>Change description to:</p>
<apex:inputTextarea id="newDesc" value="{!mensajeContenido}"/><p/>
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlock>
<apex:pageBlock id="test">
Total No of Selected Records :<apex:outputText value="{!value }"/>
<apex:pageBlockTable value="{!SelectedContacts}" var="c" >
<apex:column value="{!c.Name}" />
<apex:column value="{!c.Email}" />
<apex:column value="{!c.Phone}" />
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
this is the controller
public class mensajeController {
public List<cContact> contactList {get; set;}
public List<Contact> selectedContacts{get;set;}
public Integer value {get;set;}
public List<cContact> getContacts() {
if(contactList == null) {
contactList = new List<cContact>();
for(Contact c : [select Id, Name, Email, Phone from Contact]) {
contactList.add(new cContact(c));
}
}
return contactList;
}
public PageReference processSelected() {
selectedContacts = new List<Contact>();
for(cContact cCon : getContacts()) {
if(cCon.selected == true) {
selectedContacts.add(cCon.con);
}
}
value = selectedContacts.size();
System.debug('printingtcontc'+selectedContacts.size());
return null;
}
public List<Contact> getSelectedContacts(){
System.debug('printingtcontc inside get'+selectedContacts.size());
if(selectedContacts.size()>0)
return selectedContacts;
else return null;
}
public class cContact {
public Contact con {get; set;}
public Boolean selected {get; set;}
public cContact(Contact c) {
con = c;
selected = false;
}
}
public class messageDescription {
public string mensajeContenido {get; set;}
}
}
Unknown property 'mensajeController.mensajeContenido'
this the vf page
<apex:page controller="mensajeController" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Process Selected" action="{!processSelected}" rerender="test"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!contacts}" var="c" >
<apex:column >
<apex:inputCheckbox value="{!c.selected}"/>
</apex:column>
<apex:column value="{!c.con.Name}" />
<apex:column value="{!c.con.Email}" />
<apex:column value="{!c.con.Phone}" />
</apex:pageBlockTable>
</apex:pageBlock>
<apex:pageBlock>
<p>Current description: {!mensajeContenido}</p>
<p>Change description to:</p>
<apex:inputTextarea id="newDesc" value="{!mensajeContenido}"/><p/>
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlock>
<apex:pageBlock id="test">
Total No of Selected Records :<apex:outputText value="{!value }"/>
<apex:pageBlockTable value="{!SelectedContacts}" var="c" >
<apex:column value="{!c.Name}" />
<apex:column value="{!c.Email}" />
<apex:column value="{!c.Phone}" />
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
this is the controller
public class mensajeController {
public List<cContact> contactList {get; set;}
public List<Contact> selectedContacts{get;set;}
public Integer value {get;set;}
public List<cContact> getContacts() {
if(contactList == null) {
contactList = new List<cContact>();
for(Contact c : [select Id, Name, Email, Phone from Contact]) {
contactList.add(new cContact(c));
}
}
return contactList;
}
public PageReference processSelected() {
selectedContacts = new List<Contact>();
for(cContact cCon : getContacts()) {
if(cCon.selected == true) {
selectedContacts.add(cCon.con);
}
}
value = selectedContacts.size();
System.debug('printingtcontc'+selectedContacts.size());
return null;
}
public List<Contact> getSelectedContacts(){
System.debug('printingtcontc inside get'+selectedContacts.size());
if(selectedContacts.size()>0)
return selectedContacts;
else return null;
}
public class cContact {
public Contact con {get; set;}
public Boolean selected {get; set;}
public cContact(Contact c) {
con = c;
selected = false;
}
}
public class messageDescription {
public string mensajeContenido {get; set;}
}
}
you can not reference wrapper class method with vf page. you can create a variable and the directly use it.
try above code and let me know if it works.
don't forget to mark it as best answer.
Thank you
All Answers
you can not reference wrapper class method with vf page. you can create a variable and the directly use it.
try above code and let me know if it works.
don't forget to mark it as best answer.
Thank you
public class messageDescription { public string mensajeContenido {get; set;} }
thank you