You need to sign in to do that
Don't have an account?
App_Dev1
Controllers in compositions
Is it possible to use multiple controllers in a composition?
In the example from p. 92 of the doc:
<apex:page>
<apex:composition template="composition">
<apex:define name="header">(page) This is the header of mypage</apex:define>
<apex:define name="body">(page) This is the body of mypage</apex:define>
</apex:composition>
</apex:page>
What is the behavior when my header page uses controller A and body uses B?
What I'm seeing now is that the last referenced controller "wins" and becomes the controller for the whole page. I think this also happens with includes.
IMHO the composition is already powerful for building reusable visual components, but would be even more so if each define block had completely independent state/logic.
In the example from p. 92 of the doc:
<apex:page>
<apex:composition template="composition">
<apex:define name="header">(page) This is the header of mypage</apex:define>
<apex:define name="body">(page) This is the body of mypage</apex:define>
</apex:composition>
</apex:page>
What is the behavior when my header page uses controller A and body uses B?
What I'm seeing now is that the last referenced controller "wins" and becomes the controller for the whole page. I think this also happens with includes.
IMHO the composition is already powerful for building reusable visual components, but would be even more so if each define block had completely independent state/logic.
Also, we are deprecating <apex:include> - this will be replaced by the significantly more powerful and elegant custom component feature in Spring '08. One major shortcoming of <apex:include> is data passing from the container page to the included page. This is completely addressed by custom components by providing the ability to define a component's attributes, data types for those attributes, requiredness, etc...
Message Edited by dchasman on 12-25-2007 02:06 PM