1 Reply Latest reply on Sep 14, 2006 9:40 AM by inlineblue

    ViewStack - Varibles error message

    GaryThompson76
      I've produced a student record so they can edit their own details,
      as a single page it works great, I've split the pages into a ViewStack, and unless I visit both pages
      I get an error message as the text fields used on page 2 are not getting set.

      Is this a bug ? is their a work around ?

      quick sample

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" height="472" width="750" backgroundGradientColors="[#e6e6e6, #e6e6e6]">
      <mx:WebService id="checkDetails"
      destination="checkDetails"
      useProxy="true">
      <mx:operation name="GetStudent" result="GetStudentResult();">
      <mx:request>
      <user_id>{user_id.text}</user_id>
      </mx:request>
      </mx:operation>
      <mx:operation name="SaveStudent" result="SaveStudentResult();">
      <mx:request>
      <student>
      <StudentNumber>{checkDetails.GetStudent.lastResult.StudentNumber}</StudentNumber>
      <UserID>{checkDetails.GetStudent.lastResult.UserID}</UserID>
      <StudentTitle>{checkDetails.GetStudent.lastResult.StudentTitle}</StudentTitle>
      <StudentForename>{checkDetails.GetStudent.lastResult.StudentForename}</StudentForename>
      <StudentSurname>{checkDetails.GetStudent.lastResult.StudentSurname}</StudentSurname>
      <StudentDOB>{checkDetails.GetStudent.lastResult.StudentDOB}</StudentDOB>
      <StudentGender>{checkDetails.GetStudent.lastResult.StudentGender}</StudentGender>
      <StudentMobileNumber>{StudentMobileNumber.text}</StudentMobileNumber>
      <UniversityEmailAddress>{checkDetails.GetStudent.lastResult.UniversityEmailAddress}</Univ ersityEmailAddress>
      <HomeAddress>
      <AddressLine1>{HomeAddressLine1.text}</AddressLine1>
      <AddressLine2>{HomeAddressLine2.text}</AddressLine2>
      <AddressLine3>{HomeAddressLine3.text}</AddressLine3>
      <AddressLine4>{HomeAddressLine4.text}</AddressLine4>
      <AddressLine5>{HomeAddressLine5.text}</AddressLine5>
      <AddressLine6>{HomeAddressLine6.text}</AddressLine6>
      <PostCode>{HomeAddressPostCode.text}</PostCode>
      <PhoneNumber>{HomeAddressPhoneNumber.text}</PhoneNumber>
      </HomeAddress>
      </student>
      </mx:request>
      </mx:operation>
      </mx:WebService>

      <mx:Script>
      <![CDATA[


      public function GetStudentResult():void {
      myStatus.text = "Student Details Loaded";
      }

      public function SaveStudentResult():void {
      myStatus.text = "Student Details Saved";
      }
      ]]>
      </mx:Script>



      <mx:Button x="522" y="444" label="GetStudent" click="checkDetails.GetStudent.send()" id="GetStudent_button"/>
      <mx:Button x="621" y="444" label="Submit Changes" id="SaveStudent_button" click="checkDetails.SaveStudent.send()"/>
      <mx:TextInput x="448" y="444" text="303530" id="user_id" width="63"/>

      <mx:LinkBar x="0" y="0" width="750" dataProvider="viewstack1">
      </mx:LinkBar>

      <mx:ViewStack x="10" y="25" id="viewstack1" width="730" height="417">
      <mx:Canvas label="Personal Information" width="100%" height="100%" backgroundAlpha="0.0" borderColor="#ffffff">
      <mx:Label x="73" y="11" text="forename" width="132" textAlign="left"/>
      <mx:TextArea x="73" y="30" height="24" text="{checkDetails.GetStudent.lastResult.StudentForename}" id="StudentForename" editable="false"/>
      <mx:Label x="10" y="12" text="Title" width="48" textAlign="left"/>
      <mx:TextArea x="10" y="30" height="24" text="{checkDetails.GetStudent.lastResult.StudentTitle}" width="55" id="StudentTitle" editable="false"/>
      <mx:Label x="241" y="11" text="Surname" width="132" textAlign="left"/>
      <mx:TextArea x="241" y="30" height="24" text="{checkDetails.GetStudent.lastResult.StudentSurname}" width="193" id="StudentSurname" editable="false"/>
      <mx:Label x="514" y="31" text="UserID" width="65" textAlign="right" id="label0"/>
      <mx:TextArea x="587" y="30" height="24" text="{checkDetails.GetStudent.lastResult.UserID}" id="UserID" editable="false" width="133"/>
      <mx:Label x="26" y="167" text="Date of Birth" width="80" textAlign="right"/>
      <mx:TextArea x="114" y="165" height="24" text="{checkDetails.GetStudent.lastResult.StudentDOB}" width="119" id="StudentDOB" editable="false"/>
      <mx:Label x="52" y="137" text="Gender" width="54" textAlign="right"/>
      <mx:TextArea x="114" y="136" height="24" text="{checkDetails.GetStudent.lastResult.StudentGender}" width="119" id="StudentGender" editable="false"/>
      <mx:Label x="384" y="310" text="Mobile number" width="122" textAlign="right" id="label8"/>
      <mx:TextArea y="309" height="24" text="{checkDetails.GetStudent.lastResult.StudentMobileNumber}" width="204" x="514" id="StudentMobileNumber" editable="true"/>
      <mx:Label x="384" y="252" text="University e-mail" width="122" textAlign="right" id="label9"/>
      <mx:TextArea y="251" height="24" text="{checkDetails.GetStudent.lastResult.UniversityEmailAddress}" width="204" x="514" id="UniversityEmailAddress" editable="false"/>
      </mx:Canvas>

      <mx:Canvas label="Home Address" width="100%" height="100%">
      <mx:Button x="269" y="216" label="LookUp" id="button0"/>
      <mx:Label x="31" y="38" text="Address" width="67" textAlign="right" id="label14"/>
      <mx:Label x="31" y="216" text="Postcode" width="67" textAlign="right" id="label15"/>
      <mx:Label x="31" y="248" text="Telephone" width="67" textAlign="right" id="label16"/>
      <mx:TextArea y="35" height="24" text="{checkDetails.GetStudent.lastResult.HomeAddress.AddressLine1}" width="233" x="110" id="HomeAddressLine1"/>
      <mx:TextArea y="65" height="24" text="{checkDetails.GetStudent.lastResult.HomeAddress.AddressLine2}" width="233" x="110" id="HomeAddressLine2"/>
      <mx:TextArea y="95" height="24" text="{checkDetails.GetStudent.lastResult.HomeAddress.AddressLine3}" width="233" x="110" id="HomeAddressLine3"/>
      <mx:TextArea y="125" height="24" text="{checkDetails.GetStudent.lastResult.HomeAddress.AddressLine4}" width="233" x="110" id="HomeAddressLine4"/>
      <mx:TextArea y="155" height="24" text="{checkDetails.GetStudent.lastResult.HomeAddress.AddressLine5}" width="233" x="110" id="HomeAddressLine5"/>
      <mx:TextArea y="185" height="24" text="{checkDetails.GetStudent.lastResult.HomeAddress.AddressLine6}" width="233" x="110" id="HomeAddressLine6"/>
      <mx:TextArea y="215" height="24" text="{checkDetails.GetStudent.lastResult.HomeAddress.PostCode}" width="144" x="110" id="HomeAddressPostCode"/>
      <mx:TextArea y="245" height="24" text="{checkDetails.GetStudent.lastResult.HomeAddress.PhoneNumber}" width="233" x="110" id="HomeAddressPhoneNumber"/>
      </mx:Canvas>

      </mx:ViewStack>
      <mx:TextArea x="10" y="446" height="20" id="myStatus" width="272" backgroundColor="#e6e6e6"></mx:TextArea>

      </mx:Application>