Re: Refreshing a repeater component via ajax

2015-05-11 Thread Ernesto Reinaldo Barreiro
Hi,

On Mon, May 11, 2015 at 11:49 AM, Andreas cinemat...@gmail.com 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


Re: Refreshing a repeater component via ajax

2015-05-11 Thread Andreas
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

2015-05-11 Thread Ernesto Reinaldo Barreiro
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 ListViewCheese(cart, new
PropertyModelListCheese(this, cart.cheeses)) {
@Override
protected void populateItem(ListItemCheese item) {

Cheese cheese = item.getModelObject();

item.add(new Label(name, cheese.getName()));
item.add(new Label(price, $ +cheese.getPrice()));

item.add(new AjaxFallbackLinkCheese(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 cinemat...@gmail.com 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

2015-05-11 Thread Ernesto Reinaldo Barreiro
If you use only this it would refer to the anonymous AjaxFallbackLink

On Mon, May 11, 2015 at 1:33 PM, Andreas cinemat...@gmail.com 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

2015-05-11 Thread Andreas

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