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 周銳 閱讀(392) 評論(0)  編輯  收藏 所屬分類: Ajax
          主站蜘蛛池模板: 瓦房店市| 三江| 日喀则市| 广昌县| 台南县| 特克斯县| 怀宁县| 诸城市| 饶平县| 启东市| 集安市| 宁德市| 阜宁县| 莲花县| 随州市| 齐河县| 怀化市| 石狮市| 琼中| 万源市| 西乌| 岚皋县| 宝鸡市| 广东省| 阿拉善左旗| 青浦区| 襄城县| 鹤峰县| 海盐县| 临城县| 长阳| 江川县| 攀枝花市| 鄂托克旗| 赫章县| 乡城县| 大邑县| 美姑县| 通海县| 德江县| 炉霍县|