You need to sign in to do that
Don't have an account?
Nitish Singh 22
How to pass array of SObject from my visualforce controller to apex component
I have an apex component :
<apex:component controller="wk_NotesController" id="tst" allowDML="true">
<apex:attribute name="componentValue" description="Attribute on the component."
type="Account_Notes_and_Alerts__c" assignTo="{!controllerValue}"/>
<script type='text/javascript' src='/canvas/sdk/js/publisher.js'></script>
<apex:includeScript value="/support/console/25.0/integration.js" />
<apex:form >
<apex:commandButton value="Show Pop up" id="btn" action="{!showPopup}" rerender="tstpopups"/>
<apex:outputPanel id="tstpopups">
<apex:outputPanel styleClass="popupBackground" layout="block" rendered="{!displayPopUp}"/>
<apex:outputPanel styleClass="custPopup" layout="block" rendered="{!displayPopUp}">
<div class="section group">
<div id="cmtContainer">
<!-- Comments box -->
<apex:outputLabel styleClass="label" value="{!$ObjectType.Account_Notes_and_Alerts__c.fields.Note_Text__c.Label}" />
<apex:inputField id="txtcmnt" value="{!componentValue.Note_Text__c}" styleClass="box"/>
</div>
<div id="cmtAdditionalPropContainer" style="overflow: auto;">
<!-- NOte Type Drpdwn -->
<apex:outputLabel styleClass="label" value="{!$ObjectType.Account_Notes_and_Alerts__c.fields.Note_Type__c.Label}" />
<apex:inputField id="drpdwn" value="{!componentValue.Note_Type__c}" styleClass="box"/>
</div>
<div class="btn-section">
<apex:commandButton action="{!saveValues}" value="Save" id="btnSave" />
<apex:commandButton value="Hide Pop up" action="{!closePopup}" rerender="tstpopups"/>
</div>
</div>
</apex:outputPanel>
</apex:outputPanel>
</apex:form>
To this apex component I want to pass an Array of SObject typefrom Controller class
<apex:component controller="wk_NotesController" id="tst" allowDML="true">
<apex:attribute name="componentValue" description="Attribute on the component."
type="Account_Notes_and_Alerts__c" assignTo="{!controllerValue}"/>
<script type='text/javascript' src='/canvas/sdk/js/publisher.js'></script>
<apex:includeScript value="/support/console/25.0/integration.js" />
<apex:form >
<apex:commandButton value="Show Pop up" id="btn" action="{!showPopup}" rerender="tstpopups"/>
<apex:outputPanel id="tstpopups">
<apex:outputPanel styleClass="popupBackground" layout="block" rendered="{!displayPopUp}"/>
<apex:outputPanel styleClass="custPopup" layout="block" rendered="{!displayPopUp}">
<div class="section group">
<div id="cmtContainer">
<!-- Comments box -->
<apex:outputLabel styleClass="label" value="{!$ObjectType.Account_Notes_and_Alerts__c.fields.Note_Text__c.Label}" />
<apex:inputField id="txtcmnt" value="{!componentValue.Note_Text__c}" styleClass="box"/>
</div>
<div id="cmtAdditionalPropContainer" style="overflow: auto;">
<!-- NOte Type Drpdwn -->
<apex:outputLabel styleClass="label" value="{!$ObjectType.Account_Notes_and_Alerts__c.fields.Note_Type__c.Label}" />
<apex:inputField id="drpdwn" value="{!componentValue.Note_Type__c}" styleClass="box"/>
</div>
<div class="btn-section">
<apex:commandButton action="{!saveValues}" value="Save" id="btnSave" />
<apex:commandButton value="Hide Pop up" action="{!closePopup}" rerender="tstpopups"/>
</div>
</div>
</apex:outputPanel>
</apex:outputPanel>
</apex:form>
To this apex component I want to pass an Array of SObject typefrom Controller class
You can go throght following to understand how to do that :
http:// https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_attribute.htm (http:// https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_attribute.htm)