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

        Ricardo Lecheta created issue -
        Malcolm Edgar made changes -
        Field Original Value New Value
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Malcolm Edgar made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Malcolm Edgar made changes -
        Status Reopened [ 4 ] In Progress [ 3 ]
        Malcolm Edgar made changes -
        Resolution Fixed [ 1 ]
        Status In Progress [ 3 ] Resolved [ 5 ]
        Malcolm Edgar made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Henri Yandell made changes -
        Project Import Fri Mar 20 14:11:32 PDT 2009 [ 1237583492744 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development