posts - 17,  comments - 6,  trackbacks - 0
          < netui-data:repeater? dataSource ="{pageFlow.customerList}" >

          ????
          < netui-data:repeaterHeader >< table? cellpadding ="4" ?border ="1"

          ????????class
          ="tablebody" ? ></ netui-data:repeaterHeader >

          ????
          < netui-data:repeaterItem >

          ????????
          < netui-data:choiceMethod? object ="{pageFlow}"

          ??????????????method
          ="getRollerState" >

          ????????????
          < netui-data:methodParameter? value ="{container.item[1]}" />

          ????????
          </ netui-data:choiceMethod >

          ????????
          < netui-data:choice? value ="low" >

          ????????????
          < tr? bgcolor ='#00FF00' >

          ????????????????
          < td >< netui:label? value ="{container.item[0]}" >

          ??????????????????????
          </ netui:label ></ td >

          ????????????????
          < td >< netui:label? value ="{container.item[1]}" >

          ??????????????????????
          </ netui:label ></ td >

          ????????????
          </ tr >

          ????????
          </ netui-data:choice >

          ????????
          < netui-data:choice? value ="high" >

          ?????????????
          < tr? bgcolor ='#FF0000' >

          ????????????????
          < td >< netui:label? value ="{container.item[0]}" >

          ??????????????????????
          </ netui:label ></ td >

          ????????????????
          < td >< netui:label? value ="{container.item[1]}" >

          ??????????????????????
          </ netui:label ></ td >

          ????????????
          </ tr >

          ????????
          </ netui-data:choice >

          ????
          </ netui-data:repeaterItem >

          ????
          < netui-data:repeaterFooter ></ table ></ netui-data:repeaterFooter >

          </ netui-data:repeater >


          The?
          < netui-data:choiceMethod > ?tag?specifies?the?Java?method?that?calculates?the?data?value.?The?method?is?determined?by?setting?the?tag's?object?and?method?attributes.?The?object?attribute?specifies?the?data?binding?context?(the?available?options?are?discussed?in?Chapter?4?in?the?section?"Data?Binding?with?Page?Flow").?In?this?case,?the?container?data?binding?context?refers?to?the?data?record?in?the?current?iteration.?Data?is?passed?into?the?Java?method?via?a?number?of?nested? < netui-data:methodParameter > ?tags,?one?for?each?parameter?of?the?Java?method.?Listing?7.4?shows?the?getRollerState()?method?in?the?Controller.jpf?file?used?in?the?Casino?example.?The?method?simply?returns?a?value?of?high?if?the?number?of?purchased?chips?is?greater?than?1,000;?otherwise,?it?returns?low.

          Listing?7.4.?Excerpt?from?Controller.jpf?Showing?the?Business?Logic?Used?to?Color-Code?Customers

          public?String?getRollerState(String?chipsPurchased)

          {

          ????int?chips?=?Integer.parseInt(chipsPurchased);

          ????if?(chips?>?1000)

          ????????return?"high";

          ????else

          ????????return?"low";

          }


          ?
          posted on 2006-06-16 11:17 風中的舞者 閱讀(176) 評論(0)  編輯  收藏

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


          網站導航:
           
          <2025年8月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          常用鏈接

          留言簿(1)

          隨筆檔案

          文章檔案

          java技術

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 河北省| 六盘水市| 缙云县| 修文县| 习水县| 韶关市| 淅川县| 东阳市| 察雅县| 东乡县| 张家界市| 会昌县| 随州市| 鹤峰县| 平南县| 乐陵市| 克拉玛依市| 奉化市| 大连市| 海兴县| 镶黄旗| 马公市| 湛江市| 桃源县| 芮城县| 寿阳县| 临桂县| 舒兰市| 札达县| 公安县| 乐东| 南康市| 丰原市| 浦城县| 广东省| 喀什市| 阳高县| 梅河口市| 弋阳县| 浏阳市| 昌乐县|