Remote Object: Do I have to call "read" every time I change data?

I have a dataset of about 500 records that I need to read
into a datagrid and be able to add, modify or delete. Using
remoteObject, I call a 'read' method which gets the data and
populates the datagrid. Reading the data alone takes about 6-8
seconds, which is acceptable when first opening the application.
However, to keep the data fresh after each addition or
modification, I have to re-read the data into an arrayCollection.
Is there any way to update only the record(s) that is
affected by the changes, so I don't have to keep reading the whole
table and refreshing the arrayCollection each time I make a
change?

Yes, this would be one option. When receiving the data from
your DB, you could save this data to your primary (display)
ArrayCollection and a copy (source.concat()) to a secondary
ArrayCollection. After modifying the items on your primary
ArrayCollection you could compare both Collections and generate a
third Collection containing only the changed objects. This third
collection would be the one you send back to be updated at your DB.
The second method, which i would particularly recommend is
saving each modification and just returning the modified object.
For instance, your Collection has 10 items and you are modifying
the 3rd item, id = 3. After editing this item you could save its
index (2) and your update method returns only the modified item
instead of a new list (select * from my_table where id = 3). Now
knowing its index (as var or AsynkToken property) you could easily
update/substitute this item on your collection.
Choosing between each option will depend only on what you
intend do do. You may also create some variations in order to get
more or less security while changing your data.
Regards,
Peter

