日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 前端技术 > javascript >内容正文

javascript

JSF Tree学习...

發(fā)布時間:2025/3/18 javascript 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 JSF Tree学习... 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
RAD7.0開發(fā)Faces Portlet.使用到Tree組件.
=====================================

使用JSF中的<ig:Sidebar></ig:Sidebar>實現(xiàn)動態(tài)加載菜單,其中bar.getChildren().add(aSidebarGroup);是實現(xiàn)動態(tài)加載首節(jié)點,HtmlSidebarGroup aSidebarGroup = (HtmlSidebarGroup) application.createComponent(HtmlSidebarGroup.COMPONENT_TYPE);
????aSidebarGroup.setText(boardName);
????aSidebarGroup.setExpanded(true);
????aSidebarGroup.setId(viewRoot.createUniqueId());實現(xiàn)加載該節(jié)點下的子節(jié)點,非常方便。

private Sidebar buildSideBar(Sidebar bar)
?{
??boolean isInitialised = bar.getAttributes().get("IS_INITIALISED")!=null;
??
??if (!isInitialised) {
???// Get a reference to the JSF Application,?
???// we need it to create value bindings later-on
???Application application = FacesContext.getCurrentInstance().getApplication();
???UIViewRoot viewRoot = FacesContext.getCurrentInstance().getViewRoot();
???
???/* Create Infragistics SidebarGroup */
???// Set the Sidebar's width and height
???bar.getAttributes().put("style","width: 155px; height: 590px;");
???// Create SidebarGroup
???List list = this.getBoardNameForMenu();
???for(int i = 0 ;i<list.size();i++)
???{
????Object[] row = (Object[])list.get(i);
???//Object[] row = (Object[])list.listIterator().next();
????String boardId = String.valueOf(row[0]);
????String boardName = String.valueOf(row[1]);
????String parentId = String.valueOf(row[2]);
????HtmlSidebarGroup aSidebarGroup = (HtmlSidebarGroup) application.createComponent(HtmlSidebarGroup.COMPONENT_TYPE);
????aSidebarGroup.setText(boardName);
????aSidebarGroup.setExpanded(true);
????aSidebarGroup.setId(viewRoot.createUniqueId());
???
????// Add the newly created SidebarGroup to the Sidebar's children list
????bar.getChildren().add(aSidebarGroup);
????
????List ls = this.getBoardNameForMenuBar(Integer.parseInt(boardId));
????if(ls.size() != 0)
????{
?????for(int j=0;j<ls.size();j++)
?????{
??????Object[] row1 = (Object[])ls.get(j);
??????String boardid = String.valueOf(row1[0]);
??????String boardname = String.valueOf(row1[1]);
??????//HtmlSidebarGroup aSidebarGroup = (HtmlSidebarGroup) application.createComponent(HtmlSidebarGroup.COMPONENT_TYPE);
??????HtmlLink aLink1 = (HtmlLink)application.createComponent(HtmlLink.COMPONENT_TYPE);
??????aLink1.setId(viewRoot.createUniqueId());
??????//aSidebarGroup.setText(sidebarGroupNameStr);
??????//aSidebarGroup.setExpanded(true);
??????//aSidebarGroup.setId(viewRoot.createUniqueId());
??????//aLink1.setId(parentId);
??????aLink1.setUrl("/pages/bbs/visitor/topic/topicforboard.jsf?boardid="+boardid+"");
??????aLink1.setValue(boardname);
??????aSidebarGroup.getChildren().add(aLink1);
?????}
????}
????
???}

本文轉(zhuǎn)自kenty博客園博客,原文鏈接http://www.cnblogs.com/kentyshang/archive/2008/06/04/1213825.html如需轉(zhuǎn)載請自行聯(lián)系原作者


kenty

總結(jié)

以上是生活随笔為你收集整理的JSF Tree学习...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。