Hi,

Thanks for your response. Here's some code, if this helps.

For the WMC:
WMC wmc = new WMC("data");
wmc.setOutputMarkupId(true);
add(wmc);

On the form:

form.add(new AjaxButton("searchBtn"){
                        @Override
                                protected void onSubmit(AjaxRequestTarget 
target, Form form) {
                                dataProvider = new DomainDataProvider(user,
searchField.getModelObjectAsString());

                                target.addComponent(wmc);
                                target.focusComponent(searchField);
                        }                       
                });

add(form);


The panel that contains this form also contains a reference to the data
provider (dataProvider above) declared as:

IDataProvider dataProvider = MyDataProvider(user, "");   //Initially the
search criterion is empty


The DataView is defined as follow:

DataView dataView = new DataView("dataView", dataProvider){

                @Override
                protected void populateItem(Item item) {
                        //Do something here             
        };
dataView.setItemsPerPage(BASE_PAGE_SIZE);
dataView.setOutputMarkupId(true);
wmc.add(dataView);


If order matters, I declare the provider first, followed by data view
followed by form.

Thanks once again.

Cheers!!





Newgro wrote:
> 
> cbchhaya schrieb:
>> Hi all,
>>
>> Apologies if this has been answered elsewhere - I could not find a
>> relevant
>> thread.
>>
>> I have a Panel containing a form, with a textfield and button, and a
>> WebMarkupContainer containing a dataview. The provider for the dataview
>> sources data from a database based on the string entered in the textfield
>> on
>> form (empty initially so all records returned). On the AjaxButton's
>> onSubmit() event, I set the provider reference to a new data provider
>> with
>> the search value retrieved from the textfield and add the WMC to the Ajax
>> target. I am logging messages and see that the new provider gets created
>> when the button is clicked and the records returned are what's expected.
>> The
>> dataview, however, still continues showing data from old data set.
>>
>> I setOutputMarkupId(true) on the WMC.
>>
>> Any suggestions on what I might be doing incorrectly/improperly?
>>
>> Any help will be greatly appreciated.
>>
>> Cheers!
>>   
> Did you add the component (dataview) to the AjaxRequestTarget in the end 
> of submit?
> Provide some code please.
> 
> Cheers
> Per
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Refreshing-DataView-with-new-dataset-tp21650528p21650771.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to