What's the Best Way to Clear a DataGrid?

What's the best way to clear out a datagrid and where should
I put it in the code? The problem I am having is with data that is
populated in the grid. When I leave the screen and come back to it
(using the Accordion component), the data is still populated in the
datagrid and I would like to have a clear screen when going back to
it.
So what I am looking for is the code to clear it (or
removeAll()) and where would be the best place to execute it within
the Accordion style setup.
Thanks.
Dave

Use a collection for the dataProvider, and call removeAll();
Call it on the hide, show or change events.
Avoid raw Array an XMLList as dataProviders.
Tracy

Similar Messages

  • What is the best ways to clear up space on my iPhone 5 ? Thanks for your help !

    What is the best ways to clear up space for my IPHONE 5? Thanks for your help !

    Import photos to your computer, then delete the copies that reside on the phone. Also remove apps you no longer use.

  • My iPhone is FULL, no memory left for photos. If I move all my photos off my iPhone, will the 'ALBUMS' and their content (pics) be blown away ? Also, what is the BEST way to clear/save photos off my iPhone ? PC, ITunes, some other app ?

    My iPhone is FULL, no memory left for photos. If I move all my photos off my iPhone, will the 'ALBUMS' and their content (pics) be blown away ? Also, what is the BEST way to clear/save photos off my iPhone ? PC, ITunes, some other app ?

    I use an app called FileApp to transfer photos to my PC - I can then selectively delete photos from my iPhone and still have them on my PC - just download the app to your iPhone and follow the instructions for the accompanying program for your PC - then use your iPhone cable to connect - iTunes will also start up so just close it and you will see the iPhone storage as a drive - go the DCIM folder and open the device folder and you will see your photos.

  • What is the best way to create CRUD datagrids

    What is the best way to create CRUD datagrids that tell CF
    components to update sql tables. I find that I'm having to vreate
    all these columns with custom properites and its a bit of a chore:
    <mx:DataGridColumn id = "NatWest" dataField="NatWest"
    headerText="NatWest" editable="false"
    wordWrap="true"
    textAlign="right"
    headerStyleName="centered"
    labelFunction="price_labelFuncNatWest"
    sortCompareFunction="price_sortCompareFunc">
    I don't really want to use any wizards as I want control over
    my code.

    Hi Saythj,
    When mentioning "a database schema from XML", do you mean the
    XML Schema Collections? If that is what you mean, when trying to import XML files of the same schema type, you may take the below approach.
    Create an XML Schema Collection basing on your complex XML, you can find
    many generating tools online to do that.
    Create a Table with the above created schema typed XML column as below.
    CREATE TABLE youTable( Col1 int, Col2 xml (yourXMLSchemaCollection))
    Load your XML files and try to insert the xml content into the table above from C# or some other approaches. The XMLs that can't pass the validation fail inserting into that table.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • What is the best way to remotely lock/clear/locate a macbook pro or iphone 6 if they are lost or stolen?

    What is the best way to remotely lock/clear/locate a macbook pro or iphone 6 if they are lost or stolen?
    macbook serial C02LG23EFH00
    running latest OS
    thanks

    Hi
    See here for remotely wiping and securing devices when stolen, you will need to use icloud with the find my mac/iphone feature
    http://support.apple.com/kb/PH2701

  • What is the best way of dealing with an "implicit coercion" of an array to a sprite?

    Hello everyone!
         With continued help from this forum I am getting closer to having a working program. I look forward to being able to help others like myself once I finish learning the AS3 ropes.
         I will briefly explain what I am trying to achieve and then follow it up with my question.
    Background
         I have created a 12 x 9 random number grid that populates each cell with a corresponding image based on each cell's numeric value. I have also created a shuffle button that randomizes the numbers in the grid. The problem I am running into is getting my button-click event to clear the current images off the grid in order to assign new ones (i.e. deleting the display stack objects in order to place news ones in the same locations).
    Question
         My question is this: what is the best way to handle an implicit coercion from an array to a sprite? I have pasted my entire code below so that you can see how the functions are supposed to work together. My trouble apparently lies with not being able to use an array value with a sprite (the sprite represents the actual arrangement of the grid on the display stack while the array starts out as a number than gets assigned an image which should be passed to the sprite).
    ============================================================================
    package 
    import flash.display.MovieClip;
    import flash.display.DisplayObject;
    import flash.events.MouseEvent;
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.text.TextFormat;
    import flash.utils.getDefinitionByName;
    public class Blanko extends MovieClip
          // Holds 12*9 grid of cells.
          var grid:Sprite;
          // Holds the shuffle button.
          var shuffleButton:Sprite;
          // Equals 12 columns, 9 rows.
          var cols:int = 12;
          var rows:int = 9;
          // Equals number of cells in grid (108).
          var cells:int = cols * rows;
          // Sets cell width and height to 40 pixels.
          var cellW:int = 40;
          var cellH:int = 40;
          // Holds 108 cell images.
          var imageArray:Array = [];
          // Holds 108 numerical values for the cells in the grid.
          var cellNumbers:Array = [];
          // Constructor calls "generateGrid" and "makeShuffleButton" functions.
          public function Blanko()
               generateGrid();
               makeShuffleButton();
      // Creates and displays the 12*9 grid.
      private function generateGrid():void
           grid = new Sprite;
           var i:int = 0;
           for (i = 0; i < cells; i++)
                cellNumbers.push(i % 9 + 1);
           trace("Before shuffle: ", cellNumbers);
           shuffleCells(cellNumbers);
           trace("After shuffle: ", cellNumbers);
           var _cell:Sprite;
           for (i = 0; i < cells; i++)
                // This next line is where the implicit coercion occurs. "_cell" is a sprite that tries
                   to temporarily equal an array value.
                _cell = drawCells(cellNumbers[i]);
                _cell.x = (i % cols) * cellW;
                _cell.y = (i / cols) * cellH;
                grid.addChild(_cell);
      // Creates a "shuffle" button and adds an on-click mouse event.
      private function makeShuffleButton():void
           var _label:TextField = new TextField();
           _label.autoSize = "center";
           TextField(_label).multiline = TextField(_label).wordWrap = false;
           TextField(_label).defaultTextFormat = new TextFormat("Arial", 11, 0xFFFFFF, "bold");
           _label.text = "SHUFFLE";
           _label.x = 4;
           _label.y = 2;
           shuffleButton = new Sprite();
           shuffleButton.graphics.beginFill(0x484848);
           shuffleButton.graphics.drawRoundRect(0, 0, _label.width + _label.x * 2, _label.height +
                                                _label.y * 2, 10);
           shuffleButton.addChild(_label);
           shuffleButton.buttonMode = shuffleButton.useHandCursor = true;
           shuffleButton.mouseChildren = false;
           shuffleButton.x = grid.x + 30 + grid.width - shuffleButton.width;
           shuffleButton.y = grid.y + grid.height + 10;
           this.addChild(shuffleButton);
           shuffleButton.addEventListener(MouseEvent.CLICK, onShuffleButtonClick);
      // Clears cell images, shuffles their numbers and then assigns them new images.
      private function onShuffleButtonClick():void
       eraseCells();
       shuffleCells(cellNumbers);
       trace("After shuffle: ", cellNumbers);
       for (var i:int = 0; i < cells; i++)
        drawCells(cellNumbers[i]);
      // Removes any existing cell images from the display stack.
      private function eraseCells(): void
       while (imageArray.numChildren > 0)
        imageArray.removeChildAt(0);
      // Shuffles cell numbers (randomizes array).
      private function shuffleCells(_array:Array):void
       var _number:int = 0;
       var _a:int = 0;
       var _b:int = 0;
       var _rand:int = 0;
       for (var i:int = _array.length - 1; i > 0; i--)
        _rand = Math.random() * (i - 1);
        _a = _array[i];
        _b = _array[_rand];
        _array[i] = _b;
        _array[_rand] = _a;
      // Retrieves and assigns a custom image to a cell based on its numerical value.
      private function drawCells(_numeral:int):Array
       var _classRef:Class = Class(getDefinitionByName("skin" + _numeral));
       _classRef.x = 30;
       imageArray.push(_classRef);
       imageArray.addChild(_classRef);
       return imageArray;
    ===========================================================================
         Any help with this is greatly appreciated. Thanks!

    Rothrock,
         Thank you for the reply. Let me address a few things here in the hopes of allowing you (and others) to better understand my reasoning for doing things in this manner (admittedly, there is probably a much better/easier approach to what I am trying to accomplish which is one of the things I hope to learn/discover from these posts).
         The elements inside my "imageArray" are all individual graphics that I had imported, changed their type to movie clips using .Sprite as their base class (instead of .MovieClip) and then saved as classes. The reason I did this was because the classes could then be referenced via "getDefinitionByName" by each cell value that was being passed to it. In this grid every number from 1 to 9 appears randomly 12 times each (making the 108 cells which populate the grid). I did not, at the time (nor do I now), know of a better method to implement for making sure that each image appears in the cell that has the corresponding value (i.e. every time a cell has the value of 8 then the custom graphic/class "skin8" will be assigned to it so that the viewer will be able to see a more aesthetically pleasing numerical representation, that is to say a slightly more fancy looking number with a picture behind it). I was advised to store these images in an array so that I could destroy them when I reshuffle the grid in order to make room for the new images (but I probably messed up the instructions).
         If the "drawCell" function only returns a sprite rather than the image array itself, doesn't that mean that my "eraseCells" function won't be able to delete the array's children as their values weren't first returned to the global variable which my erasing function is accessing?
         As for the function name "drawCells," you have to keep in mind that a) my program has been redesigned in stages as I add new functionality/remove old functionality (such as removing text labels and formatting which were originally in this function) and b) that my program is called "Blanko."
         I will try and attach an Illustrator exported JPG file that contains the image I am using as the class "skin7" just to give you an example of what I'm trying to use as labels (although it won't let me insert it here in this post, so I will try it in the next post).
    Thank you for your help!

  • What is the best way to manage photos - Dropbox (with sync), Facebook (with sync), iPhoto, etc.?

    With so many cloud based and wireless syncing services, I'm lost as to the simplest way to keep photos sync'd as well as backed up. My dropbox is currently syncing all photos I take with my iphone, but in an overall folder called CAMERA UPLOADS, so they are uncategorized. I upload pics to facebook, which facebook also has a sync photos feature, but I don't necessarily want all photos uploaded to facebook. What has worked best for everyone so that there aren't a ton of dupicate photos everywhere, and multiple syncs of the same photos?
    Also, what is the best way to manage my iPhone photos generally? I'm never sure if I delete a photo from my phone, does it delete it on my computer via iCloud? Sometimes I just take a picture to send to a friend that I don't need to keep, while others are ones I want to sync to my computer. Can I control when deleting that it be deleted everywhere or just on the device? And alternately, can I choose certain photos not to sync via iCloud?
    iCloud makes me nervous. Once when I wanted to place all photos of my pup into a folder, I selected the photos on my iPhone and accidentally clicked delete instead of move. No big deal, I figured they'd be at home sync'd on the cloud. But since I'd deleted them on my phone, the cloud deleted them on my home computer too and the photos were lost.

    I am presuming that we cannot share downloaded apps and music between accounts because of the copyright issue,
    Though I'm no copyright lawyer, as long as it's within a household, you can share content among users. Such sharing is, absent specific language preventing it not present in the iTunes Store terms of use, generally considered to be "personal use". So you can share apps and music amongst your users on your computer and with their devices. You just can't give any of that content to friends or relatives who don't live with you.
    What I am not clear on, it making sure that this appears in each itunes account - is it easy to find the file storage folders that match the itunes accounts and what would these be?
    The iTunes library and files are by default in a user's Home/Music folder. But you don't have to find the folder; in fact putting a file into the folder yourself won't add the file to iTunes. Just drag the file into the iTunes window. iTunes will copy it to the correct location.
    Regards.

  • What is the best way to kill/stop a data load?

    Hi.
    What is the best way to kill/stop a data load?
    I have a data load from my QA R/3 system that is extracting 115.000.000+ records. The problem is that the selection in the function module used in the data source does not work, and the problem was not detected because of the nature of the data on the development system.
    I could kill processes owned by my background user (on both R/3 and BW) but I risk killing other loads, and sometimes the job seems to restart if I just try to kill processes. If I remove transactional RFCs in SM58 the load does not terminate; I only skip one or more datapackages. I have also tried to change the QM-status in the monitor to red, but that does not stop the load either...
    So isn't there a nice fool-proof way of stopping a dataload?
    Best regards,
    Christian Frier

    Hi,
    There r 2 ways to kill the job.
    One is using transation RSMO locate the job and display the status tab double click on the yellow light that is shown on the line total, a pop will come 'set overall status ' is displayed select the desired status that is red and save it. Then return to the monitor page and select the header tab double ckick on the data target right click and then goto 'manage',there should be request sitting there probably with yellow lights , highlight the line with the faulty request click the delete button then click refresh button.
    Second is goto SM37 and click on the active selection and enter the jobname and then click excute the particulr job should appear highlight the jobname then click on the stop iconthat appears on the taskbar( 3 rd from left)
    hope it is clear.
    Regards-
    Siddhu

  • What is the best way of converting a Top Level VI into a 'sub vi' - or function ( without duplicating programming)

    Hi,
    General question here about design architecture, which i keep running into, but haven't found a really good solution.  If i write a 'Top Level VI' to do something, what is the best way of converting it into a subVI - which is call-able from other VIs, while still allowing the top level VI to have synchronised feedback/indicator updates.
    I guess the point is that when something is a top level VI you write gui logic about what happens when someone clicks buttons or whatever - which you don't want in the 'sub vi' version.
    I did at one point try having a hidden boolean button that was an input to the subVI which would let the VI know if it was supposed to be doing the front panel stuff - or simply running as a subVI.  This isn't really ideal though - since it would be better to be able to hive off the grizzly useful stuff from the fluffy - front panel updating stuff - having them together makes the VIs rather untidy.  More annoyingly though, if you have the front panel version of it running - say waiting for you to hit 'go', it breaks all the other VIs that use it as a sub vi - since they can't compile when a sub vi is already running.
    Another possibility that i tried was to basically duplicate the vi so that there was a backend part, and a front end part - and when i click 'go' the backend part is called as a sub vi.  The problem with this is that it really limits the interface that the user gets - since none of the controls on the front panel update with the results untill the sub vi is over.  I guess again i could solve this by passing references to some of the controls to update them in the subvi - but this doesn't really seem like the ideal situation if the subvi is called by something else without the same types of controls etc.
    One final idea i had was to essentially paste all the controls in the VI into a global variable file, and make the sub vi update them, and the front panel VI read from them.  This seems to 'work' - although clearly it is a work around rather than a proper solution - since i spend loads of time worrying about how i update cluster variables in the global - reading and writing.
    Does anyone have any guidance on what they do to solve this problem?
    JP

    You could run a subvis in a Subpanel on your top level.  Lets you see the current data while the subvi is running.
    --Using LV8.2, 8.6, 2009, 2012--

  • What's the best way to erase content but not the applications?

    I'm giving away my iMac to my niece. I want to erase all my  content files, libraries ,etc., but not the applications. What's the best way to do this, and to do it securely?

    If you have Downloaded and Upgraded to Lion See...
    Here is an excerpt of the SLA; the Lion license (purchased from MAS) is NOT transferable. The SLA is quite clear:
    B. If you obtained your license to the Apple Software from the Mac App Store or on Apple-branded physical media, it is not transferable. If you sell your Apple-branded hardware to athird party, you must remove the Apple Software from the Apple-branded hardware beforedoing so, and you may restore your system to the version of the Apple operating systemsoftware that originally came with your Apple hardware (the “Original Apple OS”) andpermanently transfer the Original Apple OS together with your Apple hardware, provided that:(i) the transfer must include all of the Original Apple OS, including all its component parts,printed materials and its license; (ii) you do not retain any copies of the Original Apple OS, fullor partial, including copies stored on a computer or other storage device; and (iii) the partyreceiving the Original Apple OS reads and agrees to accept the terms and conditions of theOriginal Apple OS license.
    Now Proceed...
    Boot from the original OS installer disk and do an Erase & Install.
    When the Mac reboots into Mac Setup Assistant Quit and shut it down.
    When the New Owner Boots it up it's a brand new Mac... just like when you got it.
    ( The Original Install Disc(s) should also be included with the sale )
    http://www.ehow.com/how_5852122_restore-imac-factory-settings.html

  • I need to upgrade my harddrive, what is the best way to do it?

    Hi,
    I need to upgrade my hard drive - what is the best way to do it? Is it best to go to an Apple store or can I do it myself? How can I transfer current apps and data across
    I have a Macbook 13 inch I bought in 2009, it is not the Macbook Pro 13 inch model to be clear. It is running 64 bit Snow Lepoard 10.6.6. I have upgraded the RAM to 4 Gig so the performance is still good, but I am running out of disc space, hence the hard drive upgrade requirement.
    Many Thanks,
    Glenn

    Replacing a hard drive in a MacBook is very easy to do it yourself.
    To buy a hard drives try Newegg.com http://www.newegg.com/Store/SubCategory.aspx?SubCategory=380&name=Laptop-Hard-Dr ives orOWC http://eshop.macsales.com/shop/hard-drives/2.5-Notebook/
    Here's instructions on replacingthe hard drive http://creativemac.digitalmedianet.com/articles/viewarticle.jsp?id=45088
    To transfer your current hard drive I likeCarbon Copy Cloner. It makes a bootable copy of everything on your hard drive http://www.bombich.com/index.html You'll need a cheap SATA external hard drive case. Put the new drive in thecase and clone your old drive to the new one. Then replace your old hard drivewith the new one.
    I just bought this one off of ebay for $5.15 http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=130492731546&ssPageName=STRK: MEWNX:IT

  • What is the best way to install new version... adobe always leaves stuff behind from the old version

    Hi,
    I've gone through the installation of a new version, well... 8 times before. And have noticed that adobe has the nasty habit of not cleanly uninstalling the previous versions...
    What is the best way to do this?
    Should I do a regular install and trust adobe this time to completely remove the old version and its associated directories?
    Or should I uninstall the old version and install the new one? I've always been afraid to go this route bocause of the organizer files.
    Thanks for your comments.

    So, just to be clear:  the "proper, Adobe-recommended" way to go about an upgrade would be to install the new version and THEN remove the older version by means off "Add/Remove programs"  ??
    Thanks to all for your help.

  • What si the best way to export Final Cut Pro X movies to YouTube?

    Hi
    The Share > YouTube tool is proving to be very unrelaible. Often the Share Loader comes back with the "Your password has been rejected" message when I know that the password is correct. It seems to work fine for 50% of the time but it's really frustrating.
    My videos are quite large (given that they are all under two minutes they have been shot in HD and are often over 1Gb - too big for YouTube).
    What is the best way of getting my movies down in size and then uploaded to YouTube?
    Thanks
    Stephen

    Thanks for the advice guys. I'm just rather reluctant to spend more money when FCP is meant to be good at this kind of thing. It's frsutrating thet the YouTube option doesn't work, but it clearly doesn't.
    I think I just need to stop being a scrooge and to buy compressor!
    Cheers
    Stephen

  • What is the best way to prepare for CERTIFICATION?

    what is the best way to prepare for CERTIFICATION?
    what is needed?
    where can i read more about it?

    Hi,
    Do as much as possible exercises based on your course material(which will be more than enough).
    If you know (some) Java and have understand the basics of OOP then this is enough for the exam.
    And do not forget:
    it is a multiple-choice test meaning that you see the possible answers.
    Either a single answer is correct (then you will have radio-buttons) or several answers are correct
    (then you will have checkboxes; in this case almost all questions will have more than one correct answer).
    You can refer to the topics for the certification
    https://websmp102.sap-ag.de/~sapidp/011000358700000499112003E
    Some links which might help
    /message/213564#213564 [original link is broken]
    /message/514469#514469 [original link is broken]
    /message/1315746#1315746 [original link is broken]
    /message/1736299#1736299 [original link is broken]
    /message/1736299#1736299 [original link is broken]
    /message/257122#257122 [original link is broken]
    /message/130164#130164 [original link is broken]
    /message/1916905#1916905 [original link is broken]
    /thread/167254 [original link is broken]
    /message/213564#213564 [original link is broken]
    /message/1315746#1315746 [original link is broken]
    <b>
    you try www.sapdoamin.com
    They provide Certification simulation questions which are veryuseful and a must try site.</b>
    Yes more questions comes on OOPS so get your OOPS concepts very clear.
    You don't need to do extensive coding in OOPS.
    Just get the concepts clear and i am sure the certification will be a cake walkthrough.
    All the best and good luck with your ABAP Accreditation.

  • What's the best way to completely wipe my Mac?

    I'm selling my 17" iMac G5 as I've just replaced it with a shiny new 24" Intel iMac [droool!]. Anyway, I want to know what software or what's the best way to wipe/clear my Mac and start from scratch so the person buying it doesn't have all my rubbish on there - plus can't retrieve any of my private files.
    What have you guys done in the past in situations like this? I know you can do a clean install off the original installations CD's but will this be enough to get ride of all preferene files and folders etc etc?

    Hi
    The easiest way is to put a new installation of your OS onto the Mac.
    Insert your Install disk 1 into to the drive and then Restart, and hold down the C key to take you to the installation windows.
    Select your language, the start up Volume and choose Erase and Install.
    At the point your registration process starts, abandon the registration, quit and eject the disk and switch of the computer.
    This will allow the new user a freshly installed system, whereby they can complete the registration process themselves. Make sure you hand on the disks.
    If you want to be extra thorough, you can, booted from your Install disk use Disk Utility to Zero All Data, before doing the Erase and Install described above, and if you want to be paranoid thorough, you can choose to overwrite the disk with several passes before doing the installation described first. Note this latter process can take from several hours to several days depending on the selection and the size of your internal hard drive.
    regards roam

