You need to sign in to do that
Don't have an account?
Amit Jadhav 13
Unknown property 'VisualforceArrayList.name' error
Visualforce Page
<apex:page controller="thousandLimit">
<apex:form>
<apex:pageBlock >
<apex:repeat value="{!thousandBlocks}" var="block">
<apex:pageBlockTable value="{!block}" var="c">
<apex:column value="{!c.cases.name}"/>
</apex:pageBlockTable>
</apex:repeat>
</apex:pageBlock>
</apex:form>
</apex:page>
controller
public class thousandLimit {
private List<limitWrapper> thousandBlocks = new List<limitWrapper>();
private final integer listLimit;
public thousandLimit()
{
listLimit = 1000;
}
public List<limitWrapper> getthousandBlocks()
{
thousandBlocks = new limitWrapper[]{};
integer counter = 0;
integer loopCount = 0;
boolean Selected =true;
List<Account> tmpcase = new List<Account>();
for(Account c:[select id,name from Account])
{
if(counter < listLimit)
{
tmpcase.add(c);
counter++;
}
else
{
loopCount++;
thousandBlocks.add(new limitWrapper(tmpcase,Selected));
tmpcase = new List<Account>();
tmpcase.add(c);
counter = 0;
}
}
if(thousandBlocks.size() == 0)
{
loopCount++;
thousandBlocks.add(new limitWrapper(tmpcase,Selected));
}
return thousandBlocks;
}
public class limitWrapper
{
public List<Account> cases {get;set;}
public boolean Selected {get;set;}
//public integer blockNumber {get;set;}
public limitWrapper(List<Account> accs, boolean i)
{
cases = accs;
Selected = i;
}
}
}
<apex:page controller="thousandLimit">
<apex:form>
<apex:pageBlock >
<apex:repeat value="{!thousandBlocks}" var="block">
<apex:pageBlockTable value="{!block}" var="c">
<apex:column value="{!c.cases.name}"/>
</apex:pageBlockTable>
</apex:repeat>
</apex:pageBlock>
</apex:form>
</apex:page>
controller
public class thousandLimit {
private List<limitWrapper> thousandBlocks = new List<limitWrapper>();
private final integer listLimit;
public thousandLimit()
{
listLimit = 1000;
}
public List<limitWrapper> getthousandBlocks()
{
thousandBlocks = new limitWrapper[]{};
integer counter = 0;
integer loopCount = 0;
boolean Selected =true;
List<Account> tmpcase = new List<Account>();
for(Account c:[select id,name from Account])
{
if(counter < listLimit)
{
tmpcase.add(c);
counter++;
}
else
{
loopCount++;
thousandBlocks.add(new limitWrapper(tmpcase,Selected));
tmpcase = new List<Account>();
tmpcase.add(c);
counter = 0;
}
}
if(thousandBlocks.size() == 0)
{
loopCount++;
thousandBlocks.add(new limitWrapper(tmpcase,Selected));
}
return thousandBlocks;
}
public class limitWrapper
{
public List<Account> cases {get;set;}
public boolean Selected {get;set;}
//public integer blockNumber {get;set;}
public limitWrapper(List<Account> accs, boolean i)
{
cases = accs;
Selected = i;
}
}
}
Can you check with c.cases.name. I am not sure if there is any field called name in cases.
Please let me know if you have any doubt.
thanks
cases is a name of list<Account> not a object
thanks
Amit Jadhav