?
Solved

getting parse error on web services

Posted on 2007-11-20
8
Medium Priority
?
1,999 Views
Last Modified: 2013-12-24
I've created a state in flex and am getting an parse error at <mx:Web Service>.  The web service is being called from within a child state. here is the logic.  any idea?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="720" height="552"  creationComplete="init()">
<mx:Style source="assets/style.css" />
	
	
<mx:states>
		<mx:State name="coursesummary">
			<mx:RemoveChild target="{dgPeeps}"/>
			<mx:RemoveChild target="{lbl_welcome1}"/>
			<mx:AddChild relativeTo="{panel1}" position="lastChild">
				<mx:LinkButton x="535" y="8" label="&lt; Back to Course List" click="currentState=''" id="linkbutton1"/>
			</mx:AddChild>
			<mx:AddChild relativeTo="{panel1}" position="lastChild">
				
				
				<mx:Script>
 
	<![CDATA[
			//import mx.collections.SortField;
			//import mx.collections.Sort;
			//import mx.collections.ArrayCollection;
			import mx.rpc.events.ResultEvent
			import mx.rpc.events.FaultEvent;
			import mx.controls.Alert;
			//import mx.rpc.soap.WebService;
			
		//public var courseTitle:String = "{courseTitle}";
		[Bindable]
		public var courseCode:String = "H2KN101";
		public var vendorName:String = "Knit-a-Doggie-Sweater Productions";
		[Bindable]
		public var courseDescription:String = "Teach yourself how to knit! Then if you are ever selected for jury duty you can knit the hours away!";
		//1
		public var txt_lOneTitle:String = "Fundamentals";
		public var txt_lOneSOneTitle:String = "What You Will Need";
		[Bindable]
		public var txt_lOneSOneKW:String = "knitting needles, types of yarn";
		public var txt_lOneSTwoTitle:String = "The Basics";
		public var txt_lOneSTwoKW:String = "basic stitches, stitch techniques, purl stitches,unraveling techniques, practice stitches";
		//2
		public var txt_lTwoTitle:String = "Intermediate Knitting";
		public var txt_lTwoSOneTitle:String = "Patterns and Assembly";
		public var txt_lTwoSOneKW:String = "basic knitting patterns,more types of yarn, how to reepair knitting mistakes,slipping stitches,cable knitting,grafting,knitting tips and tricks";
		//3
		public var txt_lThreeTitle:String = "Advanced Knitting";
		public var txt_lThreeSOneTitle:String = "Complex Patterns and Stitches";
		public var txt_lThreeSOneKW:String = "complex knitting assemblies,advanced repair techniques,multiple stitch techniques,advanced knitting patterns,knitting with multiple weaving ends";
		
			[Bindable]
			public var courseTitle:String;
			
		 [Bindable]
         public var sResult:String;//I guess this needs to be bindable to use it as a variable below
         [Bindable]
         public var endPath:String =  "http://localhost/com/ws/flexcom/NC_course.cfc?wsdl";
         [Bindable]
         public var wsUrl:String;
         [Bindable]
		 public var g_HostString:String;
		 [Bindable]
		 public var g_ContextRoot:String;
		 [Bindable]
		 public var g_BaseURL:String;
	
		private function init():void{
			//wsUrl = String(getHostName());
			
			//mx.controls.Alert.show("wsUrl");
			getData();
		}
		
	//get local environment	  
	 private function getHostName():String{
	     g_BaseURL = Application.application.url;
		lbl_base.text=g_BaseURL;
	     var pattern1:RegExp = new RegExp("http://[^/]*/");
	     
     if (pattern1.test(g_BaseURL) == true) {
         g_HostString = pattern1.exec(g_BaseURL).toString();
     } else{
        g_HostString = "http://localhost/";
     }   
     
     g_HostString = String(g_HostString+endPath);
    // lbl_g_host.text=g_HostString;
     return g_HostString;  
    ///return "http://localhost/com/local/user.cfc?wsdl";
  }
		
		private function getData():void{
			wsUserData.getUserValue.send();	
		}
		
		private function showFault(event:FaultEvent):void{
			txt_courseTitle.text=event.fault.faultDetail+":"+event.fault.faultString+":"+event.fault.message;
			//trace("error");
		}
		
		private function wsResult(event:ResultEvent):void{
			//trace("error");
			courseTitle=event.result as String;
			txt_courseTitle.text=courseTitle;
		}
		
		private function showUpdBtn():void{
				btn_save.visible=true;
				btn_save.setStyle("color","red");
				btn_save.label="Click here to save your changes.";
		}
		
		//update courseInfo
		private function updateCourse():void{
			wsUserData.updUserValue.send();
			btn_save.setStyle("color","green");
			btn_save.label="Your changes have been saved.";
			
			//btn_save.visible=false;
		}
		//{String(this.g_HostString)}
		//http://localhost/dev/com/local/user.cfc?wsdl
		//{String(getHostName())}
]]>
</mx:Script>
	
	<mx:WebService id="wsUserData"  
		wsdl="{String(g_HostString)}"
		fault="{showFault(event)}">
		<mx:operation name="getUserValue" result="wsResult(event)">
			<mx:request>
				<courseId>
					1
				</courseId>
			</mx:request>
		</mx:operation>
		<mx:operation name="updUserValue">
			<mx:request>
				<courseId>
					1
				</courseId>
				<courseTitle>
					{txt_courseTitle.text}
				</courseTitle>
			</mx:request>
		</mx:operation>
	</mx:WebService>
	
	
	
	
	<mx:TabNavigator x="10" y="51" width="100%" height="680" id="tb_nav" paddingTop="0" borderColor="#FFFFFF" borderThickness="0" color="#223a91">
									
									
									
									<mx:HBox label="COURSE SUMMARY" x="100" y="100" width="680" height="420" id="hb_summary" color="#223a91">
										<mx:Panel id="pnl_summary"    styleName="panelClass"  layout="absolute" height="420" width="680" dropShadowEnabled="false" color="#223a91">
											<mx:Label text="Title:" id="lbl_courseTitle"  x="78" y="72" styleName="header"/>
											<mx:Label text="Code:" x="74" y="103" styleName="header" id="lbl_courseCode"/>
											<mx:TextInput x="119" y="68"  id="txt_courseTitle" fontWeight="bold" fontSize="12"  color="#223a91" change="showUpdBtn()"/><!--change="showUpdBtn()"-->
											<mx:TextInput x="110" y="99" text="{courseCode}" id="txt_courseCode"  styleName="header"/>
											<mx:TextArea x="110" y="129" width="306" styleName="header" text="{courseDescription}"/>
											<mx:Label x="28" y="130" text="Description:"  styleName="header">
												<mx:toolTip><![CDATA[Provide a one paragraph summary of your Course we can use as a product description.  Explain why consumers should access your Course.]]></mx:toolTip>
											</mx:Label>
										
										</mx:Panel>
									</mx:HBox>
									
									<mx:VBox label="lesson1" x="100" y="100" height="100%" width="100%" visible="true">
											<mx:Panel   id="pnl_lesson1" styleName="panelClass" layout="absolute" height="100%" width="100%">
													<mx:Label text="Lesson 1" x="10" y="34">
															<mx:toolTip><![CDATA[One “Lesson Heading” for each third of the course.  All Courses will be divided into three parts.]]></mx:toolTip>
													</mx:Label>
													<mx:Label text="Keywords" x="10" y="88" toolTip="Provide 5-20 “key words” for each section.  More complex sections will require more key words.  Remember, users will select your content based on “key word” searches so the more key words you submit for each section the better chance your title(s) will be selected."/>
													<mx:TextArea x="72" y="87" width="614" height="18" fontWeight="normal" text="{txt_lOneSOneKW}" id="lOneSOneKW"/>
													<mx:Label x="31" y="-21" text="{courseTitle}"/>
													<mx:TextInput x="72" y="34" id="lOneTitle" text="{txt_lOneTitle}" fontWeight="bold"/>
													<mx:Button x="593" y="10" label="Add section" visible="true"/>
													<mx:Label text="Section 1" x="9" y="62" id="lbl_lOneKW2"/>
													<mx:TextInput x="72" y="60" text="{txt_lOneSOneTitle}" id="lOneSOneTitle"/>
													<mx:Label text="Keywords" x="11" y="132">
															<mx:toolTip><![CDATA[Provide 5-20 “key words” for each section.  More complex sections will require more key words.  Remember, users will select your content based on “key word” searches so the more key words you submit for each section the better chance your title(s) will be selected.]]></mx:toolTip>
													</mx:Label>
													<mx:TextArea x="73" y="131" width="613" height="18" fontWeight="normal" text="{txt_lOneSTwoKW}" id="lOneSTwoKW"/>
													<mx:Label text="Section 2" x="10" y="106" id="lbl_lOneKW3"/>
													<mx:TextInput x="73" y="104" text="{txt_lOneSTwoTitle}" id="lOneSTwoTitle"/>
											</mx:Panel>		
									</mx:VBox>
									<mx:HBox label="lesson2" x="100" y="100" width="100%" height="100%">
											<mx:Panel  id="pnl_lesson2" styleName="panelClass" height="100%" width="100%" layout="absolute">
													<mx:Label text="Lesson 2" x="10" y="34">
															<mx:toolTip><![CDATA[One “Lesson Heading” for each third of the course.  All Courses will be divided into three parts.]]></mx:toolTip>
													</mx:Label>
													<mx:Label text="Keywords" x="10" y="88" id="lbl_lOneKW" toolTip="Provide 5-20 “key words” for each section.  More complex sections will require more key words.  Remember, users will select your content based on “key word” searches so the more key words you submit for each section the better chance your title(s) will be selected."/>
													<mx:Label text="Section 1" x="9" y="62" id="lbl_lOneKW0"/>
													<mx:TextArea x="72" y="87" width="614" height="18" fontWeight="normal" text="{txt_lTwoSOneKW}" id="lTwoSOneKW"/>
													<mx:TextInput x="72" y="34" id="lTwoTitle" text="{txt_lTwoTitle}" fontWeight="bold"/>
													<mx:Label x="55" y="-24" text="Label"/>
													<mx:Button x="593" y="10" label="Add section" visible="true"/>
													<mx:TextInput x="72" y="60" text="{txt_lTwoSOneTitle}" id="lTwoSOneTitle"/>
											</mx:Panel>
									</mx:HBox>
									<mx:HBox label="lesson3" x="100" y="100" width="100%" height="100%">
											<mx:Panel   id="pnl_lesson3" styleName="panelClass" layout="absolute" height="100%" width="100%" verticalScrollPolicy="off" horizontalScrollPolicy="off">
													<mx:Label text="Lesson 3" x="10" y="34">
															<mx:toolTip><![CDATA[One “Lesson Heading” for each third of the course.  All Courses will be divided into three parts.]]></mx:toolTip>
													</mx:Label>
													<mx:Label text="Keywords" x="10" y="88" toolTip="Provide 5-20 “key words” for each section.  More complex sections will require more key words.  Remember, users will select your content based on “key word” searches so the more key words you submit for each section the better chance your title(s) will be selected."/>
													<mx:TextArea x="72" y="87" width="612" height="19" fontWeight="normal" text="{txt_lThreeSOneKW}" id="lThreeSOneKW"/>
													<mx:TextInput x="72" y="34" id="lThreeTitle" text="{txt_lThreeTitle}" fontWeight="bold"/>
													<mx:Button label="Add section" x="593" y="10" visible="true"/>
													<mx:Label text="Section 1" id="lbl_lThreeKW" x="9" y="62"/>
													<mx:TextInput x="72" y="60" text="{txt_lThreeSOneTitle}" id="lThreeSOneTitle"/>
											</mx:Panel>
									</mx:HBox>
									
							
							</mx:TabNavigator>
			</mx:AddChild>
			
	
	
	
	</mx:State>
	</mx:states>
	
	
	
	
	
	
	
	
	
 
 
