Delete element from a collection (JDev 10.1.2)

Hello
I have a bean which has a collection "testCollection" and accessors for it. This has been populated with some elements (similar to the LDAPDataControls example). I have created the data control for it and dragged the collection onto a JSP as a read only form. This displays the current element of the collection depending on the iterator position.
I then have a forward on the page using a button to a Data Action called RemoveAction. I have overwritten invokeCustomMethod and I'm trying to remove the element in the collection at the current iteraotr position.
I can access the iterator using actionContext.getBindingContainer().findIterator("testCollectionIterator");
From this I can get the current row but both row.remove() and row.removeFromCollection throw UnsupportedMethod exceptions.
I can access the collection using actionBinding.getBindingContainer().getDataControl().getDataProvider(), but I have no way of removing the object from the collection without having a reference to the object itself.
Please can someone explain how to remove elements from the collection?
Also can someone explain in the LDAPDataControls example why its also necessary to have a class called LDAPDataControl (type of DCGenericDataControl) and a LDAPDataControlFactory (type of DataControlFactoryImpl)?
Just having the classes LDAPSearch, the bean class LDAPEntry, and a class to hold the collection LDAPCollection works fine. Create the data control for LDAPCollection and drag the collection onto the JSP.
Thanks.

I'm still not sure about this. Can anyone help? Thanks.

