当前位置: 代码迷 >> JavaScript >> jsf中怎的动态改变include的src地址
  详细解决方案

jsf中怎的动态改变include的src地址

热度:82   发布时间:2012-10-30 16:13:36.0
jsf中怎样动态改变include的src地址
我想根据一个bean里的url,动态改变include中的src,试了几次都不行。
java 代码
?
  1. <body?style="margin:0;"?bgcolor="#f4f4ea">??
  2. ??
  3. <f:view>??
  4. <h:form?id="form">??
  5. ????????<div?>??
  6. ????????<e:include?id="moduleTree"?src="system/module_tree.jsp"/>??
  7. ??????</div>??
  8. ??????
  9. ??????
  10. ??????<div?>??
  11. ????????<e:include?id="mainPane"?src="#{controlBean.mainPanePath}"/>??
  12. ??????</div>??
  13. ?????
  14. </h:form>??
  15. </f:view>??
java 代码
?
  1. public?class?ControlBean?{??
  2. ????private?String?mainPanePath="org_manager/context.jsp";??
  3. ??
  4. ????/**?
  5. ?????*?@return?the?mainPanePath?
  6. ?????*/??
  7. ????public?String?getMainPanePath()?{??
  8. ????????return?mainPanePath;??
  9. ????}??
  10. ??
  11. ????/**?
  12. ?????*?@param?mainPanePath?the?mainPanePath?to?set?
  13. ?????*/??
  14. ????ghter">
    ?
    1. <e:tree?id="tree-basic"?model="#{moduleTreeModelBean.treeModel}"???
    2. ????????????rootExpanded="false"??
    3. ????????????onselection="#{controlBean.setPath}"??
    4. ????????????cellStyle="normalTreeCell"??
    5. ????????????hoverStyle="blueTreeCell"??
    6. ????????????selectedStyle="whiteTreeCell"?preloadDepth="1">??
    7. ??
    8. ???????
    9. ????????<e:treecell?value="#{NODE.name}"??
    10. ????????????????????styleClass="treeCellBold"??
    11. ????????????????????icon="#{NODE.leaf?'/images/draft.jpg':'/images/trash.jpg'}"/>??
    12. ??????????
    13. ????</e:tree>??
树上点击链接,改变另一个include的url
1 楼 fourfire 2007-05-16  
后台都看到加载页面了,但是网页上没有变化
2 楼 fourfire 2007-05-17  
是个ecruiser的问题,需要把tree标记的ajax=false
  相关解决方案