<mx:Script>
  <![CDATA[
    import mx.controls.dataGridClasses.DataGridColumn;
     
    private function displayCourseDesc(item:Object, 
      col:DataGridColumn):String
    {
      return item.description;
    }
    private function displayCourseKey(item:Object, 
      col:DataGridColumn):String
    {
      return item.keywords;
    }
  ]]>
  </mx:Script>
  <mx:Model id="vendor" source="data/vendor.xml"/>
  <mx:XML id="vendorlessons" source="data/vendorlessons.xml"/>
  
  
  
  
<mx:Panel x="0" y="0" width="720" height="552" 
    layout="absolute" title="Vendor Course List" fontSize="11" fontFamily="Verdana" id="panel1">
    
    
    
    <mx:DataGrid id="dgPeeps" x="10" y="50" 
      rowCount="4" width="680" height="284" selectedIndex="0"
      dataProvider="{vendor.courselist}"  click="currentState='coursesummary'" 
      showHeaders=" true">
      <mx:columns>
        
        <mx:DataGridColumn wordWrap="true" headerText="Course Title" width="150">
          <mx:itemRenderer>
            <mx:Component>
              <mx:VBox verticalGap="2">
              	<mx:Label text="{data.course}" />
              </mx:VBox>
            </mx:Component>
          </mx:itemRenderer>
        </mx:DataGridColumn>
        
        <mx:DataGridColumn wordWrap="true" headerText="Course Description" width="415" 
          labelFunction="displayCourseDesc"/>
        
        <mx:DataGridColumn wordWrap="true" headerText="Keywords (for Search)" width="215" 
          labelFunction="displayCourseKey"/>
          
          
          
      </mx:columns>
    </mx:DataGrid>
    
    
    
    
    
    <mx:Label text="Welcome!" id="lbl_welcome"  x="10" y="10" styleName="welcome" width="73" fontWeight="bold"/>
    <mx:Label text="1" id="lbl_welcome1"  x="676" y="10" styleName="welcome" width="14" fontWeight="bold"/>
    <mx:Label text="Please make your selection below." id="lbl_courseTitle0"  x="10" y="24" styleName="instructions" width="680"/>
    
   
    
    
    
  </mx:Panel>
