Hi Sebastian,

currently, I am deleting the element that should be removed from the list and 
render the view again.
I am not calling #onRemove, but the code works, too. Therefore, I wanted to ask 
you if it is better to call #onRemove.

br, Chris



> Am 08.02.2015 um 19:55 schrieb Sebastien <seb...@gmail.com>:
> 
> Hi Chris,
> 
> Not sure to understand. OnRemove already removes from the list but also
> indicates that the model has changed...
> target.add(MySortable.this) re-render the sortable with the updated list.
> 
> So everything should work, that's why I am not sure to understand the
> question...
> 
> Thanks,
> Sebastien
> 
> 
> 
> On Sun, Feb 8, 2015 at 7:38 PM, Chris <chris...@gmx.at> wrote:
> 
>> Hi Sebastian,
>> 
>> thanks for the solution with #onConfigure - it works.
>> Would it also be an option to remove the item from the list<string> and
>> render the sortable again,
>> instead of calling  MySortable.this.onRemove?
>> 
>> Best regards
>> 
>> 
>>> Am 08.02.2015 um 19:13 schrieb Sebastien <seb...@gmail.com>:
>>> 
>>> Hi Chris,
>>> 
>>> As I told you earlier (but it seems it was in another post), in our case
>> we
>>> need to retrieve the item's data-hash for retrieving and deleting the
>>> correct item
>>> So the code becomes:
>>> 
>>> item.add(new AjaxLink<Void>("remove") {
>>> 
>>>   private static final long serialVersionUID = 1L;
>>> 
>>>   @Override
>>>   protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
>>>   {
>>>       super.updateAjaxAttributes(attributes);
>>> 
>>>       attributes.getDynamicExtraParameters().add("return { hash:
>>> jQuery(attrs.event.target).parent('li').data('hash') }");
>>>   }
>>> 
>>>   @Override
>>>   public void onClick(AjaxRequestTarget target)
>>>   {
>>>       int hashCode =
>>> RequestCycleUtils.getQueryParameterValue("hash").toInt();
>>>       String removedItem = list.get(ListUtils.indexOf(hashCode, list));
>>> 
>>>       MySortable.this.onRemove(target, removedItem);
>>>       MySortable.this.info("removed " + removedItem);
>>> 
>>>       target.add(MySortable.this);
>>>       target.add(feedback);
>>>   }
>>> });
>>> 
>>> Best regards,
>>> Sebastien
>>> 
>>> 
>>> On Sun, Feb 8, 2015 at 6:10 PM, Sebastien <seb...@gmail.com> wrote:
>>> 
>>>> Damned, I sent the mail a little bit to quickly... the button does not
>>>> remove the correct item if it has moved... Will fix that.
>>>> 
>>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to