We have a block of code that will be repeated several times in several VF pages. I didn't want to have to put it in each and then in the future have to find all the references to update it. My common code merely asks for text and picklist inputs. The following is just a subset of all the fields that will be asked for. I tried using apex:include and it complained about having a FORM and we cannot nest FORMs. The VF page I need it included on (along with several others if I can get this working) has a FORM tag already. Scrapped the include idea and thought I'd make it a component and use <c:FRDContact /> where FRDContact is the name of the component created. It gives me an error on all my fields - Error: Unknown property 'inputContactFirstName' This is my component:

<apex:component >
    <apex:pageblockSection >
        <apex:pageblocksectionItem >
            <apex:outputLabel styleClass="FRDformApplicationLabel" title="Contact name">First Name:
            <apex:inputtext value="{!inputContactFirstName}" styleClass="FRDformApplicationInput"/>
            <apex:param value="{!inputContactFirstName}" name="inputContactFirstName"/>
        <apex:pageblockSectionItem >

My VF has

<!-- new source, get new contact info -->           
            <apex:pageBlockSection rendered="{!tempObj.NewSource__c}" columns="3">
            <c:FRDContact />

What can I do so that I don't have to cut-n-paste lots of code? Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.