</mx:Application>

Open in new window

0
Comment
Question by:COwebmaster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 20321446
As a quick fix what I can say is to use Flex 3 Beta to generate the web services stubs and use them in flex 2 this reduces  the basic issue for the time being.

When is that parse exception occuring ? is it when you try to compile the code or when you run the flex application?
0
 

Author Comment

by:COwebmaster
ID: 20321753
when I compile it.  a red X comes up with that parsing error.  Can a <mx:WebService be done in a state (<mx:AddChild..)?
0
 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 20324839
Ya I think you can try that but why introducing more complex stuff, instead use Flex 3 beta just to create the stubs for the Web service, and copy these classes and use them in you flex 2 :) it will be no more than a normal method call to invoke web services using this approach. Try it.
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 19

Expert Comment

by:Gary Benade
ID: 20325698
The problem is that you can't put the webservice there, move it up to below style.

Regards
Gary
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="720" height="552"  creationComplete="init()">
<mx:Style source="assets/style.css" />
	<mx:WebService id="wsUserData"  
		wsdl="{String(g_HostString)}"
		fault="{showFault(event)}">
		<mx:operation name="getUserValue" result="wsResult(event)">
			<mx:request>
				<courseId>
					1
				</courseId>
			</mx:request>
		</mx:operation>
		<mx:operation name="updUserValue">
			<mx:request>
				<courseId>
					1
				</courseId>
				<courseTitle>
					{txt_courseTitle.text}
				</courseTitle>
			</mx:request>
		</mx:operation>
	</mx:WebService>		
