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

unknown property string.name
hello,
Here's the error message I'm getting when trying to save my page:
Error:Error: Unknown property 'String.name' Can any one help me
VF code:
<apex:page controller="Accountonclickconlist" sidebar="false" id="pcc">
<apex:form >
<apex:pageBlock id="pgbl">
<apex:pageBlockSection title="Accounts" id="pgbs">
<apex:pageblockTable value="{!Accounts}" var="account" id="pgbtable">
<apex:column headerValue="account name"/>
<apex:commandLink value="{!account.name}" reRender="Contactblock">
<apex:actionSupport event="onclick" action="{!getrelatedcontactlist}" reRender="contactbl">
<apex:param name="accountid" assignTo="{!accountid}" value="{!account.id}">
</apex:param>
</apex:actionsupport>
</apex:commandlink>
</apex:pageblockTable>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock id="contactbl">
<apex:pageBlockSection title=" Contacts">
<apex:pageBlockTable value="{!contacts}" var="contact">
<apex:column headerValue="firstname" value="{!contact.firstname}"/>
<apex:column headerValue="Lastname" value="{!contact.lastname}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Class:
public with sharing class Accountonclickconlist
{
public list<account>accountlist{set;get;}
public list<contact>contactlist{set;get;}
public id accountid{set;get;}
public Accountonclickconlist()
{
accountlist=new list<account>();
contactlist=new list<contact>();
accountlist=[select id,name from account limit 50];
}
public void getrelatedcontactlist()
{
contactlist=[select id, Lastname, Firstname from contact WHERE Accountid=:Accountid limit 50];
}
}
Here's the error message I'm getting when trying to save my page:
Error:Error: Unknown property 'String.name' Can any one help me
VF code:
<apex:page controller="Accountonclickconlist" sidebar="false" id="pcc">
<apex:form >
<apex:pageBlock id="pgbl">
<apex:pageBlockSection title="Accounts" id="pgbs">
<apex:pageblockTable value="{!Accounts}" var="account" id="pgbtable">
<apex:column headerValue="account name"/>
<apex:commandLink value="{!account.name}" reRender="Contactblock">
<apex:actionSupport event="onclick" action="{!getrelatedcontactlist}" reRender="contactbl">
<apex:param name="accountid" assignTo="{!accountid}" value="{!account.id}">
</apex:param>
</apex:actionsupport>
</apex:commandlink>
</apex:pageblockTable>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock id="contactbl">
<apex:pageBlockSection title=" Contacts">
<apex:pageBlockTable value="{!contacts}" var="contact">
<apex:column headerValue="firstname" value="{!contact.firstname}"/>
<apex:column headerValue="Lastname" value="{!contact.lastname}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Class:
public with sharing class Accountonclickconlist
{
public list<account>accountlist{set;get;}
public list<contact>contactlist{set;get;}
public id accountid{set;get;}
public Accountonclickconlist()
{
accountlist=new list<account>();
contactlist=new list<contact>();
accountlist=[select id,name from account limit 50];
}
public void getrelatedcontactlist()
{
contactlist=[select id, Lastname, Firstname from contact WHERE Accountid=:Accountid limit 50];
}
}
Page:- Classes :- Please mark this as solution by selecting it as best answer if this solves your problem, So that if anyone has this issue this post can help
Thanks
Amit Chaudhary