You need to sign in to do that
Don't have an account?
Priyesh Misquith 12
I need to pass this data from vf page to vf component
I am getting following error on developer console
Unknown property 'Object.attn'
Unknown property 'Object.product' for page block table
Passing wrapper class data from vf to the component
Hi how can i pass wrapper class data from vf page to component and show it in the data table or pageblock tableI have the following code which creates the wrapper object.
public class yourcontroller { public class dataWrapper { public string attn {get;set;} public string Product{get;set;} ..... //other fields in the table } public List<dataWrapper> dataContent {get;set;} //this one will be used on VF page for displaying content in datatable public void PopulateData() { dataContent = new List<dataWrapper>(); List<cc_ST_OrderConfigData__c > custom1List =[select id,Attn__c,Forwarder__c,Branch_address__c,Currency__c,AB_CODE__c,IBAN__c,Shipper__c,Country__c,Swiftcode__c,Item__r.id from cc_ST_OrderConfigData__c ]; List<ccrz__E_OrderItem__c];> custom2List = [Select id,Order__r.id,Product__r.id, Product__r.SKU__c,Product_Name__c,Quantity__c,Total_Price_c, Price__c,ItemTotal__c FROM ccrz__E_OrderItem__c]; Map<String,cc_ST_OrderConfigData__c> custom1Map = new Map<String,cc_ST_OrderConfigData__c>(); for (cc_ST_OrderConfigData__c c : custom1List) { if (!custom1Map.contansKey(c.Item__r.id)) { custom1Map.put(c.Item__r.Id,c); } } for (ccrz__E_OrderItem__c c : custom1List) { if (custom1Map.containsKey(c.Product__r.id)) { dataWrapper data = new dataWrapper(); cc_ST_OrderConfigData__c cust1 = custom1Map.get(c.Product__r.Id); data.attn = cust1.attn__c; data.product = c.product__r.id; ....... //populate other fields dataContent.add(data); } } } }
I need to pass this data from vf page to vf component
<apex:page standardController="Account" title="Order-Line Items" tabStyle="ccrz__E_Order__c" renderAs="pdf" extensions="yourcontroller" showHeader="false"> <c:MyComponent DataTable="{!dataContent}" /> </apex:page> <!---- below is the component --> <apex:component> <apex:attribute name="DataTable" description="wrapper class of two table" type="List" /> {!DataTable[0].product} <!-- I am getting value here --> <apex:pageBlock > <apex:pageBlockTable id="tbl" value="{!DataTable}" var="Odr" border="1px" width="100%" align="centre"> <apex:column headerValue="attn" value="{!Odr.attn}"/> <apex:column headerValue="product" value="{!Odr.product}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:component>
I am getting following error on developer console
Unknown property 'Object.attn'
Unknown property 'Object.product' for page block table
<apex:pageBlockTable id="tbl" value="{!dataContent}" var="Odr" border="1px" width="100%" align="centre">
<apex:column headerValue="attn" value="{!Odr.attn}"/>
<apex:column headerValue="product" value="{!Odr.product}"/>
</apex:pageBlockTable>
This is my vf page . I have component on the vf page . I want to pass wrapper data to the component. I dont want Table on Vf page. I want it inside the component.
Apex -> Vfpage -> VfComponent
page:-
Component:-
I am able to access the data using {!DataTable[0].product} but issue is when i try use apex repeat inside the component then i get this error
Unknown property 'Object.attn'
Unknown property 'Object.product' for page block table