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 閱讀(196) 評論(0)  編輯  收藏


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


          網站導航:
           
          主站蜘蛛池模板: 肇东市| 岳池县| 临夏市| 开原市| 娱乐| 洛川县| 宁陵县| 广昌县| 尼玛县| 务川| 黄陵县| 沧源| 溧阳市| 乃东县| 石嘴山市| 高邑县| 山西省| 舞钢市| 新蔡县| 新泰市| 晋江市| 无为县| 滦平县| 泾源县| 宜宾市| 宝山区| 台南市| 章丘市| 柘城县| 保德县| 麻江县| 兖州市| 临西县| 巫溪县| 忻州市| 宁都县| 开平市| 波密县| 中西区| 顺平县| 辛集市|