Java Architect

          導航

          <2007年7月>
          24252627282930
          1234567
          891011121314
          15161718192021
          22232425262728
          2930311234

          統計

          常用鏈接

          留言簿(2)

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          Open laszlo


          Datapointers are not bound to views like datapaths are, but they do have a place in the view hierarchy—that is, they "know about" parents and children.
           1 
           2 <datapointer xpath="myData:/" ondata="processData()">
           3     <method name="processData">
           4       this.selectChild(2); 
           5       do {
           6         if (this.xpathQuery( '@show' ) == 'south park') {
           7             Debug.write(this.xpathQuery('firstName/text()'));
           8         }
           9       } while (this.selectNext()); 
          10     </method>
          11   </datapointer>
          12 
          13 

          Create data set at runtime

          LzDataset: var dset = new LzDataset(null, {name: 'mydset'})

          $path{} limitations
          A limitation of the $path{} constraint is that the expression it contains is evaluated only at the initialization time, that is, an expression such as $path{'mynode[' + i + ']/@attr'} will behave like a $once{} constraint.Custome

          Customize the data binding
          1 <view name="swatch" width="200" height="30" 
          2   datapath="colors:/value[1]/text()">
          3     <method name="applyData" args="v">
          4       setBGColor(eval(v))
          5       display.setText(v)
          6     </method>
          7   </view>

          $path{}


          datapath.setdatapointer

          <canvas height="150">
          <dataset name="phonebook" src="resources/phonebook.xml"/>
          <simplelayout axis="x" spacing="20"/>

          <view name="contacts" height="150" width="100">
          <view bgcolor="0xe0e0e0" datapath="phonebook:/contacts/contact"
          onmouseover="setBGColor(0xc0c0c0)" onmouseout="setBGColor(0xe0e0e0)"
          onclick="details.datapath.setPointer(this.datapath.p)">
          <simplelayout axis="x" spacing="5"/>
          <text datapath="@firstName" resize="true"/>
          <text datapath="@lastName" resize="true"/>
          </view>
          <simplelayout spacing="5"/>
          </view>

          <view id="details" width="150" height="150" bgcolor="0xe0e0e0" fgcolor="blue">
          <datapath/>
          <text datapath="@firstName"/>
          <text datapath="@lastName"/>
          <text datapath="@phone"/>
          <text datapath="@email"/>
          <simplelayout spacing="5"/>
          </view>
          </canvas>



          posted on 2007-07-27 03:18 zrq 閱讀(195) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 土默特右旗| 河源市| 梁河县| 潞城市| 巫山县| 乐山市| 馆陶县| 高碑店市| 潮安县| 盱眙县| 曲阳县| 团风县| 玛纳斯县| 黄大仙区| 灵川县| 犍为县| 乐业县| 舟曲县| 同德县| 乌恰县| 丹寨县| 平塘县| 自贡市| 威信县| 临邑县| 松江区| 九龙县| 芜湖县| 华亭县| 团风县| 称多县| 怀远县| 望谟县| 汾阳市| 三原县| 阳泉市| 图们市| 乌鲁木齐县| 石城县| 郁南县| 沾益县|