wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ernesto Reinaldo Barreiro <reier...@gmail.com>
Subject Re: DB lookup time-out within DataTable Iterator
Date Tue, 07 Sep 2010 07:03:00 GMT
Hi Frank,

Just an idea... If you do the filtering "via AJAX"  you could use the
same AJAX request to:

1- display a modal window in case you get the timeout error: just
place the ModalWindow on your page do
modalWindow.addOrReplace(new
MyErrorMessagePanel(modalWindow.getContentId())); and use
modalWindow.show(target) to show it.
2-Place your "filters" on a panel (orWebMarkupConatiner) that can be
update via AJAX, reset the filter bean you are using to populate the
filters and update this panel via AJAX.

Ernesto

On Tue, Sep 7, 2010 at 8:40 AM, Frank Prins <Frank.Prins@copernicus.nl> wrote:
> Hi guys!
>
> Breaking my head on the following, hopefully someone might be able to
> give me a hint?
>
> In a page which serves a view on a log database with quite a lot of
> rows, I am using a DataTable to show the rows. The data for the table is
> being served by a SortableDataProvider which looks a bit like this:
>
> <...>
>  public SortableSystemlogDataProvider(Map searchParams) {
>    // creating new instance, set default sorting, Search parameters,
> counting dataset
>    this.dao = new H2InterfaceDaoImpl();
>    setSort("sl_id", false);
>    this.searchParams = searchParams;
>    this.systemlogListSize = dao.countAllSystemlogRows(searchParams);
>  }
>
>  public Iterator iterator(int first, int count) {
>    SortParam sp = getSort();
>    if (sp.getProperty() == null) {
>      setSort("sl_id", false);
>      sp = getSort();
>    }
>    // return iterator on search list by params
>    paginatedList = dao.selectSystemlogs(this.searchParams,
> sp.getProperty(), sp.isAscending(), first, count);
>    return paginatedList.iterator();
>  }
> <...>
>
> The issue I am running into at this moment is this: in case of large
> datasets, the db call from within the iterator gives a timeout, and
> returns null. In this case I would like to give the user a warning
> modalwindow and the possibility to change the search options. Of course
> I am able to catch the timeout, and return an empty set, but I cannot
> see how to move on from that, as I am already within the DataTable.
>
> Anyone has an idea on this?
>
> Thanks in advance, regards,
> Frank Prins
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Mime
View raw message