You need to sign in to do that
Don't have an account?
How to parse object of wrapper class
Hello,
We have a wrapper class in our logic which we are using to display list of checkboxes and records on visualforce page.
public class wrapper
{
public Subscription_Fees__c fee {get;set;}
public boolean bSelected {get;set;}
public Wrapper(Subscription_Fees__c f, boolean selected){
fee=f;
bSelected=selected;
}
}
whenever we select record, it will pass value to controller through Param tag.
<apex:actionFunction action="{!togglecheckBox}" name="passparam" reRender="payterms, showselected">
<apex:param name="myParam1" value="" />
</apex:actionFunction>
<apex:pageBlockTable value="{!wrapper}" var="f" align="center" rules="none" width="80%" id="FeeList"> <apex:column headerValue="Select" > <apex:inputCheckbox value="{!f.bSelected}" onclick="passparam('{!f}');" /> </apex:column> <apex:column headerValue="Product Name" ><apex:outputField value="{!f.fee.product__r.name}" /> </apex:column> <apex:column headerValue="Invoice_Product_Description__c" ><apex:outputField value="{!f.fee.Invoice_Product_Description__c}" /> </apex:column> </apex:pageBlockTable>
if I am passing instance of object (onclick="passparam('{!f}'))..., it is passing the object but I am not able to parse it in controller.
Is there any way that I can do that?
Thanks,
Ashes
Wrapper:[bSelected=true, fee=Subscription_Fees__c:{Subscription__c=aCj630000000001CAA, Id=aCg630000008OM4CAM, Product__c=01t32000004TXA8AAO, Invoice_Product_Description__c=HR Only Employees, RecordTypeId=01232000000M3JaAAK, CurrencyIsoCode=USD}]
And I dont know how to parse it.
1) https://developer.salesforce.com/page/Wrapper_Class
2) https://www.minddigital.com/what-is-wrapper-class-and-how-to-use-it-in-salesforce/
Please check 1 post for parsing logic "processSelected" Please let us know if this will help you