posts - 5,  comments - 7,  trackbacks - 0
          第一種,普通的方法:
          想在JSF控件中操作框架頁(yè)Frameset,可以在左框架頁(yè)(任一框架頁(yè))里聲明一個(gè)Form,設(shè)定好它的target="mainFrame"(任一框架頁(yè)的id),這樣當(dāng)點(diǎn)擊這個(gè)Form里面的CommandButton或者CommandLink的時(shí)候,JSF處理好業(yè)務(wù)邏輯后,就可以將To-View-ID指定的頁(yè)面轉(zhuǎn)到主框架頁(yè)里面去顯示了。

          <h:form target="mainFrame">
          <h:commandButton action="index">
          </h:form

          mainFrame

          點(diǎn)擊左邊的commandButton之后,index處理之后的To-View-ID指定的頁(yè)面就會(huì)顯示在mainFrame里面了

          第二種方法:
                  <script>
                          
          function forward(p) {
                               window.parent.mainFrame.location.href
          ="usermanagement/" + p + ".faces"
          ;
                           }

                  
          </script>
          添加一個(gè)跳轉(zhuǎn)函數(shù),然后分情況添加跳轉(zhuǎn):
          當(dāng)不需要Action的時(shí)候
          <rich:panelMenuItem label="角色信息維護(hù)" onclick="forward('rolelist')" />
          這樣就可以跳轉(zhuǎn)了

          當(dāng)需要先進(jìn)行Action操作再跳轉(zhuǎn)的時(shí)候
          <rich:panelMenuItem label="新建角色"
                                          action
          ="#{user.addRoleMain}" oncomplete="forward('roledetail')" />
              public String addRoleMain()
              
          {
                  ClearRole();
                  
          return null
          ;
              }

          這樣,在Action完成后,菜單頁(yè)不會(huì)變,主框架頁(yè)會(huì)跳轉(zhuǎn)到指定頁(yè)面。

          OK,上面兩種方法基本能滿(mǎn)足開(kāi)發(fā)需要了。
          posted on 2008-11-23 01:05 Vincent-chen 閱讀(348) 評(píng)論(0)  編輯  收藏 所屬分類(lèi): JSF
          主站蜘蛛池模板: 花莲市| 高阳县| 北流市| 读书| 大埔县| 日土县| 陆河县| 西乌| 宣化县| 缙云县| 汨罗市| 蓝田县| 云龙县| 天镇县| 宁武县| 郓城县| 咸宁市| 静安区| 鄂尔多斯市| 望谟县| 北流市| 永嘉县| 侯马市| 平果县| 灵璧县| 加查县| 孙吴县| 石屏县| 多伦县| 县级市| 桐梓县| 安达市| 卫辉市| 中西区| 沛县| 汨罗市| 青川县| 新闻| 稷山县| 宁武县| 汾西县|