Re: Refreshing a repeater component via ajax
If you use only this it would refer to the anonymous AjaxFallbackLink On Mon, May 11, 2015 at 1:33 PM, Andreas wrote: > > Yes. it works, but what in the above *this* means? Is not it the same with > next? > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Refreshing-a-repeater-component-via-ajax-tp4670710p4670714.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 > > -- Regards - Ernesto Reinaldo Barreiro
Re: Refreshing a repeater component via ajax
Yes. it works, but what in the above *this* means? Is not it the same with next? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Refreshing-a-repeater-component-via-ajax-tp4670710p4670714.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
Re: Refreshing a repeater component via ajax
Mind that your code gets removed once it arrives to the list: a known limitation of using nabble. I mean public ShoppingCartPanel(String id, Cart cart) { super(id); this.cart=cart; // make panel repaintable via AJAX. setOutputMarkupId(true) cartcomponent = new ListView("cart", new PropertyModel>(this, "cart.cheeses")) { @Override protected void populateItem(ListItem item) { Cheese cheese = item.getModelObject(); item.add(new Label("name", cheese.getName())); item.add(new Label("price", "$" +cheese.getPrice())); item.add(new AjaxFallbackLink("remove", item.getModel()) { @Override public void onClick(AjaxRequestTarget target) { Cheese selected = (Cheese) getModelObject(); getCart().getCheeses().remove(selected); if(target!=null){ target.add(ShoppingCartPanel.this); } } }); } }; add(cartcomponent); On Mon, May 11, 2015 at 12:48 PM, Andreas wrote: > Hi, > actualy I resolve it using a component wrapper, but I'm interesting in what > you realy suggest. > > > You might need to qualify this with a name: MyPanel.this and also make > > sure > > your panel call setOutputMarkupId(true) > > What is MyPanel? > Maybe you mean *Panel.this*? > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Refreshing-a-repeater-component-via-ajax-tp4670710p4670712.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 > > -- Regards - Ernesto Reinaldo Barreiro
Re: Refreshing a repeater component via ajax
Hi, actualy I resolve it using a component wrapper, but I'm interesting in what you realy suggest. > You might need to qualify this with a name: MyPanel.this and also make > sure > your panel call setOutputMarkupId(true) What is MyPanel? Maybe you mean *Panel.this*? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Refreshing-a-repeater-component-via-ajax-tp4670710p4670712.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
Re: Refreshing a repeater component via ajax
Hi, On Mon, May 11, 2015 at 11:49 AM, Andreas wrote: > Can't refresh a repeater component after removing an item. > Error: > /Last cause: Component com.shop.ShoppingCartPanel$1 has been added to the > target. This component is a repeater and cannot be repainted via ajax > directly. Instead add its parent or another markup container higher in the > hierarchy./ > > Who is the parent for the cartcomponent? A *Panel*? But using > *target.add(this)*; is also giving an error. > You might need to qualify this with a name: MyPanel.this and also make sure your panel call setOutputMarkupId(true) > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Refreshing-a-repeater-component-via-ajax-tp4670710.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 > > -- Regards - Ernesto Reinaldo Barreiro
Refreshing a repeater component via ajax
Can't refresh a repeater component after removing an item. Error: /Last cause: Component com.shop.ShoppingCartPanel$1 has been added to the target. This component is a repeater and cannot be repainted via ajax directly. Instead add its parent or another markup container higher in the hierarchy./ Who is the parent for the cartcomponent? A *Panel*? But using *target.add(this)*; is also giving an error. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Refreshing-a-repeater-component-via-ajax-tp4670710.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