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 周銳 閱讀(391) 評(píng)論(0)  編輯  收藏 所屬分類: Ajax
          主站蜘蛛池模板: 武胜县| 舒兰市| 日照市| 阿城市| 宿松县| 遵化市| 丰台区| 伊川县| 道真| 全椒县| 临海市| 洪湖市| 都兰县| 金平| 宁强县| 三江| 芮城县| 永泰县| 新民市| 安平县| 农安县| 南汇区| 台东县| 米泉市| 疏勒县| 桂平市| 大石桥市| 惠水县| 衡阳县| 洮南市| 东兰县| 青铜峡市| 嘉禾县| 建昌县| 莒南县| 雅江县| 宽城| 新竹市| 曲阳县| 江城| 军事|