-데이터 모델 로 데 이 터 를 저장 합 니 다.

You can use a data model to store application-specific data. A data model is an ActionScript object that provides properties for storing data, and optionally contains methods for additional functionality. Data models provide a way to store data in the Flex application before it is sent to the server, or to store data sent from the server before using it in the application.
You can declare a simple data model that does not require methods in an , , or tag. The following example shows an application that contains TextInput controls for entering personal contact information and a data model, represented by the tag, for storing the contact information:
     데이터 모델 을 사용 하여 구체 적 인 프로그램 데 이 터 를 저장 할 수 있 습 니 다.하나의 데이터 모델 은 ActionScript 대상 입 니 다.이 는 일부 속성 을 제공 하여 데 이 터 를 저장 하고 추가 기능 을 선택적으로 포함 하 는 방법 을 제공 합 니 다.데이터 모델 은 Flex 프로그램 이 서버 에 데 이 터 를 보 내기 전에 데 이 터 를 저장 하 는 경 로 를 제공 합 니 다.
     ,또는태그 에서 간단 하고 방법 이 포함 되 지 않 은 데이터 모델 을 설명 할 수 있 습 니 다.다음 예제 에 서 는 TextInput 컨트롤 과 데이터 모델 을 포함 하 는 응용 프로그램 을 보 여 줍 니 다.이 프로그램 은 TextInput 컨트롤 을 사용 하여 사용자 의 개인 정 보 를 얻 고태그 로 표현 하여 연락 정 보 를 기록 합 니 다.

<?xml version="1.0"?>
<!-- mxml/StoringData.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

    <!-- A data model called "contact" stores contact information.
        The text property of each TextInput control shown above
        is passed to a field of the data model. -->
    <mx:Model id="contact">
        <info>
            <homePhone>{homePhoneInput.text}</homePhone>
            <cellPhone>{cellPhoneInput.text}</cellPhone>
            <email>{emailInput.text}</email>
        </info>
    </mx:Model>

    <mx:Panel title="My Application" paddingTop="10" paddingBottom="10"
        paddingLeft="10" paddingRight="10" >
        <!-- The user enters contact information in TextInput controls. -->
        <mx:TextInput id="homePhoneInput"
            text="This isn't a valid phone number."/>
        <mx:TextInput id="cellPhoneInput" text="(999)999-999"/>
        <mx:TextInput id="emailInput" text="[email protected]"/>
    </mx:Panel>

</mx:Application>

좋은 웹페이지 즐겨찾기