Similar Messages

  • When creating a new window in safari, using command T, the marker have not activated the search field. It means you have to click there every time. Changed after upgrading to Mavericks. Anyone knows how to change this?

    When creating a new window in safari, using command T, the marker have not activated the search field. It means you have to click there every time. Changed after upgrading to Mavericks. Anyone knows how to change this?

    Yes, you can do something like that. What you would do is create a button for each image and then hide them. When I do this type of thing I place all of the buttons on a template page and then hide the template.
    You can then use JavaScript to copy the icon from any of the hidden buttons to the main button that you've set up to display the image. For example, suppose you set up 10 buttons named b1, b2, b3, ...b10. The code to copy the icon from one of them to the button used to display the image (b0) would be something like this:
    // Get the icon from the b3 button
    var oIcon = getField("b3").buttonGetIcon();
    // Get  reference to the b0 button
    var f = getField("b0");
    // Set the icon of the b0 button to the icon retrieved from the hidden button
    f.buttonSetIcon(oIcon);
    // Show the b0 button
    f.display = display.visible;
    This code would go in the Mouse Up event of the smaller button.

  • Why do I have to contact support every time I change payment method

    i have ate to contact support when I change payment method why

    We are fellow users, we won't know why. If you are frequently changing your payment method then that might be why - if you've got the message to contact them again then you could see if they can see why it's happening and if they or you can do anything to stop it happening.

  • Please recommend if we have options to read xml file and insert data into table without a temporary table.

    Please recommend if we have options to read xml file and insert data into table without a temporary table. 

    DECLARE @data XML;
    SET @data =N'<Root>
    <List RecordID="946236" />
    <List RecordID="946237" />
    <List RecordID="946238" />
    <List RecordID="946239" />
    <List RecordID="946240" />
    </Root>'
    INSERT INTO t (id) SELECT T.customer.value('@RecordID', 'INT') AS id
    FROM @data.nodes('Root/List')
     AS T(customer);
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • I have downloaded adobe reader 20 times and still can't view any of my statements on my credit cards

    i have downloaded adobe reader 20 times and still cant view any of my statements??????????

    You write "downloaded", but did you also install it?
    Also, are these online docs?  If so, what browser do you use?

  • 1. What's the difference between private mode in Safari which i have to turn on every time again when opening safari. It's a two click activity which i would love to be able to set in the preference as default.

    1. What's the difference between private mode in Safari which i have to turn on every time again when opening safari.
    It's a two click activity which i would love to be able to set in the preference as default. It's tyering when have to do it everyday a few times. (Yes, i'm one of many who have the "i like safari but since the update crash everyday a few times" syndrome...
    Yes, i have updated my system.
    Yes, i have repared disk permissions with disk utility.
    Am open for any other help in both cases. Thank you upfront
    2. and the "tell websites not to track me" under Safari - Preference - Privacy.

    That box should prevent websites using trackers to log your movements on the Web to benefit advertisers. I have no idea if it does.
    Safari can keep your browsing history private. When you turn on private browsing, Safari doesn’t remember the pages you visit, your search history, or your AutoFill information, so your partner cannot see where you have been, but you must also remember to also turn off acceptance of cookies.
    In all other respects Private Browsing is not as private as you might think:
    http://www.switchingtomac.com/tutorials/how-to-make-safaris-private-browsing-fea ture-actually-private/
    http://www.insanely-great.com/news.php?id=9054
    and then Apple's own advice from here: http://www.apple.com/pro/tips/privacy_safari.html
    "Note that the Private Browsing option does not prevent Safari from collecting cookies (the preference files automatically generated by many websites). The Reset Safari option clears all cookies. If you want to delete only certain ones, choose Preferences from the Safari menu, click the Security tab, and then click Show Cookies. You can select and delete individual cookies from the list that appears. Careful, though — if you’re a frequent web user, this list can be very, very long."
    which is itself incomplete, the relevant part being 'If you want to delete only certain ones.
    To that end it is useful to have Safari Cookies installed, which is the only cookie manager available for Safari:
    http://sweetpproductions.com/safaricookies/
    which automatically deletes all cookies not marked as 'favourites' when closing Safari. It does the same for Flash Cookies, but they are subject for themselves:
    From this website:
    http://machacks.tv/2009/01/27/flushapp-flash-cookie-removal-tool-for-os-x/
    For those who do not know about Flash cookies, more properly referred to as Local Shared Objects (LSO), they operate in a similar way to regular browser cookies but are stored outside the purview of your browser, meaning you cannot delete them from within your browser, whether Safari, Firefox, Opera or any other. Typically they are issued from sites or 3rd party sites that contain Adobe Flash content. Since virtually all internet advertising is  delivered in Flash, Google/Doudleclick and all other internet advertising companies are sure to be tracking your browsing behavior with Flash cookies. These companies can see you traverse the Internet as you come upon the plethora of sites that contain their embedded advertising. Check out the Wikipedia entry here.
    In Mac OS X they are stored in the following location:
    /User’s Home Folder/Library/Preferences/Macromedia/Flash Player/#SharedObjects
    The settings for the Flash cookies are stored in:
    /User’s Home Folder/Library/Preferences/Macromedia/Flash Player/macromedia.com/support/flashplayer/sys
    In OS X Local Shared Objects, or Flash Cookies, are appended with a .sol suffix. Flush deletes all the Flash cookies (.sol) and their settings.
    Flush can be downloaded from that page.
    If you want to retain certain Flash cookies but not others, the excellent add-on for Safari called SafariCookies now includes a setting for automatically deleting flash cookies you don't want to retain, when Safari is shut down, in the same as it deals with ordinary cookies:
    http://www.sweetpproductions.com/safaricookies/index.htm
    which not only does that but much more equally useful stuff!
    This article covers the issue in more depth:
    http://www.wired.com/epicenter/2009/08/you-deleted-your-cookies-think-again/
    Flash cookies are also known as 'Zombie Cookies' and are used by a number of firms, including Hulu, MTV, and Myspace. Graham Cluley, senior technology consultant at the internet security firm Sophos, told BBC News that the source of the trouble was Adobe Flash itself, which he called "one of the weirdest programs on the planet".
    "I think it's highly unlikely that these large companies have abused Flash cookies - which are different from browser cookies - with malicious intent," he said.
    "I think it's much more likely that the vast majority of users are simply oblivious to the bizarre way in which Adobe allows them to configure the software."
    http://www.bbc.co.uk/news/technology-10787882
    And a more recent article:
    http://www.nytimes.com/2010/09/21/technology/21cookie.html?_r=3&scp=1&sq=flash&s t=cse
    [b]Tracker cookies and the invisible web:[/b]
    – tags, web bugs, pixels and beacons that are included on web pages in order to get an idea of your online behavior.
    Ghostery tracks the trackers and gives you a roll-call of the ad networks, behavioral data providers, web publishers, and other companies interested in your activity.
    http://www.ghostery.com/about
    This provides an extension to Safari (also available for other browsers) that shows you what data tracking is active on each web page you visit, and enables you to block them.

  • How can I reset the DEFAULT zoom view in Firefox at 125%, like IE, so I don't have to reset it every time ?

    How can I reset the DEFAULT zoom view in Firefox at 125%, like IE, so I don't have to reset it every time ?
    I have seen this question asked previously and it seems there is no answer.
    I know that one can change each individual web page (that reset defaults back to 100%) and, alternatively and apparently one can load an add-on to fix the default size at Full Zoom.
    ... But any hints on how to achieve a DEFAULT 125% zoom would be much appreciated.

    Press CTRL + 0
    Have you tried Firefox's zoom feature? Font size and zoom - increase the size of web pages
    You can "zoom" all sites using this add-on: [https://addons.mozilla.org/en-US/firefox/addon/2592/ NoSquint]. After setting your global zoom level, you can still fine-tune the zoom on individual sites.
    After installing NoSquint, click the % on the Add-on Bar to call up site preferences, then click the Global Settings button, then the Zooming tab.
    If you don't have the Add-on Bar displayed, you can right-click the new tab button ("+") or a blank area of the tab bar to the right of it and choose Add-on Bar from the shortcut menu.
    You can experiment with sizes larger than 125%, but I wouldn't go much higher than 150% unless you have a large high-resolution monitor.
    If there are particular sites that still present a problem, feel free to post their URLs.
    You can find more information about the zoom features Firefox offers in these articles:
    [[Text zoom]] - For zooming text only
    [[Page zoom]] - For zooming the whole page (including images etc.)

  • I have Elements 10 and every time I go to open a file in the editor it shows its thinking and then it just shuts down the entire program. I have a big wedding I am working on and lots of other sessions. Please PLEASE help!!!!

    I have Elements 10 and every time I go to open a file in the editor it shows its thinking and then it just shuts down the entire program. I have a big wedding I am working on and lots of other sessions. Please PLEASE help!!!!

    And you are quite persistent, Menu Boy, in offering pernickety and pointless prattle, in response to a "support page" on iPad's buggy Pages App.
    Let's summarise, for those reviewing this threadless thread for app support..
    Mobile pages works reliably for simple docs, especially creating letters and Menus for Microsoft's Kindy canteen (even on special days with nice big pictures).
    When importing more complex docs and/or working with larger creations, it is prone to randomly corrupting files upon re-opening, along similar lines as Word (running on a PC).
    So, Menu Boy, do they let you sneak into classes every now and then? What is the secret to their training? "Say after me, if any I.T. product works just some of the time, that's a job well done, and if something randomly stops working, we call that the user's fault... And if they complain, we call them names."

  • With software 5 I now have to pair it every time in Bluetooth, it's a pain. was great in the past never had to do it.  HELP

    With software 5 I now have to pair it every time in Bluetooth, it's a pain. was great in the past never had to do it.  HELP

    I have deleted all other devices so clear of anything and then paired my iPhone 4 and will work just fine, but when i shut down the Jeep and come back later it doesn't automatically re-connect. i have to turn off bluetooth on the phone, turn it back on, and reconnect again and will work.
    How would I find out and update the software to my 2011 Jeep Liberty's Uconnect system? Do I call someone or do something directly in the Jeep on the Uconnect system?
    Thanks for the help, its greatly appreciated.

  • My ipod keeps knocking me off my apps! Last time they told me to restore it. I refuse to have to do that EVERY time this happens!!

    I just got this ipod for xmas of 2010. I only have 3.9 of the 6.5GB used. So I don't understand why this happens. It's the second time. The 1st
    time, when I called they told me to restore it. But I don't want to have to do that EVERY time! This is a $300 product that's only less than 6 months old!
    Has anyone had this issue? How did you fix it besides restoring it?

    My daughter has also had this issue with her 3rd Gen iPod Touch. Also when she try's to  turn it off it takes 5 to 6 screan shots before turnning off.

  • Some, but not all, podcasts existing on the iPod no longer appear in iTunes. Different podcasts have been affected at different times, after changes in the state of the iPod. Only podcasts are affected.

    I have not seen this precise issue addressed anywhere. I don’t know if it’s an iTunes or an iPod problem:
    - Some, but not all, podcasts existing on the iPod no longer appear in iTunes;
      this, after normal behavior for more than a year since purchase of the iPod.
    - Different podcasts have been affected at different times, after changes in the state of the iPod.
    - Only podcasts are affected.
    - This concerns an iPod nano 6th gen. and iTunes 11.0.2 (26) on System 10.6.8
    - The only change to iTunes, the Mac, or the iPod is that just before this condition began
      I’d begun syncing an iPhone via iTunes.
    I sync manually (“manually manage music and videos”). The first time this happened, I wanted to delete seventeen podcast episodes (all belonging to one podcast) existing on the iPod — but they didn’t show up in iTunes. I tried re-downloading them and re-syncing, to see if the new versions would somehow “re-link” to iTunes. They didn’t. Only one — new — episode appeared in iTunes.
    I ultimately reset the iPod and manually resynced all the podcasts I currently had on iTunes. That worked, though I had to painstakingly add in all the other content deleted by the reset.
    So: after that reset and manual sync, all podcasts and episodes on the iPod were visible to iTunes and I was able to delete the podcast and its — now 18 — episodes I’d wanted to get rid of to begin with. But the next time I connected the iPod, only 8 podcast episodes out of 21 episodes total existing on the iPod were visible to iTunes. These are different podcasts; I’d deleted the original “invisible” ones.
    By “visible,” I mean in the “Podcasts” list view under “[name]’s iPod” in the iTunes sidebar. If I select “[name]’s” iPod in the iTunes sidebar and the “Podcasts” tab, all podcasts and episodes are visible, though greyed out because I’m set to sync manually. It’s unclear to me if these are the podcasts on the iPod or those currently in iTunes, as they are currently the same. If I switch to syncing automatically, all content on the iPod will be lost again, so I’m not up to trying it at the moment.
    As I said,  this involves only podcasts. All other content on the iPod does appear in iTunes.

    I have the same problem- i see my movies in the ipod section in itunes and they even show as mpeg4 in the 'kind' section but they dont have that small TV icon next to them. if i play these in itunes, they play fine- but try playing them on the ipod and all you hear is the sound and no picture. All videos that i manually transfer work fine in the beginning- its when i hook up the ipod to the comp again and start itunes- they start showing up without the 'tv' icon!! i have to again transfer them from the itunes library to activate them as videos.
    Need Help!!!

  • ITunes not adding / deleting in with iOS7: do I have to click Sync every time?

    I have an iPhone 4s with iOS 7.0.4 (11B554a) and iTunes 11.1.3.8.
    I am running into problems when I drag music or audiobooks from my iTunes library to my iPhone.
    1. I originally dragged an audibook to my phone and it stayed "greyed out" in iTunes. The circle next to the file that indicates how much of it has downloaded to the phone did not change. This was resolved by clicking "Done" and then "Sync" in iTunes. I do not want to have to do this every time I add a file.
    2. I deleted multiple audiobooks in iTunes. They no longer appear in iTunes, but they do appear on the phone. Again, the problem was resolved by clicking on Sync in iTunes.
    Ultimately, I do not want to have to click Sync every single time I manage the music on my phone. It takes substantially longer than it did with iOS6.
    Is there any way around this?
    Many thanks!

    It's not designed to work like this. When you sync, the iPod stores some information that basically says 'this iPod belongs to computer xyz'. Apple did this to prevent copyright issues (syncing someone else's music).
    If you really want to do this, you'll have to at least tie both iTunes installations to the same account. Maybe have them sync with each other.

  • My IPOD Classic Video 5. Gen. showed videos, but now it does no longer show them, instead i see a black picture on my IPOD and it doesn`t work. I have to restart it every time, i try it. i restore the software with itunes, but the problem still exists.

    My IPOD Classic Video 5. Gen. showed videos, but now it does no longer show them, instead i see a black picture on my IPOD and it doesn`t work. I have to restart it every time, i try it. i restore the software with itunes, but the problem still exists.
    The Videos are showed up front 4 months, but now they are no longer to be seen. When you star a video first the hard drive starts, but then it stops and hangs up. I have to restart it, starting with the apple logo....

    Here is what worked for me:
      My usb hub, being usb2, was too fast. I moved the wire to a usb port directory on my pc. That is a usb1 port which is slow enough to run your snyc.

  • I use the Icalendar at home, at work, and on my Iphone.  I don't want to have to "sign in" every time I need my calendar.  How do I stay signed in?  I have checked the "keep signed in" box, but it does not work.

    I use the Icalendar at home, at work, and on my Iphone.  I don't want to have to "sign in" every time I need my calendar.  How do I stay signed in?  I have checked the "keep signed in" box, but it does not work.

    Welcome to the Apple community.
    Staying signed in at iCloud.com is not a problem for me. Try resetting your browser or emptying its cache.

  • I changed my password to use migration to transfer files from a G4 to a new macbook pro but now I have to sign in every time. How do I avoid the sign in?

    I changed my password to use migration to transfer files from a G4 to a new macbook pro but now I have to sign in every time. How do I avoid the sign in?

    I clicked on keychain access but getting a warning that it quit unexpectedly and it won't reopen.

Maybe you are looking for