function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
priya burghatepriya burghate 

Dyanamic component....

Hi All,
I have 3 classes in and their  individual vf page...In all the classes Categorey,Category Area,Category cluster fields are there which are dependent picklist . And I want to create one component where objectname and there fields are taken automatically through the vf page . whereever i added this component only those object fields which are corresponding to that vf page should dislplay...
can anyone please help?

Hi Priya,

you can pass attribute values in your component from VF page, and using those values you can implement your custom logic in your component controller. You can use below code snippet :

<apex:component controller="yourControllerName" access="global">
          <apex:attribute name="objectName" type="String" assignTo="{!controllerPropertyToassignValue}"  />
          <apex:attribute name="fieldName"   type="String" assignTo="{!controllerPropertyToassignValue}"  />


         <c:componentName objectName="{!valueToBind}" fieldName="{!valueToBind}"/>

Please let me know if you need more help.