You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Dariusz Wojtas <dw...@gmail.com> on 2009/03/24 20:29:13 UTC

Re: ajax request and reload the datview model

I have faced similar problem recently.
The solution was to modify your dataProvider parameters.
Instead of passing new dataProvider, playing with the constructors,
just load it with new properties.

Some pseudocode.


final ISortableDataProvider myDataProvider = ...
final DataView dataView = new DataView("dataView", myDataProvider) {
  ...
};

final WebMarkupContainer markupContainer = new ... {
   onBeforeRender() {
       // modified dataprovider will return different set of data
       myDataProvider.setParam(<someNewValue>);
   }
}
markupContainer.add(dataView);


After I undetstood this - life became muuuch easier in many scenarios.
This may be onvoked in many places. After pressing a button, reloading
fragment of the page with ajax, ...

Best regards,

Dariusz Wojtas


On Tue, Mar 24, 2009 at 3:58 PM, fachhoch <fa...@gmail.com> wrote:
>
> I have a dataview   in my page , a delete or add action should  repaint or
> rerender the dataview ,
>
> to acheieve this I am adding the dataview container to   AjaxRequestTarget,
> the method populateItem  of dataview gets called but not the constructor ,
> the constructor loads the data from database , so any change to my database
> is not reflecting in the  dataview becasue its not reloading the data , so
> please suggest me how can i tell the dataview component   to reload the data
> ?

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