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

Custom visualforce list view page with group select enabled
I'm stuck. I've created a custom VF page that lists some records.
I want to include the ListView select option so the user can pick some of them and update them, List this....

How do I get the checkbox to work for a cutom VF page??
I want to include the ListView select option so the user can pick some of them and update them, List this....
How do I get the checkbox to work for a cutom VF page??
<apex:page Controller="UpdateAssignments">
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons location="top">
<apex:commandButton value="Update Records" action="{!UpdateRecords}"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!assignment}" var="a">
<apex:column style="width:100px" headerValue="Subscription Id" value="{! a.OrderApi__Subscription__r.OrderApi__Account__r.Name}"/>
<apex:column style="width:100px" headerValue="Subscription Id" value="{! a.OrderApi__Subscription__r.Name}"/>
<apex:column style="width:100px" headerValue="Assignment Name" value="{! a.name }"/>
<apex:column style="width:100px" headerValue="Active?" value="{! a.OrderApi__Is_Active__c }"/>
<apex:column style="width:100px" headerValue="Assignment Item Name" value="{! a.OrderApi__Item__r.Name }"/>
<apex:column style="width:100px" headerValue="Subscription Item Name" value="{! a.OrderApi__Subscription__r.OrderApi__Item__r.Name }"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
public class UpdateAssignments {
public List<OrderApi__Assignment__c> assignment { get; private set; }
public UpdateAssignments () {
assignment = [SELECT Id,
Name,
OrderApi__Is_Active__c,
OrderApi__Item__r.Id,
OrderApi__Item__r.Name,
OrderApi__Subscription__r.Id,
OrderApi__Subscription__r.Name,
OrderApi__Subscription__r.OrderApi__Item__r.Id,
OrderApi__Subscription__r.OrderApi__Item__r.Name,
OrderApi__Subscription__r.OrderApi__Account__r.Name
FROM OrderApi__Assignment__c
WHERE OrderApi__Item__r.id = null
AND OrderApi__Subscription__r.Id != null
AND OrderApi__Subscription__r.OrderApi__Item__r.Name != 'Membership Individual'
AND OrderApi__Is_Active__c = True
LIMIT 1000 ];
}
public void UpdateRecords() {
For ( OrderApi__Assignment__c a : assignment){
system.debug(a.id);
}
}
}
You can use an inner class commonly known as wrapper class in programming terms. This is how it works:
VF Page Code Apex Controller Code
If I revert back to apex:pageBlockTable then the button does work, as per my original code. But the Checkbox doesn't display for the Boolean defined in the innerclass.
Hence if I use apex:repeat I can't get a button to call the Apex update method. If I use apex:pageBlockTable I can't get the Boolean to render as a checkbox.
What do you suggest please?
VF PAGE CODE: APEX CLASS CODE: