[Wicket-user] delete row and update view?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[Wicket-user] delete row and update view?

frank06
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.
-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: [Wicket-user] delete row and update view?

Igor Vaynberg-2
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 <[hidden email]> 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 (<a href="http://www.wicket-library.com/wicket-examples/library" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> 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 <a href="http://fr.rd.yahoo.com/evt=42054/*http://fr.answers.yahoo.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> 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
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://sel.as-us.falkag.net/sel?cmd=lnk&amp;kid=120709&amp;bid=263057&amp;dat=121642" target="_blank"> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[hidden email]
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.sourceforge.net/lists/listinfo/wicket-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: [Wicket-user] delete row and update view?

frank06
In reply to this post by frank06
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: [hidden email]
Message-ID:
<[hidden email]>
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: [Wicket-user] delete row and update view?

Martijn Dashorst
Administrator
How do you populate your dataprovider? Does it query the database
again, or do you cache the list yourself?

Martijn

On 2/9/07, Francisco Treacy <[hidden email]> wrote:

> 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: [hidden email]
> Message-ID:
> <[hidden email]>
> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>


--
Vote for Wicket at the http://www.thebeststuffintheworld.com/vote_for/wicket
Wicket 1.2.4 is as easy as 1-2-4. Download Wicket now!
http://wicketframework.org

-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: delete row and update view?

Eelco Hillenius
Or: set a break point in your data provider's iterator(int, int)
method, confirms that it gets hit, and use the debugger to find out
what it returns.

Eelco


On 2/9/07, Martijn Dashorst <[hidden email]> wrote:

> How do you populate your dataprovider? Does it query the database
> again, or do you cache the list yourself?
>
> Martijn
>
> On 2/9/07, Francisco Treacy <[hidden email]> wrote:
> > 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: [hidden email]
> > Message-ID:
> > <[hidden email]>
> > 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
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> >
>
>
> --
> Vote for Wicket at the http://www.thebeststuffintheworld.com/vote_for/wicket
> Wicket 1.2.4 is as easy as 1-2-4. Download Wicket now!
> http://wicketframework.org
>
> -------------------------------------------------------------------------
> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>

-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: delete row and update view?

Igor Vaynberg-2
yep, sounds like something is being cached by hibernate. did you confirm the delete method properly removes a row?
what does your dataprovider and the rest of the page look like?

-igor


On 2/9/07, Eelco Hillenius <[hidden email]> wrote:
Or: set a break point in your data provider's iterator(int, int)
method, confirms that it gets hit, and use the debugger to find out
what it returns.

Eelco


On 2/9/07, Martijn Dashorst <[hidden email]> wrote:

> How do you populate your dataprovider? Does it query the database
> again, or do you cache the list yourself?
>
> Martijn
>
> On 2/9/07, Francisco Treacy < [hidden email]> wrote:
> > 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: [hidden email]
> > Message-ID:
> > <[hidden email]>
> > 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
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> >
>
>
> --
> Vote for Wicket at the http://www.thebeststuffintheworld.com/vote_for/wicket
> Wicket 1.2.4 is as easy as 1-2-4. Download Wicket now!
> http://wicketframework.org
>
> -------------------------------------------------------------------------
> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>

-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user


-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: delete row and update view?

frank06
In reply to this post by frank06
As Eelco suggested, i put a breakpoint in the iterator and it the (stupid) problem appeared.  The row was effectively deleted but the refreshing was only made in the DataProvider's constructor (not in the iterator)... so... I'm sorry... just started working with these :)

Thanks... Francisco

Date: Fri, 9 Feb 2007 09:51:57 -0800
From: "Igor Vaynberg"
Subject: Re: [Wicket-user] delete row and update view?
To: [hidden email]
Message-ID:
<[hidden email]>
Content-Type: text/plain; charset="iso-8859-1"

yep, sounds like something is being cached by hibernate. did you confirm the
delete method properly removes a row?
what does your dataprovider and the rest of the page look like?

-igor


On 2/9/07, Eelco Hillenius wrote:

>
> Or: set a break point in your data provider's iterator(int, int)
> method, confirms that it gets hit, and use the debugger to find out
> what it returns.
>
> Eelco
>
>
> On 2/9/07, Martijn Dashorst wrote:
> > How do you populate your dataprovider? Does it query the database
> > again, or do you cache the list yourself?
> >
> > Martijn



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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: delete row and update view?

Mark Doyle
This post has NOT been accepted by the mailing list yet.
Hi all,

Is there anyway to do this with something like a dropdown box or editable text field?

Adding a link to a table obviously provides you with an onclick to carry out the changes to the persistent store but the other component seem to work with forms.

For example, I have a table of data were one column represents the state of the item in the row.  This state can be one of x values defined in the data model.  If this was displayed by a dropdown box the user could choose a new value and hopefully when the box detected the change some callback would be triggered which could update the persistent store and refresh the page (normally or via ajax).