Similar Messages

  • How to delete elements from a cluster?

    Hello. I would like to know how to delete elements from a cluster. I got stuck with this problem. There is its own order of each element in a cluster. I tried to initiate an array but it seems like too complicated. In the attached file, I want to obtain only the data from "flow" not "pressure". I try to use array programming but it doesn't work. Would be nice if you help me to fix the file. Thanks
    Solved!
    Go to Solution.
    Attachments:
    test 1.vi ‏16 KB

    Bombbooo wrote:
    What about if I want to store data into the pressure array too? Do I have to create another loop or it can be done in the same loop as the flow loop?
    Try this, for example. Modify as needed.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    test1MOD2.vi ‏9 KB
    SelectFlowOrPressure.png ‏7 KB

  • Add/Delete elements from viewcontaineruielement in web dynpro abap

    Dear all,
    Please let me know how to Add/Delete elements from viewcontaineruielement in web dynpro abap? I have copied a viewcontaineruielement from another program and now i dont want few elements from that viewcontaineruielement in my view. Please guide

    Hi Ajinkya,
    I have copied a viewcontaineruielement from another program and now i dont want few elements from that viewcontaineruielement in my view. Please guide
    Have you saved that VC element as template and using that template in another component?.If so,on resuing that VC element template it populates all the screen elements which you've save as template.
    Now, select that VC element which you've re-used,based on you're requirement add/remove UI elements as Kiran suggested.
    Hope it will resolve your issue.
    Thanks
    KH

  • How to delete values from extension collection field through importer?

    Hi Experts,
    We have created one extension collection field in Master Agreement.
    We are able to add values to that collection field using Extension collection template CSV file through importer.
    Now we have a requirement to delete values from the Extension collection field through importer using CSV file.
    If anyone have template or idea please share with us.
    Thanks in advance!!
    Regards,
    Lava.

    Hi Agrawal,
    Thanks for you helpful information.
    Regards,
    Lava.

  • How to delete photos from a collection

    Hi,
    The fact that I can't delete a photo when I'm browsing a collection is now one of the few things that really hampering my LR experience. The issue occurs even more often than it needs to because I often need to open several photos in Photoshop from which to create a final composite image. The quickest way to do this is to select them all and choose "Edit in Photoshop". However this create TIFFs for each file that I won't want to keep, so I then need to delete all but one of them.
    I'm hoping that I've just missed something obvious...
    At the moment I have to select the photo(s) that I want to delete, right click, choose to view them in the library, press the delete key, confirm the fact that I really would like to remove the files from the disk, then press the "back" button to get back to my collection view. Hardly quick.
    If the photos aren't all in the same folder then this doesn't work at all since there is no common folder. From the collection view there's simply no way of knowing if this is the case.
    I've tried using the Quick collection to group all the photos that I want to delete, however you can't delete them from there either.
    I've tried using the reject flag to flag all the ones that I want to delete, but that doesn't help either. All you can do with the rejected photos is to remove them from the collection; the reject flag isn't sticky across collection and the folder view.
    I really need an efficient way to delete multiple files from a collection view. Is there one?
    Thanks,
    Tim

    There is a three key combo for this. See the appropriate to your OS PDF in the FAQ, top of forum list, for a comprehensive Keyboard SHortcut list, including operators for Find.
    Don
    Don Ricklin, MacBook 2Ghz Duo 2 Core running 10.5.1 & Win XP, Pentax *ist D
    See LR Links list at my
    Blog for related sites.

  • Deleting elements from Arrays.

    Hello,
    I have to be able in this latest exercise to delete an element from an Array. I was wondering if you could give me code examples on how to do this. I am pretty sure that you have to read through the array and return "null" when you hit the element that you want to delete in the array.
    Thank you.

    Look through the forum. There are at least two other threads open with people asking the same question.

  • Delete elements from XML file using DOM and java

    Hi
    I want now is to remove element from my XML file
    for example
    i have following xml
    <?xml version="1.0" encoding="UTF-8"?>
    <printing>
    <firstLineTexts>
              <firstLineText />
              <firstLineText>|line11</firstLineText>
              <firstLineText>|line12</firstLineText>
    </firstLineTexts>
    </printing>how do i remove all elements fireLineText
    my final output should be
    <?xml version="1.0" encoding="UTF-8"?>
    <printing>
    <firstLineTexts>
    </firstLineTexts>
    </printing>How do i do it using DOM,
    I can create instance of DOM and write it using TransformerFactory
    Ashish

    Hi
    I am trying the following code,
    but it is not working
                    NodeList nScene = doc.getElementsByTagName("firstLineTexts");
              NodeList nScene1 = nScene.item(0).getChildNodes();
              for (int i = 0; i < nScene1.getLength(); i++)
                   Node n = nScene1.item(i);
                        nScene.item(0).removeChild(n);
              }

  • Deleting element from binary search tree

    please could u tell me what is the wrong with this deleting function ..
         private  BTNode deleteElement(int a,BTNode curNode)
              BTNode s,q,p;
              if (curNode==null)
              return curNode;
              HasId curObject =(HasId)curNode.getInfo();
              if (a>curObject.getId())
               curNode=deleteElement(a,curNode.getRight());     
               return curNode;
              else if (a<curObject.getId())
                   curNode=deleteElement(a,curNode.getLeft());
                   return curNode;
              else
                   q=curNode;
                   s=curNode;
                   if (q.getRight()==null)
                   curNode=q.getLeft();
                   else if (q.getLeft()==null)
                   curNode=q.getRight();
                        else{
                   p=q.getRight();
                   while (p.getLeft()!=null)
                        s=p;
                        p=p.getLeft();
                   curNode=p;
                   curNode.setLeft(q.getLeft());
                   s.setLeft(p.getRight());
                   if (q.getLeft()==p)
                   curNode.setRight(q.getRight());
                   else
                   curNode.setRight(p.getRight());
                   return curNode;
         public void delete(int a)
              deleteElement(a,root);
         }

    Very confusing code for the case a == curObjec.getId()
    Try giving meaningful names to the nodes instead of p, q, r, and adding some comments. It also looks like you could do with less node references than curnode, p, q and r, you are throwing them around a lot which is quite confusing.
    I find he following a bit weird:
    while (p.getLeft()!=null)
                        s=p;
                        p=p.getLeft();
                   }I don't know why you are making a path that always goes to the left child node while you already found a node to be deleted. Also I would think that a binary tree should be symmetric, so why only go to the left?
    If you got the delete algorithm from a book or website try to look exactly where your code goes wrong. Otherwise try running your code in your mind on a simple example tree and see if you find an error.

  • Deleting elements from a binary heap

    I have to create a binary heap class and perform various operations. Every operation works except deleteMin, which gives an "ArrayIndexOutOfBoundsException: -1" exception in every case I've tried. Supposedly it's coming from line 85, which I put a line comment next to in the code below.
         * Deletes the smallest element (the root) from the heap and returns that value.
         * The heap is then reordered so that it is still a valid heap.
         * @return the root of the heap, a T type value
        public T deleteMin(){
            if(size == 0)
                throw new MyException();
            T returnValue = arr[0];
            T item = arr[size-1];
            size--;
            int hole = 0;
            int newHole = newHole(hole, item);
            while(newHole < arr.length - 1){
                arr[hole] = arr[newHole];  // ERROR IS HERE?
                hole = newHole;
                newHole = newHole(hole, item);
            arr[hole] = item;
            return returnValue;
         * Gives the index of where the next hole in the heap will be.
         * @param hole the index of the current hole
         * @param item the last element in the heap
         * @return the index of the next hole to be checked
        private int newHole(int hole, T item){
            int newHole = -1;
            if(arr[2*hole + 1] != null || arr[2*hole + 2] != null){
                if(arr[2*hole + 2] == null){
                    if((arr[2*hole + 1]).compareTo(item) < 0){
                        newHole = 2*hole + 1;
                else {
                    int smallerItem;
                    // may need >= param
                    if((arr[2*hole + 1]).compareTo(arr[2*hole + 2]) > 0)
                        smallerItem = 2*hole + 2;
                    else
                        smallerItem = 2*hole + 1;
                    if((arr[smallerItem]).compareTo(item) < 0)
                        newHole = smallerItem;
            return newHole;
        }I know I set newHole = -1 in the private method, which may be the problem, but the pseudo code my teacher gave me says to do just that. She gave us the pseudo code using a heap of int, the code is designed for a generic, comparable class. The test class uses a heap<String>. I just can't see why the problem is arising. Can anyone see where I've gone wrong?
    Edited by: sublimeph03nix on Apr 23, 2009 1:57 PM
    Edited by: sublimeph03nix on Apr 23, 2009 2:03 PM

    arr[hole] = arr[newHole]; // ERROR IS HERE?I'd say that I bet newHole == -1, so you're trying to access element -1 in the array, which of course is out of bounds.
    You have heard about debuggers, haven't you?

  • Retrive n number of elements from the collection using XQUERY

    <?xml version="1.0"?>
    <ns0:PNR >
        <ns0:num>num_1</ns0:num>
        <ns0:num>num_2</ns0:num>
        <ns0:num>num_3</ns0:num>
        <ns0:num>num_4</ns0:num>
        <ns0:num>num_5</ns0:num>
        <ns0:num>num_6</ns0:num>
        <ns0:num>num_7 </ns0:num>
    </ns0:PNR>
    In the above XMl i need an xquery to get below response:
    <ns1:PNRSet >
    <ns1:set>
    <ns0:num>num_1</ns0:num>
        <ns0:num>num_2</ns0:num>
    </ns1:set>
    <ns1:set>
    <ns0:num>num_3</ns0:num>
        <ns0:num>num_4</ns0:num>
    </ns1:set>
    <ns1:set>
    <ns0:num>num_5</ns0:num>
        <ns0:num>num_6</ns0:num>
    </ns1:set>
    <ns1:set>
    <ns0:num>num_7</ns0:num>
    </ns1:set>
    </ns1:PNRSet>

    Declare @x xml ='<?xml version="1.0"?>
    <ns0:PNR xmlns:ns0="whatever">
    <ns0:num>num_1</ns0:num>
    <ns0:num>num_2</ns0:num>
    <ns0:num>num_3</ns0:num>
    <ns0:num>num_4</ns0:num>
    <ns0:num>num_5</ns0:num>
    <ns0:num>num_6</ns0:num>
    <ns0:num>num_7 </ns0:num>
    </ns0:PNR>';
    with xmlnamespaces ('whatever' as ns0, 'the other' as ns1)
    , num as (
    select num from (values(0), (1),(2),(3), (4), (5), (6), (7),(8),(9),(10)) x(num)
    ), setFull as (
    select num / 2 as setNum, num + 1 as num
    from num n
    ), setNum as (
    select distinct setNum
    from setFull
    where @x.exist('/ns0:PNR/ns0:num[position() = sql:column("num")]') = 1
    select
    (Select
    x.val.query('.')
    from setFull s
    cross apply @x.nodes('/ns0:PNR/ns0:num[position() = sql:column("num")]') x(val)
    where n.setNum = s.setNum
    for xml path (''), type)
    from setNum n
    for xml path ('ns1:set'), root('ns1:PNRSet')
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

  • HT4059 how do you delete books from your ibooks collection

    How can you delete ibooks from your collection list.  I no longer want them on my mini ipad

    Open the iBooks app. Tap the Edit button at the upper-right. Tap the books you wish to delete. Tap the red "Delete" button. Or you can uncheck them on the Books tab in iTunes on your computer and they'll be removed when you sync.
    Regards.

  • Getting change values from a collection

    Title says it all. I have a collection connected to a
    datagrid and have a simple form that allows me to add/modify/delete
    entries from the collection. Now I want to send the changes to the
    collection back to the server. How do I read/parse the collection
    for these changes? Examples would be helpful. Below is what I have
    so far to examine the collection (found elsewhere) how do I extract
    the name/value pairs that have changed?
    public function
    collectionEventHandler(event:CollectionEvent):void {
    switch(event.kind) {
    case CollectionEventKind.ADD:
    addLog("Item "+ event.location + " added");
    break;
    case CollectionEventKind.REMOVE:
    addLog("Item "+ event.location + " removed");
    break;
    case CollectionEventKind.REPLACE:
    addLog("Item "+ event.location + " Replaced");
    break;
    case CollectionEventKind.UPDATE:
    addLog("Item updated");
    break;
    }

    ArrayCollection supports the length property, so you can
    simply iterate over it with a for loop and use the bracket notation
    to return each item. Build the structure you want to sent, then
    away you go.
    If you are wanting to only select changed values, you will
    have to track this yourself.
    Tracy

  • How to delete the last element of a collection without iterating it?

    how to delete the last element of a collection without iterating it?

    To add to jverd's reply, even if you could determine the last element, in some collections it is not guaranteed to always be the same.
    From HashSet:
    It makes no guarantees as to the iteration order of the set; in particular, it does not guarantee that the order will remain constant over time.

  • If you delete files from your computer, BlackBerry Link deletes the file or collection from your device?

    I found the below description from the help of BlackBerry Link, however i never get it work.
    Any one know whats wrong or what i need to set?
    About deleting music, pictures, videos, and documents?
    After you sync your music, picture, video, or document files between your computer and your BlackBerrydevice, if you delete a file or a collection of files, the following actions occur:
    If you delete files from your computer, BlackBerry Link deletes the file or collection from your device.
    If you delete files from your device, BlackBerry Link doesn't delete the file or collection from your computer.
    For information about how to delete a file from your device, tap the Help app on the home screen of your device.

    Hey hkfoolman,
    Welcome to the BlackBerry Support Community Forums.
    Thanks for the question.
    Go into BlackBerry Link and click on the BlackBerry and then click on Options.  Make sure you have Music, Pictures, Videos and Documents checkmarked for synchronization.  Once these are checked, try to remove the files.
    Let me know if you have any more questions.
    Cheers.
    -ViciousFerret
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Like! for those who have helped you.
    Click  Accept as Solution for posts that have solved your issue(s)!

  • How to completely delete Photoshop Elements from my computer??

    Hi
    I am trying to completely remove Photoshop Elements from my computer.   So far, I have failed in my attempts to do this.   The reason I'm doing this is b/c for some reason that I can't fathom, the folders in My Pictures -- the folders named by shot date -- contain random duplicates.When this happens, the file names folow the convention of DSC_0222 and DSC_0222-1. Exactly the same file size and metadata.  In some folders, every picture is duplicated. In other folders, only selected pitcures within the folder are duplicated.   I can't figure out how they got there -- e.g. it doesn't seem to bear any connection to the photos I've edited, which was one theory I had for a while.   Is Elements responsible? Or is this some sort of bug in the download process from the camera (I have a Nikon D40).  Anyway, I've given up on trying to sovle this problem and decided I would go back to the beginning and reload everything from my camera.   So, my real question here is about how to completely uninstall Elements.
    Here's what I did:    I uninstalled Photoshop Elements through the Add/remove programs utility.  I got no errors during the uninstall process.   Then I completely deleted the My Pictures directory (don't worry -- I have it backed up in multiple places!!).   So, at this point there are *no* pictures on my computer at all.    I reinstall Elements, open it up and -- you guessed it!!! -- the catalog is still there with all the thumbnails of the pictures that i deleted from my hard disk.   Of course, each thumbnail is flagged as "Missing File".
    So, how do I uninstall/reinstall Elements and get it to forget all memory of the previous catalog?   Why is it "remembering" it in this way when the pictures aren't even on the computer anymore?  Isn't this a bug???
    I've been working on this issue for much longer than I care to remember-- if anyone can tell me how to get myself truly back to ground-zero so I can start over I would be deeply grateful.   After upgrading to Elements 9 (from 7) to try to solve this problem I am close to just abandoning Elements entirely.....
    WHile we're at it, if anyone has any idea where the duplicates pictures are coming from and how I prevent that from happening, I'm' all ears!!!!
    Thanks!

    Hi
    Thanks so much for the response.   So, Help/System Info says that the catalog is here:
    Catalog Location: C:\Documents and Settings\All Users\Application Data\Adobe\Elements Organizer\Catalogs\My Catalog\
    but no such file appaers to exist.  In fact, I can only get as far as All Users.   Then there is no directory under that called "Application Data".
    i'm still seeing the thumbnails when I got into Elements tho'....   :-(
    hjr

Maybe you are looking for

  • SQL*Loader-925: Error while uldlfca: OCIStmtExecute (ptc_hp)

    Hi my table loading is failing with the floowing error. But same table is loading daily without any problem. I tried again but failed with the same message. SQL*Loader-2026: the load was aborted because SQL Loader cannot continue. SQL*Loader-925: Err

  • File Structure and Commands

    Dear all, My applet will need to do something like this. SIMSystem gsmFile = SIMSystem.getTheSIMView(); gsmFile.select(0x3F00) <-Select the MF gsmFile.select(0x7F20) <- Select the DF gsmFile.select(0x6F50) <- Select EF gsmFile.updateRecord(...... My

  • Reg: Receiver File

    Hi..      I am doing Idoc to File scenario. In the receiver file structure, we have structure like below Header -- 1 Body -- 0 to n Trailer -- 1 In the file adapter, i have used append mode. So if we have triggered 3 idocs, we will get 3 files append

  • Errorr #2048

    I created swf file in Xcelsius that needs data from other server (QAAWS) placed in intranet. This file is saved in local filesystem. When I try to open it with web browser I get an error 2048. I found that it is a Adobe Flash Player ActiveX problem -

  • PE4:  Elements Help Feature

    I did the Help v4 download/install and ran AHC.EXE, so this has been done and I still get the following...and wonder if this is happening to others? Open Elements v4, goto menu > Photoshop Elements Help. There is a dropdown next to "FOR" near the top