I know standard Salesforce has component dependencies on certain components; I want to recreate that functionality. For example if I attempt to use <apex:commandButton>
outside of a <apex:form>
wrapper I get the following error:
Error: <apex:commandButton> must occur between <apex:form></apex:form> tags
The requirement is as follows:
<apex:form>
<apex:commandbutton/> // required inside apex:form
</apex:form>
I want to be able to create this same dependency for a custom component. Is this possible and if so how?
For example if I put <c:innerComponent>
somewhere on the page, I want it to prevent compiling and provide an error that that tag must be within an <c:outerComponent>
tag
Error: <c:innerComponent> must occur between <c:outerComponent></c:outerComponent> tags
Meaning if I want to use the innerComponent
then the outerComponent
is required
<c:outerComponent>
<c:innerComponent/> // required inside c:outerComponent
</c:outerComponent>
<apex:form>
only in vf page not in component.. so when you add commandbutton in cmp then it will inside vfapex:form
<c:innerComponent>
and<c:outerComponent>
innerComponent
toinnerComponent_UseWithinOuterComponent
to help avoid issues