<mx:states>
		<mx:State name="coursesummary">
			<mx:RemoveChild target="{dgPeeps}"/>
			<mx:RemoveChild target="{lbl_welcome1}"/>
			<mx:AddChild relativeTo="{panel1}" position="lastChild">

Open in new window

0
 

Author Comment

by:COwebmaster
ID: 20325789
I thought I tried that but it still didn't work.
0
 

Author Comment

by:COwebmaster
ID: 20329894
Ok, that seemed to fix the compile issue but my components within my child state cannot retrieve db records.  what else am I doing wrong?  this is what I have..
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="720" height="552"  creationComplete="init()">
<mx:Style source="assets/style.css" />
	
	<mx:Script>
 
	<![CDATA[
			//import mx.collections.SortField;
			//import mx.collections.Sort;
			//import mx.collections.ArrayCollection;
			import mx.rpc.events.ResultEvent
			import mx.rpc.events.FaultEvent;
			import mx.controls.Alert;
			//import mx.rpc.soap.WebService;
			
		//public var courseTitle:String = "{courseTitle}";
		[Bindable]
		public var courseCode:String = "H2KN101";
		public var vendorName:String = "Knit-a-Doggie-Sweater Productions";
		[Bindable]
		public var courseDescription:String = "Teach yourself how to knit! Then if you are ever selected for jury duty you can knit the hours away!";
		//1
		public var txt_lOneTitle:String = "Fundamentals";
		public var txt_lOneSOneTitle:String = "What You Will Need";
		[Bindable]
		public var txt_lOneSOneKW:String = "knitting needles, types of yarn";
		public var txt_lOneSTwoTitle:String = "The Basics";
		public var txt_lOneSTwoKW:String = "basic stitches, stitch techniques, purl stitches,unraveling techniques, practice stitches";
		//2
		public var txt_lTwoTitle:String = "Intermediate Knitting";
		public var txt_lTwoSOneTitle:String = "Patterns and Assembly";
		public var txt_lTwoSOneKW:String = "basic knitting patterns,more types of yarn, how to reepair knitting mistakes,slipping stitches,cable knitting,grafting,knitting tips and tricks";
		//3
		public var txt_lThreeTitle:String = "Advanced Knitting";
		public var txt_lThreeSOneTitle:String = "Complex Patterns and Stitches";
		public var txt_lThreeSOneKW:String = "complex knitting assemblies,advanced repair techniques,multiple stitch techniques,advanced knitting patterns,knitting with multiple weaving ends";
		
			[Bindable]
			public var courseTitle:String;
			
		 [Bindable]
         public var sResult:String;//I guess this needs to be bindable to use it as a variable below
         [Bindable]
         public var endPath:String =  "com/ws/flexcom/NC_course.cfc?wsdl";
         [Bindable]
         public var wsUrl:String;
         [Bindable]
		 public var g_HostString:String;
		 [Bindable]
		 public var g_ContextRoot:String;
		 [Bindable]
		 public var g_BaseURL:String;
	
		private function init():void{
			//wsUrl = String(getHostName());
			
			//mx.controls.Alert.show("wsUrl");
			getData();
		}
		
	//get local environment	  
	 private function getHostName():String{
	     g_BaseURL = Application.application.url;
		lbl_base.text=g_BaseURL;
	     var pattern1:RegExp = new RegExp("http://[^/]*/");
	     
     if (pattern1.test(g_BaseURL) == true) {
         g_HostString = pattern1.exec(g_BaseURL).toString();
     } else{
        g_HostString = "http://localhost/";
     }   
     
     g_HostString = String(g_HostString+endPath);
    // lbl_g_host.text=g_HostString;
     return g_HostString;  
    ///return "http://localhost/com/local/user.cfc?wsdl";
  }
		
		private function getData():void{
			wsUserData.getUserValue.send();	
		}
		
		private function showFault(event:FaultEvent):void{
			txt_courseTitle.text=event.fault.faultDetail+":"+event.fault.faultString+":"+event.fault.message;
			//trace("error");
		}
		
		private function wsResult(event:ResultEvent):void{
			//trace("error");
			courseTitle=event.result as String;
			txt_courseTitle.text=courseTitle;
		}
		
		private function showUpdBtn():void{
				btn_save.visible=true;
				btn_save.setStyle("color","red");
				btn_save.label="Click here to save your changes.";
		}
		
		//update courseInfo
		private function updateCourse():void{
			wsUserData.updUserValue.send();
			btn_save.setStyle("color","green");
			btn_save.label="Your changes have been saved.";
			
			//btn_save.visible=false;
		}
		//{String(this.g_HostString)}
		//http://localhost/dev/com/local/user.cfc?wsdl
		//{String(getHostName())}
]]>
</mx:Script>
	
	
	
	<mx:WebService id="wsUserData"  
		wsdl="{String(g_HostString)}"
		fault="{showFault(event)}">
		<mx:operation name="getUserValue" result="wsResult(event)">
			<mx:request>
				<courseId>
					1
				</courseId>
			</mx:request>
		</mx:operation>
		<mx:operation name="updUserValue">
			<mx:request>
				<courseId>
					1
				</courseId>
				<courseTitle>
					{txt_courseTitle.text}
				</courseTitle>
			</mx:request>
		</mx:operation>
	</mx:WebService>
	
	
