Igor,
Well, actually nothing happens :)

 final DataView dataView = new DataView("listing", myDataProvider)
  {
   protected void populateItem(final Item item)
   {
    Product product
 = (Product
)item.getModelObject();

    item.add(new Link("delete-product")
    {
     public void onClick()
     {
      // Service call to delete the product
      service.delete(........);
      // Nothing else to call here for view update?
     }
    });
    item.add(new Label("product-id", product.getId().toString()));
    
    ...


I took the example from the repeaters example, OIRPage.java... what am I doing 
wrong?
Seems like a Hibernate-cache thingy otherwise... how do I make to be sure the 
table refreshing has the same effect as clicking its link (when I click 
ProductList link in my page header, it shows the updated view) ?

Francisco

Date: Thu, 8 Feb 2007 16:11:49 -0800
From: "Igor Vaynberg" 
Subject: Re: [Wicket-user] delete row and update view?
To: wicket-user@lists.sourceforge.net
Message-ID:
 <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"

actually you need to do nothing :)

after onclick for your delete link is done executing the page will refresh
and so will the dataview. when it refreshes it will call methods on the
dataprovider again and refresh accordingly

-igor


On 2/8/07, Francisco Treacy  wrote:
>
> I have a DataView fed by a SortableDataProvider  to display a pageable and
> sortable table. In each row, I have a link to delete the current item.
>
> My problem is that I cannot find the way to remove from the view the item
> I just deleted in the database by clicking on the link. I need to refresh
> immediately the view in order to reflect the actual state... but don't know
> how.
> I tried with lots of possibilites like rendering the item, disabling it,
> hiding it... but nothing...
>
> Wicket Library example (
> http://www.wicket-library.com/wicket-examples/library) does what I want,
> but uses a PageableListView. And I think I need DataView because it has
> better capabilities.
>
> What should I do to be sure that each time I fire an action (add, delete,
> edit), my view is going to reflect my actual model?
>
> Thanks!
> Francisco
>
> ------------------------------
> D?couvrez une nouvelle fa?on d'obtenir des r?ponses ? toutes vos questions
> ! Profitez des connaissances, des opinions et des exp?riences des
> internautes sur Yahoo! Questions/R?ponses
> .


                
---------------------------------
 Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur 
Yahoo! Questions/Réponses.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to