Hi,

Have you added the datatable to the AjaxRequestTarget of the link's onClick method? That should do it.

On 08/03/2012 7:56 PM, mlabs wrote:
I'm trying to refresh the model of a DataTable when the user clicks an ajax
link on my page...
I pass an instance of SortableDataProvider<foo>  to the table....
In the onClick() handler of the ajax link I call detach() on it ... hoping
that this will trigger a rebuild..but it doesn't ... the iterator() code
never gets hit again...
Here is my dataprovider.. some code omitted for clarity..

public class SortableFooDataProvider extends SortableDataProvider<Foo>{
   private List<Foo>  mRows;
   public SortableFooDataProvider(){..}

   @Override
   public Iterator(int i, int j){
     if (mRows==null)
       mRows = new ArrayList<Foo>();

     // fill mRows with rows.....

     return mRows.iterator();
   }

   @Override
   public int size(){
     return (mRows!=null)?mRows.size():0;
   }

   @Override
   public IModel<Foo>  model(Foo f) {return new Model(f);}

   @Override
   public void detach(){
     mRows = null;
     super.detach();
   }
}

any ideas what I'm doing wrong?

TIA




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/proper-way-to-refresh-a-DataTable-tp4458199p4458199.html
Sent from the Users forum mailing list archive at Nabble.com.

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


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

Reply via email to