You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Haulyn R. Jason" <sa...@gmail.com> on 2009/11/12 13:06:43 UTC
How to update model when using AjaxFallbackLink
Hi:
I am using AjaxFallbackLink.
I have a ListView in a container, and a AjaxFallbackLink per row for delete
the current row. But When I click the link, I find the data is deleted but
the current ListView doesn't refresh. I think that's because the list object
didn't be refreshed, but I do not know where to put my code.
The following is my AjaxFallbackLink code:
item.add(new AjaxFallbackLink("removeLink") {
@Override
public void onClick(AjaxRequestTarget target) {
_resourceForm.setEnabled(false);
_securityService.removeResource(resource);
_resources = _securityService.queryResources();
------------> I update my list model here
info(success");
target.addComponent(_listContainer);
target.addComponent(_resourceForm);
}
});
Is there something I forget to?
--
Thanks!
VVThumb Production
Location: Shumagang 6H-8, Jinan, Shandong, China 250000
Mobile: +086-15864011231
email: haulynjason@vvthumb.com
website: http://haulynjason.net
gtalk: saharabear@gmail.com
skype: saharabear
QQ: 378606292
msn:saharabear@gmail.com <ms...@gmail.com>
yahoo:jia_haolin@yahoo.com <ya...@yahoo.com>
Twitter: http://twitter.com/saharabear
Linkedin: http://www.linkedin.com/in/haulyn
Haulyn Jason
Re: How to update model when using AjaxFallbackLink
Posted by "Haulyn R. Jason" <sa...@gmail.com>.
Hi, Santos:
That works,thanks. I just update my list, but forget to maintain listview's
model.
On Thu, Nov 12, 2009 at 8:11 PM, Pedro Santos <pe...@gmail.com> wrote:
> listOnListViewModel.remove(resource);
> than you remove the data form your db (service.remove()), and your view
>
> On Thu, Nov 12, 2009 at 10:06 AM, Haulyn R. Jason <saharabear@gmail.com
> >wrote:
>
> > Hi:
> >
> > I am using AjaxFallbackLink.
> >
> > I have a ListView in a container, and a AjaxFallbackLink per row for
> delete
> > the current row. But When I click the link, I find the data is deleted
> but
> > the current ListView doesn't refresh. I think that's because the list
> > object
> > didn't be refreshed, but I do not know where to put my code.
> >
> > The following is my AjaxFallbackLink code:
> >
> > item.add(new AjaxFallbackLink("removeLink") {
> >
> > @Override
> > public void onClick(AjaxRequestTarget target) {
> > _resourceForm.setEnabled(false);
> > _securityService.removeResource(resource);
> > _resources =
> _securityService.queryResources();
> > ------------> I update my list model here
> > info(success");
> > target.addComponent(_listContainer);
> > target.addComponent(_resourceForm);
> > }
> > });
> >
> > Is there something I forget to?
> >
> > --
> > Thanks!
> >
> > VVThumb Production
> >
> > Location: Shumagang 6H-8, Jinan, Shandong, China 250000
> > Mobile: +086-15864011231
> > email: haulynjason@vvthumb.com
> > website: http://haulynjason.net
> > gtalk: saharabear@gmail.com
> > skype: saharabear
> > QQ: 378606292
> > msn:saharabear@gmail.com <ms...@gmail.com> <
> msn%3Asaharabear@gmail.com <ms...@gmail.com>> <
> > msn%3Asaharabear@gmail.com <ms...@gmail.com> <
> msn%253Asaharabear@gmail.com <ms...@gmail.com>>>
> > yahoo:jia_haolin@yahoo.com <ya...@yahoo.com> <
> yahoo%3Ajia_haolin@yahoo.com <ya...@yahoo.com>> <
> > yahoo%3Ajia_haolin@yahoo.com <ya...@yahoo.com> <
> yahoo%253Ajia_haolin@yahoo.com <ya...@yahoo.com>>>
> > Twitter: http://twitter.com/saharabear
> > Linkedin: http://www.linkedin.com/in/haulyn
> >
> > Haulyn Jason
> >
>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>
--
Thanks!
VVThumb Production
Location: Shumagang 6H-8, Jinan, Shandong, China 250000
Mobile: +086-15864011231
email: haulynjason@vvthumb.com
website: http://haulynjason.net
gtalk: saharabear@gmail.com
skype: saharabear
QQ: 378606292
msn:saharabear@gmail.com <ms...@gmail.com>
yahoo:jia_haolin@yahoo.com <ya...@yahoo.com>
Twitter: http://twitter.com/saharabear
Linkedin: http://www.linkedin.com/in/haulyn
Haulyn Jason
Re: How to update model when using AjaxFallbackLink
Posted by Pedro Santos <pe...@gmail.com>.
listOnListViewModel.remove(resource);
than you remove the data form your db (service.remove()), and your view
On Thu, Nov 12, 2009 at 10:06 AM, Haulyn R. Jason <sa...@gmail.com>wrote:
> Hi:
>
> I am using AjaxFallbackLink.
>
> I have a ListView in a container, and a AjaxFallbackLink per row for delete
> the current row. But When I click the link, I find the data is deleted but
> the current ListView doesn't refresh. I think that's because the list
> object
> didn't be refreshed, but I do not know where to put my code.
>
> The following is my AjaxFallbackLink code:
>
> item.add(new AjaxFallbackLink("removeLink") {
>
> @Override
> public void onClick(AjaxRequestTarget target) {
> _resourceForm.setEnabled(false);
> _securityService.removeResource(resource);
> _resources = _securityService.queryResources();
> ------------> I update my list model here
> info(success");
> target.addComponent(_listContainer);
> target.addComponent(_resourceForm);
> }
> });
>
> Is there something I forget to?
>
> --
> Thanks!
>
> VVThumb Production
>
> Location: Shumagang 6H-8, Jinan, Shandong, China 250000
> Mobile: +086-15864011231
> email: haulynjason@vvthumb.com
> website: http://haulynjason.net
> gtalk: saharabear@gmail.com
> skype: saharabear
> QQ: 378606292
> msn:saharabear@gmail.com <ms...@gmail.com> <
> msn%3Asaharabear@gmail.com <ms...@gmail.com>>
> yahoo:jia_haolin@yahoo.com <ya...@yahoo.com> <
> yahoo%3Ajia_haolin@yahoo.com <ya...@yahoo.com>>
> Twitter: http://twitter.com/saharabear
> Linkedin: http://www.linkedin.com/in/haulyn
>
> Haulyn Jason
>
--
Pedro Henrique Oliveira dos Santos