You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jeremy Lee <je...@nz1.ibm.com> on 2007/11/08 04:20:01 UTC

Regarding the use of AjaxFallbackDefaultDataTable

Hi,

I have a Search Form along with a AjaxFallbackDefaultDataTable on a page
that I am trying to create. How it is supposed to work is as follows:

1. User accesses page (only search form is visible)
2. User enters search parameters and submits request
3. The page returns search results.  The page at this point should still
show the search form, and also now the results through the
AjaxFallbackDefaultDataTable.

The problem that I am having is as follows:

In the page constructor I add both the form and the
AjaxFallbackDefaultDataTable and then set the table to not be visible. 
However I am finding that the table makes the call to the data provider when
it is initially instantiated.  I only want it to make the call to the data
provider when the search request is made.

The following is the code that I am using in the constructor to add the
table.

SortableDataProvider dp = new ReconcileReportProvider(new
ReconcileReportManagerImpl());
reportTable = new AjaxFallbackDefaultDataTable("searchResults", columns, dp,
rows);
reportTable.setVisible(false);
add(reportTable);

I am not too sure if this is even the right way to go about it.  Any
guidance would be appreciated.

Cheers.

-- 
View this message in context: http://www.nabble.com/Regarding-the-use-of-AjaxFallbackDefaultDataTable-tf4768778.html#a13640684
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Regarding the use of AjaxFallbackDefaultDataTable

Posted by John Krasnay <jo...@krasnay.ca>.
On Wed, Nov 07, 2007 at 07:20:01PM -0800, Jeremy Lee wrote:
> 
> Hi,
> 
> I have a Search Form along with a AjaxFallbackDefaultDataTable on a page
> that I am trying to create. How it is supposed to work is as follows:
> 
> 1. User accesses page (only search form is visible)
> 2. User enters search parameters and submits request
> 3. The page returns search results.  The page at this point should still
> show the search form, and also now the results through the
> AjaxFallbackDefaultDataTable.
> 
> The problem that I am having is as follows:
> 
> In the page constructor I add both the form and the
> AjaxFallbackDefaultDataTable and then set the table to not be visible. 
> However I am finding that the table makes the call to the data provider when
> it is initially instantiated.  I only want it to make the call to the data
> provider when the search request is made.
> 
> The following is the code that I am using in the constructor to add the
> table.
> 
> SortableDataProvider dp = new ReconcileReportProvider(new
> ReconcileReportManagerImpl());
> reportTable = new AjaxFallbackDefaultDataTable("searchResults", columns, dp,
> rows);
> reportTable.setVisible(false);
> add(reportTable);
> 
> I am not too sure if this is even the right way to go about it.  Any
> guidance would be appreciated.
> 
> Cheers.

Hi Jeremy,

You can try this: in your constructor, instead of the DataTable, create
an EmptyPanel with the same ID. In the onSubmit for your search form,
create the DataTable and use replace() to replace the EmptyPanel.

Hope this helps.

jk

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