Revision history [back]

click to hide/show revision 1
initial version

answered 2015-08-19 06:51:34 +0800

ifmis gravatar image ifmis

/**
 * On add new action command.
 * allRecordsInDb -- the list of all my objects
 */
@Command
@NotifyChange({ UIConstants.ALL_RECORD_IN_DB, UIConstants.DISPLAY_EDIT, "currentPage" })
public void onAddNew() {

    Currency object = new Currency();
    object.setEditStatus(true);

    allRecordsInDB.add(0, object); // add the object on the beginning of the list.

}

The attribute activePage works effectively. And as seen above remember to add @NotifyChage("currentPage").

<grid activePage="@bind(vm.currentPage)" />

Many thanks to costas.

click to hide/show revision 2
added setCurrentPage(0);
/**
 * On add new action command.
 * allRecordsInDb -- the list of all my objects
 */
@Command
@NotifyChange({ UIConstants.ALL_RECORD_IN_DB, UIConstants.DISPLAY_EDIT, "currentPage" })
public void onAddNew() {

    Currency object = new Currency();
    object.setEditStatus(true);

    allRecordsInDB.add(0, object); // add the object on the beginning of the list.
    setCurrentpage(0);             // navigate to the first page of the grid

}

The attribute activePage works effectively. And as seen above remember to add @NotifyChage("currentPage").

<grid activePage="@bind(vm.currentPage)" />

Many thanks to costas.

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More