You need to sign in to do that
Don't have an account?
geetha b 8
Please resolve my problem in wrapper class
Here is mu code
<apex:page controller="testWrapper">
<!-- Using wrapper class -->
<apex:form>
<apex:pageBlockSection>
<apex:pageBlockTable value="{!books}" var="b">
<apex:column width = "25px">
<apex:inputCheckbox value="{!b.checked}" />
</apex:column>
<apex:column value="{!b.b1.Name}"/>
<apex:column value="{!b.b1.Price__c}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:form>
</apex:page>
---------------------------------------------------class--------------------------------------------------
public class testWrapper
{
public List<Wrapper> books{get; set;}
public testWrapper()
{
books = new List<Wrapper>();
for(Book__c b1 : [select name,Price__c from Book__c])
{
books.add(new wrapper(b1));
}
}
public class Wrapper
{
public boolean checked {get; set;}
public Book__c bl {get; set;}
public Wrapper(Book__c bl)
{
this.bl = bl;
this.checked = false;
}
}
}
<apex:page controller="testWrapper">
<!-- Using wrapper class -->
<apex:form>
<apex:pageBlockSection>
<apex:pageBlockTable value="{!books}" var="b">
<apex:column width = "25px">
<apex:inputCheckbox value="{!b.checked}" />
</apex:column>
<apex:column value="{!b.b1.Name}"/>
<apex:column value="{!b.b1.Price__c}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:form>
</apex:page>
---------------------------------------------------class--------------------------------------------------
public class testWrapper
{
public List<Wrapper> books{get; set;}
public testWrapper()
{
books = new List<Wrapper>();
for(Book__c b1 : [select name,Price__c from Book__c])
{
books.add(new wrapper(b1));
}
}
public class Wrapper
{
public boolean checked {get; set;}
public Book__c bl {get; set;}
public Wrapper(Book__c bl)
{
this.bl = bl;
this.checked = false;
}
}
}
still it is showing the error Error: Unknown property 'testWrapper.Wrapper.b1'
thank you guys
Replace it with bl.