<mx:states>
		<mx:State name="coursesummary">
			<mx:RemoveChild target="{dgPeeps}"/>
			<mx:RemoveChild target="{lbl_welcome1}"/>
			<mx:AddChild relativeTo="{panel1}" position="lastChild">
				<mx:LinkButton x="535" y="8" label="&lt; Back to Course List" click="currentState=''" id="linkbutton1"/>
			</mx:AddChild>
			<mx:AddChild relativeTo="{panel1}" position="lastChild">
				
				
				
	
	
	
	<mx:Panel width="680" height="100%" layout="absolute" backgroundColor="#FFFFFF" id="pnl_wrap" y="51" x="10" paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0" roundedBottomCorners="true" color="#FFFFFF" borderThickness="0" borderThicknessBottom="0" borderThicknessLeft="0" borderThicknessRight="0" borderThicknessTop="0" borderColor="#FFFFFF">
	<mx:TabNavigator x="10" y="51" width="100%" height="680" id="tb_nav" paddingTop="0" borderColor="#FFFFFF" borderThickness="0" color="#223a91">
									
									
									
									<mx:HBox label="COURSE SUMMARY" x="100" y="100" width="680" height="420" id="hb_summary" color="#223a91">
										<mx:Panel id="pnl_summary"    styleName="panelClass"  layout="absolute" height="420" width="680" dropShadowEnabled="false" color="#223a91">
											<mx:Label text="Title:" id="lbl_courseTitle"  x="78" y="72" styleName="header"/>
											<mx:Label text="Code:" x="74" y="103" styleName="header" id="lbl_courseCode"/>
											<mx:TextInput x="119" y="68"  id="txt_courseTitle" fontWeight="bold" fontSize="12"  color="#223a91" change="showUpdBtn()"/><!--change="showUpdBtn()"-->
											<mx:TextInput x="110" y="99" text="{courseCode}" id="txt_courseCode"  styleName="header"/>
											<mx:TextArea x="110" y="129" width="306" styleName="header" text="{courseDescription}"/>
											<mx:Label x="28" y="130" text="Description:"  styleName="header">
												<mx:toolTip><![CDATA[Provide a one paragraph summary of your Course we can use as a product description.  Explain why consumers should access your Course.]]></mx:toolTip>
											</mx:Label>
										
										</mx:Panel>
									</mx:HBox>
									
									<mx:VBox label="lesson1" x="100" y="100" height="100%" width="100%" visible="true">
											<mx:Panel   id="pnl_lesson1" styleName="panelClass" layout="absolute" height="100%" width="100%">
													<mx:Label text="Lesson 1" x="10" y="34">
															<mx:toolTip><![CDATA[One “Lesson Heading” for each third of the course.  All Courses will be divided into three parts.]]></mx:toolTip>
													</mx:Label>
													<mx:Label text="Keywords" x="10" y="88" toolTip="Provide 5-20 “key words” for each section.  More complex sections will require more key words.  Remember, users will select your content based on “key word” searches so the more key words you submit for each section the better chance your title(s) will be selected."/>
													<mx:TextArea x="72" y="87" width="614" height="18" fontWeight="normal" text="{txt_lOneSOneKW}" id="lOneSOneKW"/>
													<mx:Label x="31" y="-21" text="{courseTitle}"/>
													<mx:TextInput x="72" y="34" id="lOneTitle" text="{txt_lOneTitle}" fontWeight="bold"/>
													<mx:Button x="593" y="10" label="Add section" visible="true"/>
													<mx:Label text="Section 1" x="9" y="62" id="lbl_lOneKW2"/>
													<mx:TextInput x="72" y="60" text="{txt_lOneSOneTitle}" id="lOneSOneTitle"/>
													<mx:Label text="Keywords" x="11" y="132">
															<mx:toolTip><![CDATA[Provide 5-20 “key words” for each section.  More complex sections will require more key words.  Remember, users will select your content based on “key word” searches so the more key words you submit for each section the better chance your title(s) will be selected.]]></mx:toolTip>
													</mx:Label>
													<mx:TextArea x="73" y="131" width="613" height="18" fontWeight="normal" text="{txt_lOneSTwoKW}" id="lOneSTwoKW"/>
													<mx:Label text="Section 2" x="10" y="106" id="lbl_lOneKW3"/>
													<mx:TextInput x="73" y="104" text="{txt_lOneSTwoTitle}" id="lOneSTwoTitle"/>
											</mx:Panel>		
									</mx:VBox>
									<mx:HBox label="lesson2" x="100" y="100" width="100%" height="100%">
											<mx:Panel  id="pnl_lesson2" styleName="panelClass" height="100%" width="100%" layout="absolute">
													<mx:Label text="Lesson 2" x="10" y="34">
															<mx:toolTip><![CDATA[One “Lesson Heading” for each third of the course.  All Courses will be divided into three parts.]]></mx:toolTip>
													</mx:Label>
													<mx:Label text="Keywords" x="10" y="88" id="lbl_lOneKW" toolTip="Provide 5-20 “key words” for each section.  More complex sections will require more key words.  Remember, users will select your content based on “key word” searches so the more key words you submit for each section the better chance your title(s) will be selected."/>
													<mx:Label text="Section 1" x="9" y="62" id="lbl_lOneKW0"/>
													<mx:TextArea x="72" y="87" width="614" height="18" fontWeight="normal" text="{txt_lTwoSOneKW}" id="lTwoSOneKW"/>
													<mx:TextInput x="72" y="34" id="lTwoTitle" text="{txt_lTwoTitle}" fontWeight="bold"/>
													<mx:Label x="55" y="-24" text="Label"/>
													<mx:Button x="593" y="10" label="Add section" visible="true"/>
													<mx:TextInput x="72" y="60" text="{txt_lTwoSOneTitle}" id="lTwoSOneTitle"/>
											</mx:Panel>
									</mx:HBox>
									<mx:HBox label="lesson3" x="100" y="100" width="100%" height="100%">
											<mx:Panel   id="pnl_lesson3" styleName="panelClass" layout="absolute" height="100%" width="100%" verticalScrollPolicy="off" horizontalScrollPolicy="off">
													<mx:Label text="Lesson 3" x="10" y="34">
															<mx:toolTip><![CDATA[One “Lesson Heading” for each third of the course.  All Courses will be divided into three parts.]]></mx:toolTip>
													</mx:Label>
													<mx:Label text="Keywords" x="10" y="88" toolTip="Provide 5-20 “key words” for each section.  More complex sections will require more key words.  Remember, users will select your content based on “key word” searches so the more key words you submit for each section the better chance your title(s) will be selected."/>
													<mx:TextArea x="72" y="87" width="612" height="19" fontWeight="normal" text="{txt_lThreeSOneKW}" id="lThreeSOneKW"/>
													<mx:TextInput x="72" y="34" id="lThreeTitle" text="{txt_lThreeTitle}" fontWeight="bold"/>
													<mx:Button label="Add section" x="593" y="10" visible="true"/>
													<mx:Label text="Section 1" id="lbl_lThreeKW" x="9" y="62"/>
													<mx:TextInput x="72" y="60" text="{txt_lThreeSOneTitle}" id="lThreeSOneTitle"/>
											</mx:Panel>
									</mx:HBox>
									
							
							</mx:TabNavigator>
							<mx:Button label="Please Save Changes to '{txt_courseTitle.text}'" labelPlacement="bottom" id="btn_save" x="439" y="376" click="updateCourse()" visible="false" color="#000000" borderColor="#804000"/>
	<mx:Label x="38" y="-26" text="{courseTitle}"/>
	<mx:Label x="491" y="10" text="{vendorName}"  styleName="header" id="label2"/>
	<mx:Label x="0" y="5" text="&quot;{txt_courseTitle.text}&quot;"   styleName="header" fontStyle="italic" fontSize="18" id="label1"/>
	<mx:Label x="90" y="444" text="baseurl=" id="lbl_base" visible="false" color="#000000"/>
	<mx:Label x="175.5" y="494" text="server={getHostName()}" id="lbl_g_host" enabled="true" color="#000000" visible="false" width="300"/>
	</mx:Panel>
			</mx:AddChild>
			
	
	
	
	</mx:State>
	</mx:states>
	
	