Maybe you are looking for

  • BufferedImage displays as streaky; smooth image not produced

    Hi all, I have three classes that I'm working with. One is ImageProcessor, a Class I have to process images. Another is IMAQGUI, a GUI for my IMAQ service, and the third is IMAQIceStormService. In IMAQIceStormService, I am using ImageProcessor to cre

  • FI data validation in shopping cart

    Hi, We are using SRM 4.0 (Server 5.0) and ECC 5.0 in the back end. We enabled the FI validation in back end system in SRM configurtion. While creating the shopping cart it is validating only the cost elements and G/L account are available in SAP. But

  • HT204266 What can I do if I have been charged twice for an app

    I have been charged twice for an in app purchase whilst playing the sims. Can I be refunded? If so how? Charged £3.99 twice.

  • Create sesrch method (Argent)

    Dear all, I am working in ADF 10g (I have a problem when I am creating Search method). I need to make search by using LOV (create 2 LOV list one for month and one for Year) In my DB I have the the date in one column (19-Feb-2009) I make two view obje

  • Log Viewer: Unable to obtain a valid configuration - BAMRuntimeException

    Hi All, We have problems working with the Visual Administrator -> Log Viewer tool. excuting the Visual Administrator -> F:\usr\sap\<SID>\J(XXX)\j2ee\admin>go.bat Login with the user Administrator. Click On: Cluster -> PEP -> Server X X_XXXXX -> Servi