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
AnjaneyluAnjaneylu 

Unable to display the fields which were in the custom component..

hi experts,
Here i created one custom component. when i call this custom component in vf page it is not able to displaying the fields..
but in some of the pages it is displaying the fields which were in the custom component..
So please suggest me,

Thanks in Advance,
Anji
JyothsnaJyothsna (Salesforce Developers) 
Hi Anjireddy,

Please check the below sample code.

Visualforce component
 
<apex:component >

 <apex:attribute name="Contact" type="Contact" 
    description="The contact to edit" required="true" />
    <apex:pageBlock >
    <apex:pageBlockSection >
     <apex:inputField value="{!Contact.Salutation}"/>
<apex:inputField value="{!Contact.FirstName}"/>
<apex:inputField value="{!Contact.LastName}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:component>

Visualforce Page
 
<apex:page standardController="Contact">
  <apex:pageMessages />
  <apex:form >
    <c:contactComponent contact="{!contact}"/>
  </apex:form>
</apex:page>

Output

User-added image


Hope this helps you!
Best Regards,
Jyothsna
AnjaneyluAnjaneylu
Thanks Jyothsna,,
Here the issue is my component is working in some another pages, 
But in one of the page it is not displaying fields..
im unable to know the reason why it is not showing ...

Thanks in Advacne,
Anji.