<mx:Script>
  <![CDATA[
    import mx.controls.dataGridClasses.DataGridColumn;
     
    private function displayCourseDesc(item:Object, 
      col:DataGridColumn):String
    {
      return item.description;
    }
    private function displayCourseKey(item:Object, 
      col:DataGridColumn):String
    {
      return item.keywords;
    }
  ]]>
  </mx:Script>
  <mx:Model id="vendor" source="data/vendor.xml"/>
  <mx:XML id="vendorlessons" source="data/vendorlessons.xml"/>
  
  
  
  
<mx:Panel x="0" y="0" width="720" height="552" 
    layout="absolute" title="Vendor Course List" fontSize="11" fontFamily="Verdana" id="panel1">
    
    
    
    <mx:DataGrid id="dgPeeps" x="10" y="50" 
      rowCount="4" width="680" height="284" selectedIndex="0"
      dataProvider="{vendor.courselist}"  click="currentState='coursesummary'" 
      showHeaders=" true">
      <mx:columns>
        
        <mx:DataGridColumn wordWrap="true" headerText="Course Title" width="150">
          <mx:itemRenderer>
            <mx:Component>
              <mx:VBox verticalGap="2">
              	<mx:Label text="{data.course}" />
              </mx:VBox>
            </mx:Component>
          </mx:itemRenderer>
        </mx:DataGridColumn>
        
        <mx:DataGridColumn wordWrap="true" headerText="Course Description" width="415" 
          labelFunction="displayCourseDesc"/>
        
        <mx:DataGridColumn wordWrap="true" headerText="Keywords (for Search)" width="215" 
          labelFunction="displayCourseKey"/>
          
          
          
      </mx:columns>
    </mx:DataGrid>
    
    
    
    
    
    <mx:Label text="Welcome!" id="lbl_welcome"  x="10" y="10" styleName="welcome" width="73" fontWeight="bold"/>
    <mx:Label text="1" id="lbl_welcome1"  x="676" y="10" styleName="welcome" width="14" fontWeight="bold"/>
    <mx:Label text="Please make your selection below." id="lbl_courseTitle0"  x="10" y="24" styleName="instructions" width="680"/>
    
   
    
    
    
  </mx:Panel>
</mx:Application>

Open in new window

0
 

Author Comment

by:COwebmaster
ID: 20329900
if I declare variables in the base state, how can I thread those variables in child states?
0
 
LVL 19

Accepted Solution

by:
Gary Benade earned 2000 total points
ID: 20330101
Base variables exist in all states. You will have to make all your public txt_ variables [Bindable] if you want changes to them to show in other places.
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question