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
          主站蜘蛛池模板: 宁阳县| 芦山县| 莫力| 诸暨市| 文成县| 岳池县| 萨嘎县| 台安县| 江源县| 寿光市| 镇坪县| 观塘区| 安康市| 安龙县| 绿春县| 会泽县| 新宁县| 信丰县| 陈巴尔虎旗| 尼玛县| 信阳市| 交口县| 东兴市| 栾川县| 宝山区| 平定县| 鄱阳县| 南郑县| 商水县| 罗城| 祁门县| 金昌市| 辽宁省| 马鞍山市| 西贡区| 兴隆县| 大宁县| 普兰店市| 梁山县| 兴国县| 上栗县|