If you implement the Assembler interface (rather than using the
sync-method tag), you can use the addItemToFill and removeItemFromFill
methods in the Assembler interface.  You should see the item get removed
from the fill at one location and added at another one.  This has not
been a heavily used feature so let me know if you run into problems with
it.  Here are the javadoc comments - note the "warning" about the fact
that these methods do not support any conflict detection:

 

    /**

     * Called when a client adds an item to a filled collection.

     * <p>

     * You can use this method to track changes made to a filled
collection

     * by client applications.  Usually the results of a fill are
maintained

     * by a query made on the server and so changes made by the client 

     * are temporary or replaced when the server has a chance to update
the fill

     * based on reexecuting the query.  In some cases though, you may
want 

     * to turn auto-refresh off for the fill, and track the changes made
by

     * the client to the filled collection.  You might do this if the
list of

     * items returned for a given fill is maintained by an explicit list
of

     * object ids.

     * </p><p>

     * Warning: if you need clients to maintain a consistent order

     * of items, you may not want to use this technique.  If two clients

     * insert different items into the same position at roughly the

     * same time, each will have processed the inserts in different

     * orders and so will have the two items swapped.  You can ignore

     * the position and maintain consistent lists where order is not

     * critical or the client sorts the list.

     * </p>

     * @param fillParameters the list of parameters which identify the
fill 

     * that the client changed.

     * @param position the index where a new item was added

     * @param identity the identity of the item added at the specified
position

     */

    void addItemToFill(List fillParameters, int position, Map identity);

 

    /**

     * Called when a client removes an item from a filled collection.

     * Like addItemToFill, you can use this method to monitor and record
changes made by

     * a client to a given filled collection.

     *

     * @param fillParameters the list of parameters which identify the
fill 

     * that the client changed.

     * @param position the index where a new item was removed

     * @param identity the identity of the item removed at the specified
position

     */

    void removeItemFromFill(List fillParameters, int position, Map
identity);

 

Jeff

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Robert Csiki
Sent: Tuesday, October 02, 2007 12:51 PM
To: [email protected]
Subject: [flexcoders] LCDS: Reordering managed collections?

 

Hello,

Suppose I have a managed collection and I want to reorder its items 
(say via Drag and Drop, on a TileList).
I want the FDS to save this new item order to the persistance layer 
(database).
On the LCDS side how to get the changes done as a result of 
rearranging the items done by the user?

I noticed my data service destination's "sync" method gets invoked by 
the framework, but it only contains what items to "delete" and what 
to "create", and nothing about the new item position in the list.

I am using the Java adapter on the LCDS side.
Please help.

Thanks
Robert

 

Reply via email to