Adding multiple items at once to a SharedCollection

I'm playing around with Cocomo for the first time. I like it
a lot, but haven't yet got enough understanding of the API. So I'm
sure I'm missing something obvious.
Anyway. I want to build an application that share an array of
items between clients. The array should be persistent and when a
new client connects it will get the latest data. At the startup of
the first client I want to fill the shared array with default data.
I also want to revert to this data from time to time in an
applications lifecycle.
I've been checking out the examples and I think a
SharedCollection would be perfect for this scenario (not sure if it
really is?).
The problem I have is when I try to fill the SharedCollection
with data, using the addItem method within a for loop, I only get
an entry with the last item, instead of multiple entries (I'm
checking what data that has been added by using the Dev Console).
I'm doing all this in the SYNCHRONIZATION_CHANGE event (only the
first time it's fired).
I should also note that this happens the first time, when no
CollectionNode already is created. When a CollectionNode already
exist it works.
Is this totally the wrong way to go? Am I missing something
about how CollectionNodes should be created? Any help is highly
appriciated!

Hi ,
I actually modified the SharedCollectionExample locally to
have items added in the beginning in synchrinization change
handler. It works fine for me , here is what I did
In the SharedCollectionExample in the examples folder ,
add this line
_model.addEventListener(CollectionNodeEvent.SYNCHRONIZATION_CHANGE,onSynchronizationChang e);
in the onCreationComplete() method where you first declare
SharedCollection Class.
And in the
private function
onSynchronizationChange(p_evt:CollectionNodeEvent):void
if ( _model.isSynchronized ) {
_model.addItem({State:"Nevada",Capital:"Carson City"});
_model.addItem({State:"California",Capital:"Sacramento"});
I can get multiple items( i.e. these two items i added) in
the very beginning. If you check that the model ( SharedCollection)
is synchronized and add within it the items it should work fine and
will give you an initial set of items. Also, shared collection has
a property called idField and it will index objects based on this
field value with duplicates being overwritten.
I hope this helps. Otherwise please copy fractions of code
where you are still finding problem.
Thanks
Hironmay Basu

Similar Messages

  • How do I delete multiple items at once instead of one at a time?

    How do I delete multiple items at once instead of one at a time? I have several duplicate items in my library and would like to delete the duplicates. Thanks!

    You can select multiple items using shift to select a range and control to add or remove items from it.
    Regarding duplciates, Apple's official advice is here... HT2905 - How to find and remove duplicate items in your iTunes library. It is a manual process and the article fails to explain some of the potential pitfalls.
    Use Shift > View > Show Exact Duplicate Items to display duplicates as this is normally a more useful selection. You need to manually select all but one of each group of identical tracks to remove. Sorting the list by Date Added may make it easier to select the appropriate tracks, however this works best when performed immediately after the dupes have been created.  If you have multiple entries in iTunes connected to the same file on the hard drive then don't send to the recycle bin. This can happen, for example, if you start iTunes with a disconnected external drive, then connect it, reimport from your media folder, then restart iTunes.
    Use my DeDuper script if you're not sure, don't want to do it by hand, or want to preserve ratings, play counts and playlist membership. See this thread for background. Please take note of the warning to backup your library before deduping, whether you do so by hand or using my script, in case something goes wrong.
    (If you don't see the menu bar press ALT to show it temporarily or CTRL+B to keep it displayed)
    tt2

  • Adding Multiple Buddies at Once

    iChat and Address Book work seamless together, but the one thing that I cannot stand is the fact that when you add a person to your iChat buddy list from your address book, you can only add ONE contact at a time. Once you click on the name from the list and click "Add" you then have to go down to the "+" sign and scroll down the list of contacts again to find the next person... rinse, lather, repeat. This is VERY obnoxious.
    Is there any way to select more than one contact at a time and hit "Add" to speed up the process? I've tried all the normal ways of selecting more than one item... holding down CMD key or the shift key... nothing works. Anyone else found a way around this?

    Hi,
    AIM actually stores your Buddy List on their Servers.
    iChat offers the ability to Add "Real Names" which then allows it to be put in the Address Book as well.
    I do not believe screen names only are stored on your Mac.
    3:10 PM Sunday; September 2, 2007

  • How do i place multiple items at once in my order?

    i've created several cards and a book, but the option to buy is only 1 item at a time

    no
    again
    except for photos every different item is a different order
    Only orders for multiple copies of identical items can be shipped for one fee
    LN

  • Adding multiple items against one service call

    deal all,
    i need to know , how can we add more then one item to one service call. is there any solution or add-on for this purpose.

    You can add only one item (to be specific only one Serial Number ) in one Service Contract.
    I don't think there is any add-on available for that.

  • Is there a way to select multiple items in the open dialogue (ctrl+O)?

    Sometimes I would like to open multiple items at once using ctrl+O, but in the dialogue, I can only select one item at a time.
    This also applies to Firefox 4.

    No, sorry. I suppose you could try running the files via Windows Explorer.

  • Adding multiple schemas to a workspace

    We use Oracle Applications for our ERP, and I've just had our DBA set up APEX. One of the first things I noticed, however, was that the object browser only shows the schema(s) that have been explicitly assigned to the workspace. I found in the help how to add another schema to the list (have the DBA log in to the admin page and create the new link), but it looked like there wasn't any support for adding multiple schemas at once. Since the applications use a lot of schemas (AP, AR, INV, PO, ONT, WSH, etc., etc.), it'd be great if I didn't have to have him doing all of this manually.
    Suggestions?
    Or do we just need to do it, secure in the knowledge that we should only have to do it a few times?
    (Also, is there any way to have the object browser filter down to tables/views that the APEX user has grants on?)
    Thanks,
    -David

    Peter,
    Thanks, that gave us what we wanted. Though now I'm not sure if it's what we should actually have. After adding the schemas, we found that we could manipulate anything we wanted in those schemas (create tables, view and update data, etc.) without having to do explicit grants. This is an obvious security issue...
    My first thought is to remove almost all of the schemas and create views in the APEX schema to the other tables that we're going to need, but I'm concerned that doing so will be a development and maintenance headache as our toolbase expands to include more and more of the Oracle Application tables. Is there a better solution that I'm not aware of?
    -David

  • Adding multiple artwork files to several items on iTunes 11

    Hi all.
    in previous versions of itunes one could add artwork in several ways one of which allowed for easily adding several artwork files to more than one item at once without replacing the existing artwork.
    I am talking about the little square that was on the left bottom corner of the screen and you could chose if you want to watch the artwork for the currently playing song or the selected song. you could paste into it or simply drag onto it. it would add the art work in appose to replace the existing one as happens when you do it from the info window.
    this little square disappeared from version 11 and now I am unable to add several files to several items at once.
    anyone solved this pickle?

    treyer11 wrote:
    IThe point is, I could drag and drop previously and have gone backwards in capability which is supposedly against what Apple platforms inherently stand for.
    The point is it has not gone backwards in capability. It works just fine. I can drag & drop to multiple selected items just fine.
    Something is wrong wtih your install.

  • How do I change multiple list items at once in a SharePoint list with ribbon button

    Hi
    I have a sharepoint list and a ribbon button that open a dialog box with buttons to set color on a row
    The problem is that i can only selecet one item at once to set the color. 
    How can i do so it could set all or a couple items att once to the color i want 
    I want to do this with javascript
    here is the code i use to get the item id and the color code is in a seperate js file
    'use strict';
    var clientContext, hostweburl, parentContext, parentWeb, selectedItem, itemId, listId;
    clientContext = new SP.ClientContext.get_current();
    hostweburl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
    listId = decodeURIComponent(getQueryStringParameter("SPListId"));
    itemId = decodeURIComponent(getQueryStringParameter("SPListItemId"));
    parentContext = new SP.AppContextSite(clientContext, hostweburl);
    parentWeb = parentContext.get_web();
    selectedItem = parentWeb.get_lists().getById(listId).getItemById(itemId);
    $(document).ready(function () {
    clientContext.load(selectedItem);
    clientContext.executeQueryAsync(OnSuccess, OnFail);
    function OnSuccess() {
    $("#Blue").click(function () {
    selectedItem.set_item('Color', 'Blue');
    selectedItem.update();
    clientContext.load(selectedItem);
    clientContext.executeQueryAsync(function () { window.parent.postMessage('CloseCustomActionDialogRefresh', '*'); }, function (sender, args) { alert('Error:' + args.get_message()); });
    $("#Green").click(function () {
    selectedItem.set_item('Color', 'Green');
    selectedItem.update();
    clientContext.load(selectedItem);
    clientContext.executeQueryAsync(function () { window.parent.postMessage('CloseCustomActionDialogRefresh', '*'); }, function (sender, args) { alert('Error:' + args.get_message()); });
    $("#Red").click(function () {
    selectedItem.set_item('Color', 'Red');
    selectedItem.update();
    clientContext.load(selectedItem);
    clientContext.executeQueryAsync(function () { window.parent.postMessage('CloseCustomActionDialogRefresh', '*'); }, function (sender, args) { alert('Error:' + args.get_message()); });
    $("#Transparent").click(function () {
    selectedItem.set_item('Color', 'No Color');
    selectedItem.update();
    clientContext.load(selectedItem);
    clientContext.executeQueryAsync(function () { window.parent.postMessage('CloseCustomActionDialogRefresh', '*'); }, function (sender, args) { alert('Error:' + args.get_message()); });

    Check if below can help you
    http://sp2010batchedit.codeplex.com/
    http://sharepoint.stackexchange.com/questions/35935/use-view-ribbon-custom-action-on-multiple-list-items
    http://webcache.googleusercontent.com/search?q=cache:XqMO-PRLHQIJ:dannyjessee.com/blog/index.php/2014/06/enabling-custom-ribbon-buttons-dynamically-based-on-multiple-selected-item-values-using-refreshcommandui-and-jsom/+&cd=1&hl=en&ct=clnk&gl=in
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction Id="DannyJessee.TestCustomAction"
    Location="CommandUI.Ribbon"
    RegistrationId="100"
    RegistrationType="List">
    <CommandUIExtension>
    <CommandUIDefinitions>
    <CommandUIDefinition
    Location="Ribbon.ListItem.Actions.Controls._children">
    <Button Id="DannyJessee.MarkItemsFinishedButton"
    Command="cmdMarkItemsFinished"
    Image16by16="/_layouts/images/kpinormallarge-0.gif"
    Image32by32="/_layouts/images/kpinormallarge-0.gif"
    LabelText="Mark as Finished"
    TemplateAlias="o2" />
    </CommandUIDefinition>
    </CommandUIDefinitions>
    <CommandUIHandlers>
    <CommandUIHandler Command="cmdMarkItemsFinished"
    CommandAction="javascript:MarkItemsFinished();"
    EnabledScript="javascript:EnableFinishedButton();">
    </CommandUIHandler>
    </CommandUIHandlers>
    </CommandUIExtension>
    </CustomAction>
    <CustomAction Id="DannyJessee.TestScript"
    Location="ScriptLink"
    ScriptSrc="/_layouts/15/CustomRibbonButton/CustomAction.js" />
    </Elements>
    If this helped you resolve your issue, please mark it Answered

  • HT1451 when editing info, how do i select multiple items to edit a group? For example, changing the artist name on multiple tracks at once?

    when editing info, how do i select multiple items to edit a group? For example, changing the artist name on multiple tracks at once?

    Same way you select multipl items anywhere else.
    Hold ctrl and click the items you want.
    If they are in consecutive order, click the 1st then Shift click the last.

  • IMporting multiple albums at once: sort on date added AND album or artist

    When importing multiple albums at once, iTunes ads them in the library in an all mixed up order.
    This makes it very annoying to change song info. I have to multi-select songs from the same album (clicking while pressing the control button) and then change stuff.
    1. Why can't iTunes automaticaly keep tracks from the same album together when adding new music from multiple albums?
    2. Why can't we sort by added date AND another column like artist or album?
    any solutions are very welcome
    greetz

    The order iTunes is showing the tracks can be changed. Select the album column heading to get tracks list in album order. Normally within an album the tracks will list in track order when viewing this way.

  • Inbound Invoices (EDI 810) with multiple items that are the same keys.

    One of our Vendors just started sending us 810's that have multiple items with the same P.O., Delivery, P/N, Price, etc.  The reason is that they (and we) track inbound batches for the purpose of traceability, so the only difference between items on both the invoice and inbound delivery is the batch number.
    SAP will not allow the automatic creation of an SAP Invoice with these conditions.  The error message is M8321 - 'Document contains same order item more than once'.
    SAP Note 103051 says it cannot be done, and you must "Deactivate the billing of the batch sub-items in SD Customizing" in order to have an Invoice created that combines all items into one.
    Does anyone know how to do that?
    Thanks in advance!

    Nevermind. Fixed the problem. Two menu items both began with the letter S. Added an & before the second letter of the second menu item and now the problem is fixed. First items hotkey is S and the second items hotkey is now h (which is the second letter of the 2nd menu item).

  • ITunes 9.2 stops adding multiple artwork in multiple selection mode. Help?

    Hi everybody,
    Since 2003 I've been using iTunes and adding multiple artwork in several tracks at once.
    Lets say: I added 10 tracks of a CD to iTunes library, then selected all of them and then right click to choose "Get Info > Multiple Item Information". Then I just dragged and dropped as many artwork pieces as I wanted onto the artwork window, one by one. Clicked OK and voilá.
    Now it will only accept one artwork. Following the procedure I used to do, now it will only take the last artwork I place onto the artwork window.
    Now the only way to get multiple artwork in a CD is adding all the artwork (lets say the 20 pages of the booklet) one by one in "each track" separately!, which is a pain in the neck.
    So now I have to add artwork one by one to each track one at a time.
    Is there a NEW way to add multiple artwork on multiple tracks at once in iTunes 9.2?
    Screen shot: http://grab.by/51UT
    Thank you for your help.

    Hi- you might've already figured this out on your own, but:
    A) add the first artwork picture (what you want for your cover artwork) using "Get Info > Multiple Item Information" - and close the Multiple Item Information window
    B) with the multiple tracks still selected, drag your additional artwork picture items into the artwork panel in the lower left corner of the iTunes window (this is the artwork panel titled "selected item").
    C) your additional artwork will be added to all of the selected items. You can click through the artworks using the left/right arrows above the artwork panel.
    Obviously you can also use this same method to add that same additional artwork to any other tracks, from other albums, etc. simply by selecting them as well.
    Side note, the easiest way to select all tracks from a single album: select the starting track, then use ctrl-shift and select the ending track- all tracks between those two will be selected.
    Aaaaaand you're done! Hope this helps!

  • Trying to customize a multiple item lookup field using JSLink

    I'm trying to Customize a multiple item lookup field using JSLink, in SP 2013. This illustrates what I want to do:
    I can replace the ";" with <br /> in the Text column, but not the Lookup column. Here is the JSLink code I'm using for the Text column. 
    (function () {
    var overrideCtx = {};
    overrideCtx.Templates = {};
    overrideCtx.Templates.Fields = {
    'Text': { 'View' : '<#=ctx.CurrentItem.Text.toString().replace(";","<br />")#>' }
    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
    How can I display each item on separate lines in the Lookup column?

    You can retrieve the values of the lookup column and reformat their display by replacing the following:
    overrideCtx.Templates.Fields = {
    'Text': { 'View' : '<#=ctx.CurrentItem.Text.toString().replace(";","<br />")#>' }
    with something like this:
    overrideCtx.Templates.Fields = {
    'Lookup': { 'View' : function(ctx) {
    var arr=[];
    var fld=ctx.CurrentItem[ctx.CurrentFieldSchema.Name];
    for (i=0; i<fld.length; i++) {
    arr.push(fld[i].lookupValue);
    return arr.join("<br/>");
    Here we are looping through each lookup value contained in the multi value lookup field and adding it to an array. Once complete, we use join to flatten the array and separate each entry with the <br/>. Note...this will show each value on a new line,
    but it will be the string value without the hyperlink.  If you want the actual hyperlink to the item, you can rebuild the hyperlink and add that to the array instead. You can get the item's display form from ctx.CurrentFieldSchema.DispFormUrl and the
    item's id from fld[i].lookupId for rebuilding the hyperlink.

  • Multiple Item Information - Sorting: broken?

    I think the Album Artist column is near the top of the sorting hierarchy. Previously if I entered more than one Album Artist for a single album that would take precedence over track numbers in my listing (sorted by Album). I could neutralize this by putting a "1" or common word into the 'Album Artist' entry of the 'Multiple Item Sorting' Tab. That's the one you get when you Get Info on a whole album.
    This is broken now. Or at least does not have the effect it used to. Putting a common word there for the entire album does not allow the album to sort by another criterion.

    *HowTo: Grouping Tracks Into Albums*
    Excuse the long post, but hopefully covering all the bases (that I can think of) will help you fix the other issues you are likely to run into as you try to organise your iTunes library.
    *Use an album friendly view*
    iTunes will let you sort music on many columns, some of which are unlikely to group albums together or put the tracks in their normal order. The most useful order for editing the library is probably *Album by Artist*. If you're not already there, select the list view and click on the column heading for Album until it reads Album by Artist.
    *One cover, too many tracks*
    The iPod (and iTunes to a lesser extent) conflates two or more albums with the same title, most obviously with *Greatest Hits*. On the iPod this can result in one album acting as a combination of two or more. Selecting any cover gives all the tracks of all albums with the same title. The workaround for this "Greatest Hits" bug is to give each album a unique title - I tend to go for *Album - Album Artist* as this reads clearly in the iTunes browser. Alternatively you could use the wording as it appears on the cover or append different numbers of spaces for each different album. Somewhat oddly, setting different values for Sort Album doesn't work.
    *Missing Artist or Album not with others by same artist*
    iTunes relies on the Gracenote CDDB database when identifying CD's. This often marks collections or anthologies of an artist's work as a compilation. In iTunes, however, the compilation flag has the logical function of grouping together tracks with the same album name, but different artists on each track, e.g. "Now That's What I Call Metal 666!". These compilations are then all grouped together at the end of cover flow. Most of us however, would expect "Greatest Hits" albums to be listed with the other albums by the same album artist. For albums which are essentially by a single album artist or group it is best to set the appropriate value for the album artist and clear the compilation flag.
    *One album, too many covers*
    For true compilations, where each track is by a different artist, the answer is to set the compilation flag to true and enable the iTunes preference to *Group compilations when browsing*. If the album is not a compilation however, any tracks which list guest artists may be treated as separate items. Filling in the Album Artist field is enough to link things in iTunes. Sadly, however, the iPod ignores the Album Artist field when grouping albums so this is only a partial solution. You can simply mark the entire album as a compilation which seems to be the way iTMS handles it, however that's not an ideal fix. Short of waiting for Apple to address this issue (and as far as I can tell it goes back to the 1st gen. of iPods) we need a workaround. What I do is to put any additional artist info. in square brackets after the song name. E.g. *Track \[Feat. Guest\]* and then set *Artist=Album Artist* for each track. For anthologies where the Album Artist is credited as part of another group, e.g. for Cream tracks on an Eric Clapton anthology, I use *Track \[As Group\]*. For a track where the main Album Artist doesn't receive a credit, e.g. the first track of the Slim Shady LP credited to Jeff Bass, I just set the track name to *Track \[Guest\]* while still setting the artist to the album artist. N.b. I use square brackets to indicate that this is information about the track as distinct from the song title and also use this style for Mix/Live/Bonus info.
    Addendum: I don't own an iPhone or iPod Touch to check but I'm told that with the V3.x firmware these now group tracks on the value of Album Artist in a logical fashion.
    *One album, still too many covers*
    iTunes may split albums into two or more sections if some tracks from the album have different values for Artist, Album Artist, Album, No. of Discs or Part of a Compilation. Tiny differences such as trailing spaces, accented characters or variants of symbols can sometimes be quite hard to spot. The iPod is also more sensitive to case variations and may split or reorder an album that looks okay in iTunes. Normally overtyping the desired value for each shared field will complete the grouping of the album into one entity. Occasionally, however, this method seems to fail. When this happens I've found that you can force every field to update properly by adding some extra text - e.g. a trailing X, which once applied seems to complete the joining of the tracks into one album. Once this has happened the extra data can be removed and the album should remain properly grouped.
    *Tried that, there are STILL too many covers!*
    The Sort Artist, Sort Album & Sort Album Artist fields can be used to override the normal sort order. For example iTunes automatically drops leading articles (a/an/the) so "The Beatles" are arranged under "B" instead of "T". Occasionally different tracks from the same album can have different values in these sort fields which can also break up the grouping. Making the sort columns visible in iTunes can help with spotting & correcting such problems.
    *One cover for multi-disc album*
    Multi-disc albums are often listed as *Album (CD1)* for CD 1, *Album (CD2)* for CD 2 etc. To display these properly using just one cover, each disc should have the correct *Disc X of Y* values set, and then the entire album should be given the single title Album. Being somewhat obsessive I also renumber the tracks sequentially, working backwards from the last track (so that no two tracks ever have the same number) until I reach disc 1. BTW You can still give the individual discs different artwork should it be relevant so that the correct artwork will be displayed as the album progresses.
    *Tracks out of sequence*
    Check that all tracks have the same/correct disc no. For a single disc album this should be either blank (my preference) or 1 of 1. iTunes will sort tracks with a disc no. of 1 before those that are blank. Just for fun the iPod sorts them the other way around. In addition ensure that the Artist, Album Artist, Album, Sort Artist, Sort Album Artist & Sort Album fields are consistent across all tracks.
    N.B. The first release of iTunes 9 is ignoring the disc no. value when sorting as Album by Artist or Album by Year. Either make the track numbers seqential across the album or live with it until the next build.
    *One artist, many names*
    With some artists, particularly classical composers, you should be aware of alternative representations of their names. E.g. 2Pac vs. Tupac. The menus will work best if for each artist you standardise on just one form of their name. E.g. make a choice between Mozart, W.A. Mozart or Wolfgang Amadeus Mozart, and then apply it consistently. For classical music I tend also to use the Composer as the Artist & Album Artist and either discard the performer details or place these into the Comments field. The Sort Artist/Sort Album Artist fields can group alternate forms in iTunes but these will break up again on the iPod. It is best therefore to use Artist & Album Artist consistently so that the name is displayed the way that you want and Sort Artist & Sort Album Artist to control where it is listed.
    Addendum: Again I don't own an iPhone or iPod Touch to check but I'm told that with the V3.x firmware the system fails to pick up on the Sort Album Artist value and sorts albums in Cover Flow by Album Artist instead.
    tt2

Maybe you are looking for