1 Reply Latest reply on Mar 28, 2007 5:25 PM by ntsiii

    Weird data model definition

    dirtyhand Level 1
      Hey, I just started learning Flex 2 for a new job and this was part of a sample code that was given to me.

      <model:student id="studentObj">
      <model:internetID>{input_internetID.text as String}</model:internetID>
      <model:IDnumber>{input_IDnumber.text as String}</model:IDnumber>
      <model:firstName>{input_firstname.text as String}</model:firstName>
      <model:lastName>{input_lastname.text as String}</model:lastName>
      <model:courseNumber>{input_courseNumber as String}</model:courseNumber>
      <!--<model:nickName>{input_nickname as String}</model:nickName>-->
      <model:sectionNumber>{input_sectionNumber as String}</model:sectionNumber>

      The student class was imported earlier in the code from an ActionScript files. Now what exactly is this code doing? Because the online documentation from adobe says to use <mx:Model> tag to define a data model, but this is using the <model> </model> tags that I cant find any info about.
        • 1. Re: Weird data model definition
          ntsiii Level 3
          In this case, "model" is a namespace identifier. It has nothing *at all* to do with mx:Model (which is a nested object structure)

          Namespaces in xml are a PITA, especailly if you do not need them. Flex has special objects for working with namespaces in xml. but if you can get the xml without them, it is much easier.

          Check the docs for xml namespace and the NameSpace class.