Delete an item in an XMLList by matching parameter?

I am trying to write a function in an item handler that will delete an item in a dataprovider that matches an attribute (xml) of the item from the renderer.
For example, let's say I have a data provider XMLList of memberList :
<member name="john" memberid="100"/>
<member name="john" memberid="101"/>
<member name="fred" memberid="102"/>
<member name="harry" memberid="103"/>
The Spark list displaying this has a button to remove the current member:
<s:HGroup>
<s:Label text="{XML(data).name}" />
<s:Button id="remove" label="Revoke Membership"  click="deleteItem()"/>
</s:HGroup>
My function is:
public function deleteItem():void {
     var parentList:List = owner as List;
     // original blind code that removed the item from display only
     //parentList.dataProvider.removeItemAt(parentList.dataProvider.getItemIndex(data));
     var i:int = parentList.dataProvider.getItemIndex(data);
     var s:String = parentList.dataProvider.getItemAt(i).memberid;
     var x:XMLList = FlexGlobals.topLevelApplication.memberList;
     trace("X= "+x);
     trace("item title= "+parentList.dataProvider.getItemAt(i).memberid);
     trace("same as above= "+s);
Everything is tracing correctly, so it's working.  What I want to do is delete the node/member in the Global memberList where @memberid==s but I'm not sure of the syntax to set that up.

The comments in your code above mention:
// original blind code that removed the item from display only
// parentList.dataProvider.removeItemAt(parentList .dataProvider.getItemIndex(data));
That line of code should do more than just remove it from the display, it should be removed from the collection as well.  Are you not seeing this behavior?

Similar Messages

  • Delete an ITEM from B1 2 B1

    Hi all,
    i need to maintain the alignement of the Items between 2 companies B1.
    I can insert and update the Items, but when i try to delete an item, i receive the following error in a message monitor B1i:
    com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception: com.sap.b1i.bizprocessor.BizProcException: BPE001 Nested exception: com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception: com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception: java.lang.RuntimeException: Try to retrieve a business object with empty Id!
    Is possible avoid the return of an empty ID, and delete correctly the Item? I need to invoke the DI API with an call?
    Thanks for help

    Hi Marco,
    Deleting function is available in BIU since B1iSN PL10.
    The only trick is that the sender section(<b1im:Payload ObjectRole="S">) is empty in message, thus you can't retrieve the ItemCode from sender section, but retrieve the itemcode from (<b1im:Payload ObjectRole="A">)
    You can refer the attachment for completed solution for BP (Insert, Update and Delete)
    Note: There is no "/BOM" in Xpath
    <xsl:template match="/">
    <xsl:apply-templates select="b1im:B1IMessage/b1im:Body/b1im:Payload[./@ObjectTypeId='B1.2007_BP']"/>
    </xsl:template>
    <xsl:template match="b1im:B1IMessage/b1im:Body/b1im:Payload[./@ObjectTypeId='B1.2007_BP']">
    Kind Regards, yatsea
    Removed the attachment, since it can't be viewed. If anyone needs it, just let me know. I'll create a blog for this soon.
    Edited by: Yatsea Li on Feb 3, 2010 2:42 PM

  • I have the iPhone 4, and yesterday I synced my photos onto iTunes, but now I have albums on my phone that cannot be deleted, and there is not an option to delete the items in the albums individually... How do I get rid of these unwanted albums? Windows 7

    I have the iPhone 4, and yesterday I synced my photos onto iTunes, but now I have albums on my phone that cannot be deleted, and there is not an option to delete the items in the albums individually... How do I get rid of these unwanted albums? Using Windows 7.

    If you used iTunes to get the photos on the phone, then use the same iTunes and uncheck the music you don't want and do another sync.

  • Hacker problems so I reloaded Snow Leopard. Afterwards, Mac had to delete 798 items. Now looping on 4 items to delete for the past 2 weeks. Can't reboot, reload, or restart. I have to let the battery run down for it to turn off. How to fix this, please?

    I had hacker problems so I reloaded Snow Leopard. Afterwards, Mac had to delete 798 items. Now it is looping on 4 items to delete for the past 2 weeks. I can't reboot, reload, or restart. I have to let the battery run down for it to turn off. I think a big part of the problem is that someon one the internet (the hacker) was mirroring my hard drive. It seems to have locked up my system. I could be wrong about this guess, though. All I do know is that it is now looping on the last 4 iems, and I can't do anything.
    Well, I can get it to turn on, but all it does is continously try to delete the last 4 items. When I try to reload Snow Leopard, it tells me my hard drive is full and that I need to delete items.
    Can anyone help? I am so lost without my Mac. I am back on the PC, and though it works, I'm sure many of you will understand when I say it's just not a Mac.
    Thanks.

    I installed Snow Leopard using my Apple external Superdrive. I followed directions I found on the Apple site. Here is the article info:  Mac OS X v10.6 Snow Leopard: How to Erase and Install  
                     Article HT3910
                     located at: http://support.apple.com/kb/HT3910
    Everything was going smoothly until I got to the reinstall part. I had to choose to reinstall on a hard drive or network drive. I've never used a network drive; just the hard drive. It seems that's where the troubles began. I selected the hard drive. It seemed to go well, and then I got the message that I needed to delete some files because I was out of space. I chose to get rid of my music files, but, there were only 636. I don't know what the rest of the files were. I was using the Secure Empty Trash command.
    That was my first time doing an erase and install. I tried to do it again, but I now get a continuous error telling me that my hard drive is full and I must delete files. Only I can't delete files because 4 files are still being deleted and my computer won't let me stop the process.
    I found out about the hackers mostly by the fact that whenever I used to watch something like Hulu or Netflix, I never had problems with internet connection or speed. Lately, I had internet connection problems. I went in to check my settings for my internet provider and found out the settings had been changed to public and all these extra computers were connected to my network.

  • I tried to delete one item from an email folder, and my computer deleted the whole file. I cant fint it anywhere.

    I tried to delete one item from an email folder, my computer deleted the whole file and I cant find it anywhere. Any ideas?

    lindafromgainesville wrote:
    ...is there a seperate trash for email?
    In Mail, yes -

  • PURCHASE ORDER STATUS :When Deleting ALL ITEMS.

    Hi experts,
    I need  to make purchase order status stay  " Release Compleated " when deleting all items.
    Anyone Know How to do it?
    Or anyone Know how to use BAPI_PO_CHANGE in BAdI : ME_PROCESS_PO_CUST 
    In my project , I use Release Strategy of purchase orders, and there is a case of deleting all items.
    In this situation, purchase order status returns to "Active " and release strategy tab disappears.
    This is our problem.
    I need to make purchase order status stay  " Release Compleated " and prevent  release strategy tab disappearing.
    I tried to update the fields EREKZ(final invoice) and ELIKZ(delivery completed) in
    BAdI : ME_PROCESS_PO_CUST  Method : PROCESS_ITEM using BAPI_PO_CHANGE according to SAP Note 456691.
    But BAPI_PO_CHANGE couldn't update EREKZ because of our customize , and I couldn't find how to use
    BAPI_PO_CHANGE in the BAdI.
    Anyone know solutions to solve this problem?
    Thanks a lot.
    Regards,
    TKD

    Hi,
    please review the following information in SAP Note No. 456691 as
    copied below:
    18. Question:
    When are the header conditions updated if a purchase order item is
    deleted?
    Answer:
    If a purchase order item is deleted, the item is marked as 'statistical'
    (field EKPO-STAPO = X) and the change is reflected in the header
    conditions.
    However, if for the item the final invoice indicator(EKPO-EREKZ) or the
    inward delivery completed indicator (EKPO-ELIKZ) is set, the item is not
    marked as 'statistical' (EKPO-STAPO is not set) and thus the header
    conditions are not updated.
    I hope this helps you
    BR
    Nadia Orlandi

  • 2LIS_02_ITM deleted line items are not reflected in BW

    Hi,
    Our current Data flow 2LIS_02_ITM-->DSO-->CUBE.
    I am analyzing a Invoice, When it is created 01.04.2014 it has got 10 Line Items and all the data is load to BW,Invoice with 10 Line items.
    In ECC I can now see the same Invoice only got 5 line items and from change log I can see 5 line items are deleted on 15.04.2014.These changes are not reflected in BW.In BW invoice data still shows 10 line items.
    If I perform setup table job and ECC RSA3 for that invoice I am getting only 5.
    I believe it’s something to do with 0RECORDMODE,Can you please let me know how to fix this in BW.
    Thanks

    Yes this is a known behavior in case of deltas.
    For Deleted line items Rocancel field will have an entry with R.
    To handle this you need to map ROCANCEL field in Technical group of transformation (Between Datasource to DSO) with 0Recordmode.
    Once you will do that then after activating the data in DSO it will nullify the records and deleted order or item will not appear.
    Regards,
    AL

  • Report for deleted line-items in Transfer Orders

    Dear All,
    Please help me in writing the code for "Report for deleted line-items in Transfer Orders".
    regards,
    nishu

    Thanks. Repor completed.

  • How to release Stock blocked against deleted line items from  Sales order.

    We have Scenario as follows.
    Sales order made for  items available in stock.  Deleted few lineitems from sales order balance items delivered and invoiced. Sales cycle is complete in all sense.
    What we have noticed is when we are creating new sales order / Delivery for deleted items from above Sales order it shows deleted quantity is blocked against old sales order. These line items are no longer
    available in old sales order since it is deleted also it is not appearing in open sales order report (VA05).
    Overall stock available is same as quantity mentioned in deleted line item.
    In MD04 - Sales requirenment transaction it shows sales order / line item against which it is blocked.
                    i.e deleted line item.
    How to release these stock and make available for sales. Any standard process available ? or any other solutions
    Thanks & Regards,

    I got a solution for my question from other forum. for info
    Go to SE38 and enter program SDRQCR21 then execute...
    Enter line item which is blocked for sales order in MD04 and enter plant then check Data
    transfer box and uncheck other boxes... It will pop up information and click yes...
    You will get one report and Stock inconsistency will go off and then check it in MD04....
    regards

  • PO print-preview  for a PO with all  deleted line items

    Hello MM Gurus,
    I am not able to print preview of a PO for which i deleted all the line items. It gives me a message saying that no print relevant changes.
    Client need to print such POs. Client expects a text like "item cancelled " for deleted PO items.
    My understanding is that its standard SAP pre delivered customising however it is not working.
    Pls suggest.
    Regards,
    Pankaj

    Ask your ABAPer to modify the smart form, deleted materials wouldn't come for obvious reasons in standard system ... you need to get in customized/ developed.

  • Error message when trying to delete an item in a purchase order

    Hi,
    We are trying to delete an item in a PO, but when we select the item and click on the trash button (Delete), we get the following error message:
    «Evaluated receipt settlement open, deletion not possible
    Message no. ME867»
    There was a good receipt that was originally done for this PO. We cancelled it with the opposite posting (debit GR/IR account and credit the project account using t-code MIGO.) The account assignment category of this PO is «Project».
    Thanks for you help.
    Julien

    Hi,
    This means ERS is active in your system.
    What this means is that when you do a GRN, an ERS flag is activated in the PO header.  The ERS is then settled using the PO data in SRM.
    If you have not settled this (at least this is what is indicated from the message), then uncheck this flag in the PO header and then try and archive.
    Cheers.

  • 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

  • How to delete the items in the recycle bin permanently from the windows using Diruse command

    How to delete the items in the recycle bin permanently from the windows  using Diruse command.
    Because most of the time we get out of disk space issues.
    Can somebody help me in giving with an example

    You can right-click Recycle Bin|Properties and choose radio button for
    Don't move files ....
     This one may also help.
    http://technet.microsoft.com/en-us/library/cc784980(v=ws.10).aspx
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • How to delete all items in download folder under bookmark in the shortest time?

    I understand that all downloads from internet and yahoo/google mail are stored in the "Download" folder which I see under bookmark when I want to delete. I think that if the download folder is never emptied, then my mac will slow down. Therefore I want to delete these downloads which I have already seen. How do I delete ALL items in the shortest time? Deleting items, even in groups, takes a long time. Is there a method that I can use so that all items in the folder are deleted in one stroke?
    Thanks.
    Unguja

    Try (first button on toolbar) Organize > Select All (Command + A) to select all items in the right pane in the Library.

  • How to delete all items in the HUB ?

    How to delete all items on shot in the HUB ?

    Hi all,pay attention to the words I've marked in bold in the first answer from the technical support member:  "From the BlackBerry Hub, hold your finger on the date at the top of the list. A side menu will appear. Click on the Garbage Can to delete all messages prior to that date" At first, I also didn't understand how to make it works, but you have to slide until the date is at the top of displayed messages, then you can tap and hold to select all messages preceding that date. 

Maybe you are looking for

  • Gzip-1.5-1 error uncompressing temporary file in lynx

    Today updated gzip to 1.5-1-i686.  Thereafter in lynx 2.8.7-5 no websites would display.  The message is "error uncompressing temporary file."  I reverted to gzip 1.4-4 and lynx works as expected.

  • Harddrive won't mount anymore

    Hello all, One of my internal hard disks (Seagate Baracude 7200.11, 1 TB) of my Mac Pro won't mount anymore. The disk is spinning as normal, I don't hear a weird sound or anything. It just won't mount. Not in Finder, not in Disk Utility and not in Sy

  • ORGEH ON HR LDB SELECTION SCREEN

    hello, I am using PNP LDB selection screen i am getting the results when i gave person number but i am unable to get the data for ORGANIZATIONAL UNIT (orgeh). ANY ONE PLEASE SUGGEST ME HOW TO GET THE DATA FOR ORGEH. THX IN ADVANCE MUNNA.

  • In house repair - Maintaining template for Spare parts & Services

    Hi, After creating an item of type "Diagnostics", I want to  choose additional "Repairs+Spare Parts" . Where can I maintain this template so the Spare Parts get proposed. Thanks,

  • Can I use a USB superdrive DVD reader/writer with a mac pro?

    The internal CD/DVD read/writer in my macpro (2 x 2.66 ghz dual-core xeon) broke, so I purchased an external USB superdrive, thinking I could use it as an external drive. It does nothing when plugged into the mac pro, I cant even insert a disk. It se