0
TitleWindow mxml에서 ActionScript로 값을 검색 할 때 문제가 있습니다. UpdateRelease.mxml 다음TitleWindow에서 입력 값을 읽는 중 문제가 발생했습니다.
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
title="Title Window" x="168" y="86">
<mx:Script>
<![CDATA[
import com.paul.data.ReleaseVO;
import mx.controls.Alert;
import mx.controls.Text;
import mx.managers.PopUpManager;
[Bindable]
public var i_ReleaseVO:ReleaseVO = null;
// Event handler for the OK button.
protected function updateReleaseData(): void {
if(releaseName.text == '')
Alert.show("Release Name cannot be null");
else if(releaseDate.text == '')
Alert.show('Release Date cannot be null');
else
(parentApplication as Main).mainScreen.updateReleaseEvent();
}
]]>
</mx:Script>
<mx:Canvas>
<mx:VBox>
<mx:HBox>
<mx:Label text="Release Name"/>
<mx:TextInput id="releaseName" width="100%" text="{i_ReleaseVO.release}"/>
</mx:HBox>
<mx:HBox>
<mx:Label text="Release Date"/>
<mx:DateField id="releaseDate" width="100%" selectedDate="{DateField.stringToDate(i_ReleaseVO.relDate, 'YYYY/MM/DD')}"/>
</mx:HBox>
<mx:HBox>
<mx:Label text="Other Info"/>
<mx:TextInput id="relOtherInfo" width="100%" text="{i_ReleaseVO.otherInfo}"/>
</mx:HBox>
<mx:HBox>
<mx:Button label="OK" click="updateReleaseData();"/>
<mx:Button label="Cancel" click="PopUpManager.removePopUp(this);"/>
</mx:HBox>
</mx:VBox>
</mx:Canvas>
는 액션 스크립트 코드는 다음
public function updateReleaseEventHandler(pEvent:Event): void {
if(i_RequestServiceProxy != null) {
var i_RequestParams:Object ={};
i_HttpXMLRequest = new HttpXMLRequest();
var obj:Object = new Object();
obj["release"] = this.mainView.updateReleaseValueView.releaseName.text;
obj["releaseDate"] = this.mainView.updateReleaseValueView.releaseDate.text;
obj["otherInfo"] = this.mainView.updateReleaseValueView.relOtherInfo.text;
i_RequestParams = i_HttpXMLRequest.getUpdateReleaseParams(obj);
i_RequestServiceProxy.updateRelease(i_RequestParams);
} else {
Alert.show("i_RequestServiceProxy is NULL");
}
}
을하다 다음은 MainView.mxml는
<s:VGroup width="100%" height="100%" >
<mx:ViewStack id="vs">
<views:UpdateRelease id="updateReleaseValueView" width="100%" height="100%"/>
</mx:ViewStack>
</s:VGroup>
문제 UpdateRelease.mxml
의 포함을 보여주는 것입니다 ActionScript 파일의 다음 문에 있습니다. 다음 진술이 예상대로 작동하지 않는 것으로 나타났습니다. 실행은 첫 번째 오류에서 실패합니다. 누군가 실수를 지적 할 수 있습니까? obj["release"] = this.mainView.updateReleaseValueView.releaseName.text;
obj["releaseDate"] = this.mainView.updateReleaseValueView.releaseDate.text;
obj["otherInfo"] = this.mainView.updateReleaseValueView.relOtherInfo.text;