No, only one controller. Should we have one for each section? Does
that mean we should have a separate business, command, control, view,
and VO for each section as well?
Here is the code...
index.mxml
=================================================
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
verticalGap="0"
backgroundColor="#7D8FA8"
xmlns:mx="http://www.macromedia.com/2003/mxml" xmlns="*"
pageTitle="CPE">
<mx:Script>
<![CDATA[
[Embed(symbol="cursorStretch")]
var cursorStretch:String;
var selectedUrl;
var currItem:Number;
var url;
function selectionChanged(event) {
currItem = sectionTree.selectedIndex;
url = sectionModel.section[currItem].url
loader.contentPath = url
loader.executeBindings();
}
function getLoaderUrl(url) {
return url+".swf";
}
]]>
</mx:Script>
<!-- Import the model for the navigation -->
<mx:Model id="sectionModel" source="sections.xml"/>
<mx:VBox width="100%" height="100%">
<mx:Panel id="header" width="100%" height="125">
<mx:Text text="CPE Seminar Managemnt"/>
</mx:Panel>
<mx:HBox width="100%" height="100%">
<mx:Panel id="menu" title="Select a Section" width="215"
height="100%" scroll="0" >
<mx:Tree id="sectionTree" height="100%"
change="selectionChanged()" dataProvider="{sectionModel}"
openDuration="0"/>
</mx:Panel>
<mx:Panel id="main" title="Replace with section title"
width="100%"
height="100%">
<mx:Loader id="loader"
contentPath="{getLoaderUrl(url)}"
scaleContent="false" showBusyCursor="true" width="100%" height="100%"/>
</mx:Panel>
</mx:HBox>
<mx:Panel id="footer" width="100%" height="25"></mx:Panel>
</mx:VBox>
</mx:Application>
Example Section (facilityData.mxml) *note the comments in this block.
===============================================================
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.macromedia.com/2003/mxml"
xmlns:ppcBusiness="com.cpe.business.*" <!-- if this is
removed, each
section will load -->
xmlns:ppcView="com.cpe.view.*" <!-- if this is removed, each
section
will load -->
initialize="initCairngorm09Application()" <!-- if this is
removed,
each section will load -->
pageTitle="Facility Data"
verticalGap="0"
width="1001"
height="695"
marginLeft="10"
marginRight="10">
<!-- ***********************-->
<!-- if this is removed, each section will load. Otherwise only one
section at a time will load -->
<ppcView:FacilityDataViewHelper name="facilityDataViewHelper"
view="{ this }" />
<mx:Script source="handlers/viewStackHandler.as" />
<mx:Script>
<![CDATA[
import com.iterationtwo.cairngorm.control.*;
import mx.utils.Delegate;
public var controller = com.cpe.control.Control;
public function initCairngorm09Application() : Void
{
new com.cpe.control.Control();
}
]]>
</mx:Script>
<!-- /if this is removed, each section will load. Otherwise only one
section at a time will load -->
<!-- /***********************-->
<ppcBusiness:Services id="Services" />
<mx:Canvas>
<mx:Button label="Add New Facililty" x="0"
click="changeView()"
height="22" width="150" id="changeViewButton" />
</mx:Canvas>
<mx:ViewStack id="bodyStack" width="100%" height="100%" >
<mx:Canvas id="Search">
<mx:VBox width="100%" height="625">
<ppcView:locationsSearchView
id="locationsSearchView" />
<ppcView:locationsResultView
id="locationsResultView"/>
</mx:VBox>
</mx:Canvas>
<mx:Canvas id="Edit" width="100%" height="100%">
<mx:VBox width="100%" height="100%">
<mx:Label text="Header Information will go
here..."/>
<mx:TabNavigator>
<mx:Canvas id="locations" label="Hotel
Details">
<ppcView:locationsEditView
id="locationsEditView" />
</mx:Canvas>
<mx:Canvas id="locationContacts"
label="Hotel Contact Information">
<!--<ppcView:locationContactsEditView
id="locationContactsEditView" />-->
</mx:Canvas>
<mx:Canvas id="meetingRooms"
label="Hotel Mtg Room Information">
<ppcView:meetingRoomsEditView
id="meetingRoomsEditView" />
</mx:Canvas>
<mx:Canvas id="locationFoodCosts"
label="Hotel Food and Beverage
Information">
<!--<ppcView:locationFoodCostsEditView
id="locationFoodCostsEditView" />-->
</mx:Canvas>
<mx:Canvas id="locationGuestRooms"
label="Hotel Guest Room
Information">
<!--<ppcView:locationGuestRoomsEditView
id="locationGuestRoomsEditView" />-->
</mx:Canvas>
</mx:TabNavigator>
</mx:VBox>
</mx:Canvas>
</mx:ViewStack>
</mx:Application>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/