posts - 431,  comments - 344,  trackbacks - 0

          If you want to display a table without the pagination you need to set the max rows to the total rows, and then create a custom view to remove the toolbar. In addition, for this example, lets say that we also want to remove the statusbar? That makes sense as it will not offer any pagination information anyway.

          First we need to set the max rows to the total amount of items that we want to display.

          tableFacade.setMaxRows(items.size());

          Then we need to implement a custom view. If you compare this view to the HtmlView in the API you can see that I just removed two lines of code. One to remove the toolbar and one for the status bar.

          public class CustomView  extends AbstractHtmlView {
             
          public Object render() {
                 
          HtmlSnippets snippets = getHtmlSnippets();

                 
          HtmlBuilder html = new HtmlBuilder();

                  html
          .append(snippets.themeStart());

                  html
          .append(snippets.tableStart());

                  html
          .append(snippets.theadStart());

                  html
          .append(snippets.filter());

                  html
          .append(snippets.header());

                  html
          .append(snippets.theadEnd());

                  html
          .append(snippets.tbodyStart());

                  html
          .append(snippets.body());

                  html
          .append(snippets.tbodyEnd());

                  html
          .append(snippets.footer());

                  html
          .append(snippets.tableEnd());

                  html
          .append(snippets.themeEnd());

                  html
          .append(snippets.initJavascriptLimit());

                 
          return html.toString();
             
          }
          }

          Lastly, just plug your custom view into the TableFacade.

          API

          tableFacade.setView(new CustomView());

          Tags

          <jmesa:tableFacade view="com.mycompany.CustomView">
          posted on 2009-03-11 15:15 周銳 閱讀(397) 評論(0)  編輯  收藏 所屬分類: Ajax
          主站蜘蛛池模板: 三台县| 遂溪县| 秀山| 宁海县| 丹阳市| 疏附县| 本溪市| 临夏市| 铜山县| 句容市| 昌江| 静乐县| 溧水县| 洪泽县| 分宜县| 宜城市| 蓝山县| 广德县| 潞城市| 民勤县| 佛坪县| 安丘市| 庄河市| 屏东县| 阿拉尔市| 广宗县| 黔江区| 射阳县| 万山特区| 文成县| 九龙县| 山东| 夹江县| 高雄市| 青浦区| 新宁县| 当雄县| 鹿泉市| 土默特左旗| 安宁市| 兰州市|