Return-Path: X-Original-To: apmail-isis-users-archive@www.apache.org Delivered-To: apmail-isis-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7B061172DE for ; Wed, 18 Mar 2015 10:45:19 +0000 (UTC) Received: (qmail 99597 invoked by uid 500); 18 Mar 2015 10:45:19 -0000 Delivered-To: apmail-isis-users-archive@isis.apache.org Received: (qmail 99562 invoked by uid 500); 18 Mar 2015 10:45:19 -0000 Mailing-List: contact users-help@isis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@isis.apache.org Delivered-To: mailing list users@isis.apache.org Received: (qmail 99547 invoked by uid 99); 18 Mar 2015 10:45:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Mar 2015 10:45:19 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: local policy) Received: from [209.85.223.176] (HELO mail-ie0-f176.google.com) (209.85.223.176) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Mar 2015 10:45:14 +0000 Received: by iecsl2 with SMTP id sl2so34304501iec.1 for ; Wed, 18 Mar 2015 03:43:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=vBvqKv3EHiMNTBvxyTss6Z32w/DxTeBfVORzLqcTDg4=; b=Pm644106Up8hMvnZmXBDSnbZIoFzUn4+UWjunj1wkpv3o+Bu8fB3g6YRPdjlqa4yQx k1T9BVlO/2z9Uww+AqGFMYhoNkuKNYLlSxWP5G7DRGk82Y7AD9l7z+8mlBWyLQC/ZQMA ATWjD3UOC0TumMciqqxlbxcVxmUu6dJc1h79x5Q1FDgyr1ZMEp0ZcZyGszN3mbh4voBC Czzc//DM13wt00wU/n0LzL8dLrKQQ5onLLJ/6V1OFQhLj32TRBMnhrXjYDjNgA+8UDWV hSvzhVJs8TPXqvA2XQYtQv+Lkti7oENQtePiYy348Fmh24lDFSSTDOsDEvnYbsgfs0Ww e9LQ== X-Gm-Message-State: ALoCoQl0XqQsTfzjPx2zUarqlhNAW4nM5h3OhrLgkkGv6zQQSyeoxKkHY/Baqc6/5WZVSWIg/jIl X-Received: by 10.42.89.72 with SMTP id f8mr70481200icm.24.1426675428456; Wed, 18 Mar 2015 03:43:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.130.8 with HTTP; Wed, 18 Mar 2015 03:43:28 -0700 (PDT) X-Originating-IP: [193.178.95.4] In-Reply-To: References: <55084BAA.5010804@pocos.nl> <1CBC5811-A9CB-466F-9EED-F3A64CDC9CF2@gesconsultor.com> <550861B9.3070201@pocos.nl> <55093B5E.1020809@pocos.nl> From: Dan Haywood Date: Wed, 18 Mar 2015 10:43:28 +0000 Message-ID: Subject: Re: changing order of collection items To: users Content-Type: multipart/alternative; boundary=90e6ba6147e21faf1005118dc294 X-Virus-Checked: Checked by ClamAV on apache.org --90e6ba6147e21faf1005118dc294 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I've had two ideas on this. ~~~ The first is very generic... allow no-arg actions to be rendered as buttons on table rows. The action on the domain object (shown as a table row) would update state to change its apparent ordering). The viewer would then re-render the same collection in the same way it does currently for bulk actions (by invoking the finder that returned the list). ~~~ The other idea is a little more specialized; introduce a new Movable interface into the applib, eg: public interface Movable { void moveBetween(Object before, Object after); } Then, enhance the Wicket viewer so that "movable" objects could be dragged up and down; on release the viewer would invoke the "moveBetween" method passing the objects before and after the drop zone, and then (as above) re-render the list. ~~~ If either of these appeals then raise a ticket (actually, I think there might be one already for the first idea). In terms of actually implementing these tickets, I have no plans myself but Martin (as our resident Wicket expert) might either (a) oblige or (b) provide some guidance. Cheers Dan On 18 March 2015 at 09:06, Martin Grigorov wrote: > Hi, > > On Wed, Mar 18, 2015 at 10:46 AM, Erik de Hair wrote: > > > On 03/17/2015 09:16 PM, Martin Grigorov wrote: > > > >> Hi, > >> > >> Maybe you can use the Bulk support - select few items in the table, th= en > >> click Up/Down action and depending on the action increase/decrease the > >> rank > >> of the selected items. > >> > >> Martin Grigorov > >> Freelancer, available for hire! > >> Wicket Training and Consulting > >> https://twitter.com/mtgrigorov > >> > >> On Tue, Mar 17, 2015 at 7:17 PM, Erik de Hair > wrote: > >> > > Hi Martin, > > > > I thought your idea would be a nice solution but there's one problem wh= en > > moving succeeding items down. Each pair of items will switch ranks than > but > > won't move down. This could be solved by moving items down while > beginning > > at the bottom of the sorted set, but I don't think I can influence the > > order in which the bulk actions are called to the single items, do I? > > > > I can't expect users to only select 'solitary' items and I think it's n= ot > > possible to check for that condition. > > > > Would it be possible to create a different view for a datatable which > > displays the items (implementing some interface with methods like > > 'rankUp/Down()') with 2 buttons per row for moving a single item up or > > down, by calling rankUp/Down of this item? > > > Everything is possible! > The fastest and easiest way (for me!) would be to create a custom compone= nt > factory that creates a custom component for objects implementing this > special/custom interface and renders them as you wish. But this is me > thinking as a Wicket developer. Maybe Dan will have a better Isis solutio= n > for the problem. > > > > > > > > Erik > > > > Hi Oscar, Dan, > >>> > >>> I think my question wasn't really clear. The ordering in the table is > not > >>> the problem (I've already implemented the comparable interface based = on > >>> the > >>> mentioned rank-property). > >>> > >>> I need to arbitrarily change the order of the items by moving an item > up > >>> or down in the list (this should change the rank values). I was > wondering > >>> if anybody had an idea or any experience with an elegant way to > implement > >>> the moving-actions to be executed by the user. > >>> > >>> Thanks, > >>> Erik > >>> > >>> > >>> > >>> On 03/17/2015 05:48 PM, Dan Haywood wrote: > >>> > >>> And also, you can write a custom comparator and reference it using > >>>> > >>>> @CollectionLayout(sortedBy=3DMyCustomComparator.class) > >>>> > >>>> Cheers > >>>> Dan > >>>> > >>>> > >>>> > >>>> On 17 March 2015 at 16:39, GESCONSULTOR > wrote: > >>>> > >>>> Hi Erick. > >>>> > >>>>> Simply by implementing the Comparable interface. > >>>>> > >>>>> HTH, > >>>>> > >>>>> Oscar > >>>>> > >>>>> > >>>>> El 17/3/2015, a las 16:43, Erik de Hair > >>>>> escribi=C3=B3: > >>>>> > >>>>>> Hi, > >>>>>> > >>>>>> Anybody a great idea for changing item order in a sorted set using > the > >>>>>> > >>>>>> wicket viewer? I have a rank-property in the database but how to > >>>>> easily > >>>>> manage the item order (move item(s) up/down single or multiple > >>>>> places)... > >>>>> > >>>>> Thanks, > >>>>>> Erik > >>>>>> > >>>>>> > > > --90e6ba6147e21faf1005118dc294--