Because i don't realy understand your actual problem without any code provided i can only guess. But here are some general minds to this topic.
It works fine until the component don't have "static" elements like css styles or javascript functions whith remain the same (visualforce objects like output panels get unique ids).
For example we have the following component "MyComponent":
<apex:component>
<apex:attribute name="customColor" type="String" required="false"/>
<style>
.myStyle { color:{!customColor}; }
</style>
<apex:outputText styleClass="myStyle" value="Please click here" />
</apex:component>
Now we will insert this component twice at our page and give two different values for the "customColor". First one we want to get red color, for the second one - green:
<apex:page>
Text 1: <c:MyComponent customColor="red" /> <br/>
Text 2: <c:MyComponent customColor="green" />
</apex:page>
The result looks like this:
This is because the same css style was rendered twice at the main page and the second one won, that is overrides the first style. The same thing happens with javascript functions.
To work around this problem just insert an unique id attribute to the component and provide each static object with this parameter. Our component will look then like this:
<apex:component>
<apex:attribute name="id" description="The unique id" type="String" required="true"/>
<apex:attribute name="customColor" description="" type="String" required="false"/>
<style>
.myStyle{!id} { color:{!customColor}; }
</style>
<apex:outputText styleClass="myStyle{!id}" value="Please click here" />
</apex:component>
At the page we must to enter an id for each instance of component:
<apex:page>
Text 1: <c:MyComponent id="First" customColor="red" /> <br/>
Text 2: <c:MyComponent id="Second" customColor="green" />
</apex:page>
And now our main page will be rendered correctly, because each has an unique id:
In your VF page, use both components, inputField and outputField with opposite rendering condition. What you have to pay attention to is to update the components everytime an action specified in actionSupport is called. You can do so by wrapping both inputField and outputField components in an outputPanel and specifying the outputPanel's ID as the element to rerender on actionSupport's finish.
<apex:selectList id="birthPlace" value="{!birthPlace}">
<apex:selectOption itemLabel="--None--" itemValue="none" />
<apex:selectOption itemLabel="Poland" itemValue="pld" />
<apex:selectOption itemLabel="Europe" itemValue="erp" />
<apex:actionSupport event="onchange" action="{!boolChange}" rerender="nameFields" />
</apex:selectList>
<apex:outputPanel id="nameFields">
<apex:outputField label="Name" value="{!Chopin}" rendered="{!pianoBool}" />
<apex:inputField label="Name" value="{!Chopin}" rendered="{!NOT(pianoBool)}" />
</apex:outputPanel>
Hope it helps!
Best Answer
Cannot take credit for this :
How do I pass a parameter from component to a Visualforce page?
Since your component lives separated from the page any change on the component never calls the controller thereby the value of the fullname string is never set. To overcome this we use an action support to call the controller on the input field change event,
controller: ( Add your extra code over this)
component:
Page: