Click
  1. Click
  2. CLK-124

NPE Table - ActionLink pagination

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      If you define the Table control as public, Click will automatically add this Control. So it will call table.setContext() .

      The table.setContext() should set the Context in the "pageLink" control.

      But at this time, the page Link is null, because we don't called the table.setPageSize() method.

      So, this code throws a NPE. A possible fix for this, is change the setPageSize to also set the context in the ActionLink control.

      ---------------------------------------------------
      public class PersonTablePage extends BasePage {

      public Table table = new Table("table");

      public PersonTablePage()

      { table.setAttribute("class","simple"); table.addColumn(new Column("id")); table.addColumn(new Column("name")); table.addColumn(new Column("email")); table.addColumn(new Column("birthday")); //It works here // table.setPageSize(3); }

      public void onInit()

      { //This will throw a NPE table.setPageSize(3); }

      public void onGet()

      { table.setRowList(getPersonService().getAll()); }

      }

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Malcolm Edgar
            Reporter:
            Ricardo Lecheta
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development