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 <[email protected]>:
> 
> 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 <[email protected]> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to