geoffrey.mcgill
Dec 16, 2008, 2:45 PM
For the v0.7 release we will be implementing a breaking change to the .AutoLoad property.
The .AutoLoad property allows for the dynamic (Ajax) loading of an external Page into the the <Body> of any Control that inherits from Panel, such as <ext:Panel>, <ext:Window> and <ext:Tab>.
In an early release of the Coolite Toolkit, the .AutoLoad property was implemented using a simple "string" data type which expected a local or remote url.
In v0.6 we introduced the .AutoLoadIFrame property which would automatically add an <iframe> to the Panels <Body> and load the url into that <iframe>.
With v0.7 we're adding support for many more AutoLoad properties and need more flexibility in the object/markup model. The .AutoLoad property will now accept a LoadConfig object which includes new extra and enhanced functionality.
The following code sample demonstrates the syntactic differences between the old AutoLoad[typeof string] property and new AutoLoad[typeof LoadConfig] property.
Example
// Existing (v0.6)
<ext:Panel
ID="Panel1"
runat="server"
Title="Parent"
Height="200"
AutoLoad="Child.aspx"
/>
// New (v.07)
<ext:Panel
ID="Panel1"
runat="server"
Title="Parent"
Height="200">
<AutoLoad Url="Child.aspx" />
</ext:Panel>
The move to the new <AutoLoad> property also affects the existing (v0.6) .AutoLoadIFrame property. We've added a new "Mode" Enum property to the LoadConfig which enables the developer to specify whether the url should be set to "Merge" the url's html into the <Body> of the Panel, or "IFrame" which creates an <iframe> in the <Body> and loads the url into that <iframe>.
The following code sample demonstrates how to replicate the functionality of the previous .AutoLoadIFrame property.
Example
// Existing (v0.6)
<ext:Panel
ID="Panel1"
runat="server"
Title="Parent"
Height="200"
AutoLoadIFrame="http://www.google.com/"
/>
// New (v0.7)
<ext:Panel
ID="Panel1"
runat="server"
Title="Parent"
Height="200">
<AutoLoad Url="http://www.google.com/" Mode="IFrame" />
</ext:Panel>
"Merge" creates one document, "IFrame" creates two documents. With Merge, the two Pages become one, which functions differently that using a UserControl (.ascx). The two documents/Pages, HTML and DOM structure become one. If the Parent Panel is contained within a <form>, the Child Page can not contain a <form>.
All Coolite Toolkit controls DO NOT require a <form runat="server">. They can be placed both inside and outside of a <form runat="server">.
The .AutoLoad property allows for the dynamic (Ajax) loading of an external Page into the the <Body> of any Control that inherits from Panel, such as <ext:Panel>, <ext:Window> and <ext:Tab>.
In an early release of the Coolite Toolkit, the .AutoLoad property was implemented using a simple "string" data type which expected a local or remote url.
In v0.6 we introduced the .AutoLoadIFrame property which would automatically add an <iframe> to the Panels <Body> and load the url into that <iframe>.
With v0.7 we're adding support for many more AutoLoad properties and need more flexibility in the object/markup model. The .AutoLoad property will now accept a LoadConfig object which includes new extra and enhanced functionality.
The following code sample demonstrates the syntactic differences between the old AutoLoad[typeof string] property and new AutoLoad[typeof LoadConfig] property.
Example
// Existing (v0.6)
<ext:Panel
ID="Panel1"
runat="server"
Title="Parent"
Height="200"
AutoLoad="Child.aspx"
/>
// New (v.07)
<ext:Panel
ID="Panel1"
runat="server"
Title="Parent"
Height="200">
<AutoLoad Url="Child.aspx" />
</ext:Panel>
The move to the new <AutoLoad> property also affects the existing (v0.6) .AutoLoadIFrame property. We've added a new "Mode" Enum property to the LoadConfig which enables the developer to specify whether the url should be set to "Merge" the url's html into the <Body> of the Panel, or "IFrame" which creates an <iframe> in the <Body> and loads the url into that <iframe>.
The following code sample demonstrates how to replicate the functionality of the previous .AutoLoadIFrame property.
Example
// Existing (v0.6)
<ext:Panel
ID="Panel1"
runat="server"
Title="Parent"
Height="200"
AutoLoadIFrame="http://www.google.com/"
/>
// New (v0.7)
<ext:Panel
ID="Panel1"
runat="server"
Title="Parent"
Height="200">
<AutoLoad Url="http://www.google.com/" Mode="IFrame" />
</ext:Panel>
"Merge" creates one document, "IFrame" creates two documents. With Merge, the two Pages become one, which functions differently that using a UserControl (.ascx). The two documents/Pages, HTML and DOM structure become one. If the Parent Panel is contained within a <form>, the Child Page can not contain a <form>.
All Coolite Toolkit controls DO NOT require a <form runat="server">. They can be placed both inside and outside of a <form runat="server">.