I have a visualforce page with an apex:component in it. (This component is for headers, used in various other places).
<apex:page title="" ... >
<apex:form>
<c: HeaderV2 />
</apex:form>
</apex:page>
Here's my component.
<apex:component controller="TemplateController" allowDML="true">
<apex:commandLink action="{!UpdateABC}" />
</apex:component>
The commandLink doesn't work, because there is no Apex:form in the component. So, I add the apex:form to the component.
<apex:component controller="TemplateController" allowDML="true">
<apex:form>
<apex:commandLink action="{!UpdateABC}" />
</apex:form>
</apex:component>
Now, my whole page gives error because there are 2 apex:forms! (one from the page and the other from the component) How to resolve this?