Iterating through a list in BPM

hI,
I have a element which is unbounded and i want to loop over it.I could not find any function in BPM for the same.Can you pl tell me as how to iterate over a list.
Thanks

Hi Mansish,
Please find a similar discussion Select entry out of a list
I think you need to create an EBJ function, here is a link to a help document for EBJ functions http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/609c9982-39af-2b10-768b-e5bd8813c1f3
Best regards,
Radost

Similar Messages

  • Iteration through a list of map entries

    hi,
    I am facing a situation in which i have to write a rule to iterate through a list of map entries within a map and again iterate for a given attribute through a map of attributes within the selected map entry.
    Can anyone throw light on any function or expression in the XPRESS language in the Identity Manager to accomplish this.
    thanx in advance,
    yashuwyah

    HI,
    I cant help you out with full code at this point. But do make use of the following to determine the equivalency between GenericObject and HashMap as shown below.
    Basic Operations
    � map.keySet() == genObj[*].name
    � map.entrySet() == genObj[*]
    � map.get(attribute) == genObj.attribute
    � map.get(attribute1).get(attribute2).get(employeeNumber) ==
    genObj. attribute1. attribute2.employeeNumber� if attribute1 indexes a list object in the preceding example ==
    genObj. attribute1[attribute2].employeeNumber� Searches
    � find the object with the attribute fullname = �John Smith� ==
    genObj[fullname=John Smith]� get John Smith�s employeeNumber == genObj[fullname=John
    Smith].employeeNumber� List Operations
    � get the names of all permanent employees ==
    genObj[employeeType=permanent].nameFor your requirements, I figure that you can iterate through the list in the beginning and assign the initial result to a <defvar>. Then use the reference of this to determine the required attributes next.
    IC.

  • DriverManager iterating through driver lists, will it create an overhead ?

    Folks, i read this on a website:
    "You need a database connection to manipulate the database. In order to create the connection to the database, the DriverManager class has to know which database driver you want to use.
    It does that by iterating over the array (internally a Vector) of drivers that have registered with it and calls the acceptsURL(url) method on each driver in the array, effectively asking the driver to tell it whether or not it can handle the JDBC URL. "
    So does it mean whenever we try to create a db connection, the driver manager would iterate through the entire list of drivers which have registered ??
    In case the number of drivers registered are substantial, won't this create an overhead ?

    So does it mean whenever we try to create a db
    connection, the driver manager would iterate through
    the entire list of drivers which have registered ??
    In case the number of drivers registered are
    substantial, won't this create an overhead ?The number of drivers is never substantial.
    Problems in your code are much more likely to cause more overhead than this feature ever will. Add this one to the "don't worry about it" list.
    %

  • Iterating through a generic list of unknown type

    Hi,
    I am in the process of creating pdf reports for my project.I have to deal with a persistence api to get the data for the report.The data will be in the form of a list,like List<SomeObject>,all these lists returned by the persistence framework contains object of some type which implements a common interface.But through that interface I wont be able to get all the data for my reports.So I am looking for a generic way for iterating through the list,by providing some metadata for the data within the list. I am planning to use reflection to query through the list.Is there any feature of generic,through which I can easily iterate through this unknown type,preferrably a combination of reflection and generics,I want to reduce the LOC.Any suggestions??

    If the List returned by the framework isn't parameterized, Like
    public List<K> getList(Class<K> classType);
    then you have to cast it to the appropriate type. If you are not sure about the type of the Objects in the list, and you have a bunch of class types you could expect from the list, then you could use instanceof operator.
    If it could be Class A or B, then
    if (obj instanceof A){
    A castObject = (A) obj;
    else if(obj instanceof B){
    B castObject = (B)obj;
    }Even to do reflection to invoke methods, you need to know the method Names. Which tells me you have the knowledge of what could come out of the list. So cast them. Invoking methods using reflection is really slow.

  • Concurrent modification exception while iterating through list

    Hi,
    I have a list of objects. I use for each loop in java to iterate through that list of objects and display them.
    The problem is that while iterating other thread can add or remove some objects from that list, and I get ConcurrentModificationException.
    How can I handle this problem. How can I be sure that I am iteration through the updated list.
    Thank you

    Synchonize on the list before iterating through it, and make sure that other code also synchronizes on the list before adding to it or removing from it. Using a list implementation that simply synchronizes all the methods (e.g. Vector) will not do that, you have to do it yourself.

  • SharePoint Online Iterating through Document Libraries CSOM

    Hi,
    I am trying to iterate though a document library and set each document/items whithin to inherit permissions (at the moment each doc/item is using uniquer permissions).
    I am able to get the specific document library that I am interesting in, however I cannot at the moment iterate though each of the items/documents within it, but here is what I have so far:
    Add-Type -Path "Libraries\Microsoft.SharePoint.Client.dll"
    Add-Type -Path "Libraries\Microsoft.SharePoint.Client.Runtime.dll"
    Add-Type -Path "Libraries\Microsoft.SharePoint.Linq.dll"
    Add-Type -Path "Libraries\Microsoft.SharePoint.dll"
    $webUrl = "https://test.sharepoint.com/sites/testsite"
    $username = "####"
    $password = "####"
    $securePass = ConvertTo-SecureString $password -AsPlainText -Force
    $listname = "TestDoc";
    $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl)
    $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $securePass)
    #variables
    $web = $ctx.Web
    $lists = $web.Lists
    $ctx.Load($lists)
    $ctx.Load($web)
    $ctx.ExecuteQuery()
    #print web URL
    write-host `n "Web Url:" `n $web.Url
    foreach ($list in $lists)
    if ($list.Title -eq "TestDoc")
    #print list name if found
    write-host `n "Found the list:" `n $list.Title `n
    #attempting to iterate through items in the document library
    foreach ($item2 in $list.Items)
    #list the items/documents in the document library
    write-host $item2.Title
    It is the foreach loop I am having trouble at the moment as I am not sure how to loop though each of the items/documents in the document library.
    Any suggestions on the approach I should take would be much appreciated.

    Thanks for the heads up, I have re-worked my script which is simpler and now works like a charm:
    Add-Type -Path "Libraries\Microsoft.SharePoint.Client.dll"
    Add-Type -Path "Libraries\Microsoft.SharePoint.Client.Runtime.dll"
    Add-Type -Path "Libraries\Microsoft.SharePoint.Linq.dll"
    Add-Type -Path "Libraries\Microsoft.SharePoint.dll"
    $webUrl = "https://test.sharepoint.com/sites/testsite"
    $username = "####"
    $password = "####"
    $securePass = ConvertTo-SecureString $password -AsPlainText -Force
    $listname = "TestDoc"
    $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl)
    $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $securePass)
    #get the List/DocLib and load it for use
    $listUpdate = $ctx.Web.Lists.GetByTitle($listname)
    $ctx.Load($listUpdate)
    $ctx.ExecuteQuery()
    #CAML Query to get all items inclusing sub-folders
    $spQuery = New-Object Microsoft.SharePoint.Client.CamlQuery
    $spQuery.ViewXml = "<View Scope='RecursiveAll' />";
    $itemki = $listUpdate.GetItems($spQuery)
    $ctx.Load($itemki)
    $ctx.ExecuteQuery()
    #iterating through the items and reseting permission inheritence
    for($j=0; $j -lt $itemki.Count; $j++)
    $itemki[$j].ResetRoleInheritance()
    $ctx.ExecuteQuery()

  • Avoid iterating through everything

    Hello all,
    Hope you guys can help me with this problem. I have a program that draws anywhere from 1-300,000 letters on a canvas. Each letter is created from a class called StringState which extends Rectangle. What I would like to do is have each letter respond when the user moves the mouse over the letter by growing bigger. I figured I can just see if the letters bounds contains the point where the mouse moved to and if it does change the letters size and repaint around that letter to update the display. This works great from 1-5000 letters but getting up to 10,000 or even higher creates a very visible lag while the program is iterating through the letters to check if the mouse location intersects the letters bounds. What I was wondering is there a way to get this result without iterating through the entire collection of letters to see if it contains the mouse location? Like can I attach some kind of mouse listener to each letter or something like that? The following program just demonstrates how I create and display the letters I haven't really had a chance to create a demonstration of how they would grow when hovered over. The program i'm working on that actually demonstrates this is very large and hard to trim down to show an example so the following code is actually from a previous question I asked and was provided by Aephyr. Thanks in advance for your guys help :)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import java.util.List;
    public class PaintSurface implements Runnable, ActionListener {
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new PaintSurface());
         Tableaux tableaux;
         Random random = new Random();
    //        Point mouselocation = new Point(0,0);
         static final int WIDTH = 1000;
         static final int HEIGHT = 1000;
            JFrame frame = new JFrame();
         public void run() {
              tableaux = new Tableaux();
              for (int i=15000; --i>=0;)
                   addRandom();
              frame.add(tableaux, BorderLayout.CENTER);
              JButton add = new JButton("Add");
              add.addActionListener(this);
              frame.add(add, BorderLayout.SOUTH);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setSize(WIDTH, HEIGHT);
              frame.setLocationRelativeTo(null);
    //                frame.addMouseMotionListener(new MouseListener());
              frame.setVisible(true);
         public void actionPerformed(ActionEvent e) {
              addRandom();
         void addRandom() {
              tableaux.add(
                        Character.toString((char)('a'+random.nextInt(26))),
                        UIManager.getFont("Button.font"),
                        random.nextInt(WIDTH), random.nextInt(HEIGHT));
    //        class MouseListener extends MouseAdapter {
    //            public void mouseMoved(MouseEvent e) {
    //                mouselocation = new Point(e.getX(),e.getY());
    //                frame.repaint();
            class StringState extends Rectangle {
                    StringState(String str, Font font, int x, int y, int w, int h) {
                            super(x, y, w, h);
                            string = str;
                            this.font = font;
                    String string;
                    Font font;
            class Tableaux extends JComponent {
                 Tableaux() {
                      this.enableEvents(MouseEvent.MOUSE_MOTION_EVENT_MASK);
                      lagState = createState("Lag", new Font("Arial",Font.BOLD,20), 0, 0);
                 protected void processMouseMotionEvent(MouseEvent e) {
                      repaint(lagState);
                      lagState.setLocation(e.getX(), e.getY());
                      repaint(lagState);
                      super.processMouseMotionEvent(e);
                 StringState lagState;
                    List<StringState> states = new ArrayList<StringState>();
                    StringState createState(String str, Font font, int x, int y) {
                        FontMetrics metrics = getFontMetrics(font);
                        int w = metrics.stringWidth(str);
                        int h = metrics.getHeight();
                        return new StringState(str, font, x, y-metrics.getAscent(), w, h);
                    public void add(String str, Font font, int x, int y) {
                         StringState state = createState(str, font, x, y);
                            states.add(state);
                            repaint(state);
                    protected void paintComponent(Graphics g) {
                            Rectangle clip = g.getClipBounds();
                            FontMetrics metrics = g.getFontMetrics();
                            for (StringState state : states) {
                                    if (state.intersects(clip)) {
                                            if (!state.font.equals(g.getFont())) {
                                                    g.setFont(state.font);
                                                    metrics = g.getFontMetrics();
                                            g.drawString(state.string, state.x, state.y+metrics.getAscent());
                            if (lagState.intersects(clip)) {
                            g.setColor(Color.red);
                            if (!lagState.font.equals(g.getFont())) {
                                g.setFont(lagState.font);
                                metrics = g.getFontMetrics();
                            g.drawString("Lag", lagState.x, lagState.y+metrics.getAscent());
    }Here is the code that iterates through the letters to see if a letter contains the mouse location:
                if(e.getSource()==canvas&&edit) {
                    for(Letter l : letters) {
                        Rectangle rec = new Rectangle(l.x+l.xoffset,l.y+l.yoffset,l.width,l.height);
                        if(rec.contains(new Point(e.getX(),e.getY()))&&l.resizing==false&&l.defaultSize==l.font.getSize()) {
                            l.resizing = true;
                            new Thread(new ExpandLetter(l)).start();
                        else if(!rec.contains(new Point(e.getX(),e.getY()))&&l.resizing==false){
                            l.font = new Font(l.font.getName(),l.font.getStyle(),l.defaultSize);
                            l.resizeLetter(l.text);
                }However I just learned that this loop itself is taking up a huge amount of memory by saying
    l.font = new Font(l.font.getName(),l.font.getStyle(),l.defaultSize); When I take that line out the lag is reduced by a lot. Also I think that it isn't forgetting the "old" letters font that it is replacing by saying new Font() and after running this loop once my program runs slow and laggy as if it doesn't have enough memory to run fast anymore. Is there something I am doing wrong by initiating a new Font. I would have thought that it wouldn't take up anymore memory because it replaces the old font the the letter "l" has. The loop seems to have some kind of memory leak if someone could point it out to me that would be great. Thanks :)
    Edited by: neptune692 on Feb 16, 2010 8:18 PM

    neptune692 wrote:
    can I attach some kind of mouse listener to each letterTry this:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import java.util.*;
    import javax.swing.event.*;
    public class SimplePaintSurface implements Runnable, ActionListener {
        private static final int WIDTH = 1250;
        private static final int HEIGHT = 800;
        private Random random = new Random();
        private JFrame frame = new JFrame("SimplePaintSurface");
        private JPanel tableaux;
        public void run() {
            tableaux = new JPanel(null);
            for (int i = 15000; --i >= 0;) {
                addRandom();
            frame.add(tableaux, BorderLayout.CENTER);
            JButton add = new JButton("Add");
            add.addActionListener(this);
            frame.add(add, BorderLayout.SOUTH);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setSize(WIDTH, HEIGHT);
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
            tableaux.requestFocusInWindow();
        public void actionPerformed(final ActionEvent e) {
            addRandom();
            tableaux.repaint();
        void addRandom() {
            Letter letter = new Letter(Character.toString((char) ('a' + random.nextInt(26))));
            letter.setBounds(random.nextInt(WIDTH), random.nextInt(HEIGHT), 16, 16);
            tableaux.add(letter);
        public static void main(final String[] args) {
            SwingUtilities.invokeLater(new SimplePaintSurface());
    class Letter extends JLabel {
        Font font1;
        Font font2;
        private final FontRenderContext fontRenderContext1;
        private final FontRenderContext fontRenderContext2;
        public Letter(final String letter) {
            super(letter);
            setFocusable(true);
            setBackground(Color.RED);
            font1 = getFont();
            font2 = font1.deriveFont(48f);
            fontRenderContext1 = getFontMetrics(font1).getFontRenderContext();
            fontRenderContext2 = getFontMetrics(font2).getFontRenderContext();
            MouseInputAdapter mouseHandler = new MouseInputAdapter() {
                @Override
                public void mouseEntered(final MouseEvent e) {
                    Letter.this.setOpaque(true);
                    setFont(font2);
                    Rectangle bounds = getBounds();
                    Rectangle2D stringBounds = font2.getStringBounds(getText(), fontRenderContext2);
                    bounds.width = (int) stringBounds.getWidth();
                    bounds.height = (int) stringBounds.getHeight();
                    setBounds(bounds);
                @Override
                public void mouseExited(final MouseEvent e) {
                    Letter.this.setOpaque(false);
                    setFont(font1);
                    Rectangle bounds = getBounds();
                    Rectangle2D stringBounds = font1.getStringBounds(getText(), fontRenderContext1);
                    bounds.width = (int) stringBounds.getWidth();
                    bounds.height = (int) stringBounds.getHeight();
                    setBounds(bounds);
            addMouseListener(mouseHandler);
    }

  • Yet another Try Catch question. Iterating through a ForEach loop

    Confused on error handling in a Powershell ForEach loop. I’m looping through a list of registry keys, attempting
     to open each one. If it succeeds, I do a bunch of stuff. If it fails, I want to skip to the next iteration.
    If I was doing It in VBScript I’d do this:
    For Each Thing In colThings
    Open Thing
    If Err.Number <> 0 Then
    “oops”
    Else
    Do stuff
    Do stuff
    Do stuff
    End If
    Next
    This is what I came up with in PowerShell. It seems to work, but just doesn’t seem powershell-ish. There must be a better way to use the catch output than just creating a $return variable and assigning it success or fail?
    ForEach ($subKeyName in $subKeyNames)
    try{$subKey = $baseKey.OpenSubKey("$subKeyName")}
    catch{$return = "error" }
    If($return -eq "error" )
    “Oops”
    Else
    Do stuff
    Do stuff
    Do Stuff

     
    I totally get what you're saying about formatting. I don't' have any habits yet, since I've only been working in Powershell since... well, what time is it now?
    Unfortunately, It Has Been Decreed that we are no longer to use VBScript for any engineering solutions at work, so my 15 years experience in it now needs to be transitioned over asap. I don't have the luxury of crawling before I run. I'm trying not to be
    frustrated, but it's like an English major waking up one day and being told "You must now speak French exclusively. Here's a book."
    The Do Stuff example of my ForEach loop is about 50 lines of code involving matching values in subkeys of this registry key with another and collecting output. I tried wrapping the whole thing in a try section based on some examples, but it seemed odd, that's
    why I'm asking. I'm used to tightly focused error handling at the point where an error may occur.
    In this example I'm only interested in whether or not I can open the subkey (it exists, but I may not have permission). If I can't, there's no point in continuing with this iteration of the loop, I want to skip to the next one. So why include all the "Do
    Stuff" in the the try section? From a readability viewpoint, it doesn't seem helpful.
    Also, there may be more error handling deeper in the code. If I then put that in a try/catch, and then something else inside that, now I have nested try/catches mixed in with nested if/elses, all wrapped in a For loop.
    Again, I can see how it works logically, but for readability not so much, and having all these braces 50 lines apart to match up is giving me eye strain :).
    It sounds like David is agreeing with jrv, that putting the entire ForEach loop code into a try/catch is the conventional way to do it. I guess it makes as much sense as putting it all in an If-else-Endif, and I just need to adjust my paradigm.
    But if not, my specific question was more along the lines of, is there a built in way to tell that the catch section has been executed, rather than me using it to populate an arbitrary variable and then read it? In VBScript, you execute something, and the
    next line, you check the Err.number. I wasn't sure if you could do that with a try/catch.

  • Iterate through two lists

    Hello,
    I'm writing an application that generates two seperate sets of data from a database which are stored in two lists; list A & B. I need to cycle through one list (*B*) and remove data according to my search criteria. When I encounter data that I'm going to remove, it has to be done on list A as well.
    Is it at all possible to use one iterator to cycle through list B and modify A at the same time? If so, please explain.

    For those who are interested, here is the code I used to solve the problem. All the writers create an html booklet for easy interpretation. And yes, I did take into consideration the fact that removing an item from the list offsets the counter and will skip n+1. The use of while( cdList.contains( trimmedcdValue )) was introduced to handle such a case by continuing to delete duplicates (by grabbing their subscript) within the list.
              try{
                   statWriter=new BufferedWriter(new FileWriter("results/"+directory+"/FileStatistics.html"));
                   statWriter.write(this.buildHeader("File Statistics"));
                   statWriter.write("<table class='file-stats'><tr><th>File #</th><th>File name</th><th>Lines read</th><th>Total matches</th></tr>");
                   writer=new BufferedWriter(new FileWriter("./results/"+directory+"/MatchList.html"));               
                   writer.write(this.buildHeader("Matched References"));
                   writer.write("<table><tr><th>File Line</th><th>CD Reference</th><th>ATA Number</th><th>Log_Book</th><th>Description</th><th>File Found in</th></tr>");
                   //loop through all new files
                   for(int y=0; y<f.length; y++){
                             //update the progressbar information
                        this.updateProgress(f[y]);
                        //set file reader
                        reader=new BufferedReader(new FileReader("./id files/"+directory+"/"+f[y]));
                        int lineCount=0;     //keep track of lines read
                        int match=0;          //keep track of the matches
                        String line=null;
                        while((line=reader.readLine())!=null){
                             String trimmedLine=line.trim();          //remove leading/trailing whitespace
                             lineCount++;                              //increment line counter
                                  //cycle through list and check for matches
                             for(int x=0; x<cdList.size();x++){
                                  String cdValue=(String)cdList.get(x);               //current list subscript
                                       //remove leading/trailing whitespace
                                  String trimmedcdValue=cdValue.trim();                    
                                       //if matched; remove row from list
                                  if(trimmedLine.equalsIgnoreCase(trimmedcdValue)){     
                                            //while the value exists in the list; find & remove
                                       while(cdList.contains(trimmedcdValue)){
                                            match++;
                                            row=(match%2==0)?"<tr>":"<tr class='shaded'>";
                                            int index=cdList.indexOf(trimmedcdValue);
                                            writer.write(row+"<td>"+trimmedLine+"</td><td>"+cdList.get(index)+"</td><td>"+ataList.get(index)+"</td><td>"+logList.get(index)+"</td><td>"+descList.get(index)+"</td><td>"+f[y].toLowerCase()+"</td></tr>");
                                            this.removeRow(index);
                             }//end list for-loop
                        }//end line read while-loop
                        writer.flush();                    //flush writeMatch buffer
                             //write file statistics
                        row=(y%2==0)?"<tr>":"<tr class='shaded'>";
                        statWriter.write(row+"<td>"+(y+1)+" of "+f.length+"</td><td>"+f[y].toString()+"</td><td>"+lineCount+"</td><td>"+match+"</td></tr>");
                   }//end file for-loop
                   writer.write("</table></body></html>");
                   writer.close();          //close write match stream
                        //reopen write stream for new file
                   writer=new BufferedWriter(new FileWriter("./results/"+directory+"/RemainingList.html"));
                   writer.write(this.buildHeader("Remaining List"));
                   writer.write("<table><tr><th>CD Reference</th><th>ATA Number</th><th>Log Book</th><th>Description</th></tr>");
                   for(int y=0; y<cdList.size(); y++){
                        row=(y%2==0)?"<tr>":"<tr class='shaded'>";
                        writer.write(row+"<td>"+cdList.get(y)+"</td><td>"+ataList.get(y)+"</td><td>"+logList.get(y)+"</td><td>"+descList.get(y)+"</td></tr>");
                   writer.write("<tr><td colspan='4'>Remaining list size: "+cdList.size()+"</td></tr></table></body></html>");
                   writer.flush();                    //flush writeList Stream
                   writer.close();                    //close     writeList stream
                        //display operation statistics
                   endingListSize=cdList.size();
                   statWriter.write("<tr><td colspan='2'>Beginning list size:</td><td colspan='2'><strong>"+beginningListSize+"</strong></td></tr>");
                   statWriter.write("<tr class='shaded'><td colspan='2'>Null CD References removed:</td><td colspan='2'><strong>"+nulls+"</strong></td></tr>");
                   statWriter.write("<tr><td colspan='2'>ENG Log values removed:</td><td colspan='2'><strong>"+engs+"</strong></td></tr>");
                   statWriter.write("<tr class='shaded'><td colspan='2'>Ending list size:</td><td colspan='2'><strong>"+endingListSize+"</strong></td></tr>");
                   statWriter.write("</table></body></html>");
                        //flush and close stat writer stream
                   statWriter.flush();
                   statWriter.close();
              }catch(IOException ioe){
                   ioe.printStackTrace();
              }     If you care to actually look through all this code, there is a call to removeRow which deletes the selected item from each list and is as follows...
         private void removeRow(int x){
                   //remove identical row for each column
              cdList.remove(x);
              ataList.remove(x);
              logList.remove(x);
              descList.remove(x);
         }Thanks to everyone who invested time in this problem, but fortunately enough the problem was solved outside of this forum.

  • Iterate through a list containing Map items using struts

    Hi friends,
    I have a small problem. I want to iterate through a list of items, using struts.
    The list actually contains map structres for example:
    list(0)
         map(..key..value..)
         map(..key..value..)
         map(..key..value..)
    list(1)
         map(..key..value..)
         map(..key..value..)
         map(..key..value..)
    list(2)
         map(..key..value..)
         map(..key..value..)
         map(..key..value..)can I use <logic:iterate/> for this? if yes how? Because I have used this tag for list containing bean objects not Map.
    Any suggestions are much appreciated.
    Thanks,
    Vishal

    Normally, each object exposed by the iterate tag is an element of the underlying collection you are iterating over. However, if you iterate over a Map, the exposed object is of type Map.Entry that has two properties:
    key - The key under which this item is stored in the underlying Map.
    value - The value that corresponds to this key.
    So, if you wish to iterate over the values of a Hashtable, you would implement code like the following:
    <logic:iterate id="element" name="myhashtable">
    Next element is <bean:write name="element" property="value"/>
    </logic:iterate>
    Best Regards
    Maruthi

  • Iterating though a List with a 'next' button.

    Hey people,
    I am just finishing off my GUI but I had a thought, I really would like to have next and previous buttons so I can move through my list.
    However I started by implementing the 'Next' button, but I have run into some trouble, on the GUI I want the user to click next and it moves obviously to the next record, then they can hit it again and it moves onto the next record again.
    However when I tried to do this, the interator refuses to move to the next record, it just stays at they record with the index of 0.
    I've read some books, done some research and tried all the ways I can think of, but to no avail, my code for the 'Next' method is below, the button on the GUI just calls it from a separate class.
    public void MusicNext()
    ListIterator titerator = iList.listIterator();
    if(titeration.hasNext())
    System.out.println(titerator.next());
    }

    Hmmm, I am a little confused (yes I am stupid), heres my code:
    import java.util.*;
    public class MusicList
                private List iList;  //names are stored in a list.
         public MusicList()
              iList = new LinkedList();
         public MusicList(List pListOfMusic)
              iList = pListOfMusic;
            //Here's the interator, but I get a null pointer exception error.
            ListIterator titerator = iList.listIterator();
            public void MusicNext()
                    if(titerator.hasNext())
              System.out.println(titerator.next());
         public void addMusic(Music pMusicName)
                iList.add(pMusicName);
         public void removeMusic(Music pMusicName)
              iList.remove(pMusicName);
            //Return the name with the given surname, otherwise return null.
         //Uses a linear search.
            public Music findTitle(String pTitle)
              Music tTitle = null;
              boolean found = false;
              Iterator it = iList.iterator();
              while (it.hasNext() && !found)
                   tTitle = (Music) it.next();
                   found = tTitle.getTitle().equalsIgnoreCase(pTitle);
              if(!found) tTitle=null;
              return tTitle;
         public Music findAuthor(String pAuthor)
              Music tAuthor = null;
              boolean found = false;
              Iterator it = iList.iterator();
              while (it.hasNext() && !found)
                   tAuthor = (Music) it.next();
                   found = tAuthor.getAuthor().equalsIgnoreCase(pAuthor);
              if(!found) tAuthor=null;
              return tAuthor;
            public Music findPublisher(String pPublisher)
              Music tPub = null;
              boolean found = false;
              Iterator it = iList.iterator();
              while (it.hasNext() && !found)
                   tPub = (Music) it.next();
                   found = tPub.getPublisher().equalsIgnoreCase(pPublisher);
              if(!found) tPub=null;
              return tPub;
         public String toString()
              return "Music List = " + iList.toString();
    }Thanks,
    Rob.

  • Text is not being displayed in sync on a label when looping through a list -- how to fix?

    I have a list of states (50 states).  I loop through this list (in a winform app -- VS2012) and want to display the current state ID that is being processed in the loop in the text property of a label.  I precede the label.Text = StateID line with
    Application.DoEvents() but I am also (in Debug mode) writing the same text to the console.  The console displays correctly, but there appears to be a lag in the label.Text property
    List<string> StateList = new List<string> { "al", "ak", "az","ar","ca","co","ct","de","fl","ga",...};
    foreach (string stateID in StateList)
        Application.DoEvents();
        lblStateID.Text = "State is " + stateID;  //--there is a lag here
    I vaguely recollect something about a NotifyPropertyChanged event.  I know this is common in WPF, but is there something similar in winform?  Or is there a way to make the desired text to be displayed in the label.Text property in synchronization
    with the loop?
    Rich P

    Thank you.  This is way simpler than implementing the INotifyPropertyChanged Interface.  Although, here is an article on the INotifyPropertyChanged Interface and event
    http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged(v=vs.110).aspx
    Rich P

  • Step Through a List of .p12 Certificates and Their Passwords to Extract Property Data

    This is a follow-up question to my previous thread:
    http://social.technet.microsoft.com/Forums/en-US/58ca3098-e06d-419a-9465-1ae7973e1c04/extract-p12-property-information-via-powershell?forum=ITCG
    I understand how to extract the information for a certificate one-by-one, but I am wanting to write a powershell script that will step through a list of certificates and a list of their corresponding network passwords in order to extract their property
    data (i.e. expiration date, etc). Any suggestions?
    jrv helped me with the first part of my question by providing this script:
    PS C:\> $filename='c:\temp2\certs\jpd.cer'
    PS C:\> $cert=[System.Security.Cryptography.X509Certificates.X509Certificate2]::CreateFromSignedFile($filename)
    PS C:\scripts> $cert|fl
    Happy Hunting!

    HINT:
    dir *.cer | %{ [System.Security.Cryptography.X509Certificates.X509Certificate2]::CreateFromSignedFile($_)}
    ¯\_(ツ)_/¯

  • DMS: Print mutiple Documents(originals)  through CV04n List of DIRS directl

    Hi All,
    Is it possible to Print Multiple documents through cv04n list of douments, i.e i will select the documents from the list, say 10 documents & click on the print tab. When i tried it prints only the frist document(original), how can print the all selected documents in one go.
    Is there any config or any userexist & badi for that?
    Help will be appriciated.
    Regards
    Nishant..

    Hi Nishant,
              Multiple originals printing is not possible in std SAP, since it involves Multiple application types (like cad,word,excel) and multiple drawing sheet sizes (A3&A4).
                You need to go for a third party software which provides this solution and support. You can be in touch with following solution providers.
    1. Cideon (http://cideon.de/cideon/en/so/index.php)
    2. Seal systems. (http://www.sealsystems.de/com/outputman/engineering_printing.php)
    Send me your email ID, i can send few documents.
    Regards,
    Prasanna
    <b>Reward points if useful</b>

  • Address Labels generated through a list merge

    I have been generating labels through a list merge using my address book groups. I am able to set up the template, however once I merge the labels using the print option, I am unable to edit them (I can only edit the template I created). Is there any way to edit the merged labels?

    Many Printers have the Software that allows you to choose each one in your address book but the key is the Peal off Sticker labels that you need to print to. You need to search and see if your printer software has this option. Microsoft's Office has this option. There is also a FREE Software that is.
    http://www.openoffice.org
    I am sure that this software has the option but remember it is the paper with the peal of stickers that is the key.
    Open Office is an Open Source Software that is the Equivalent to Microsoft's Office Suite.

Maybe you are looking for

  • Static watermark in pdf.

    We have a PDF document, which should be signed by end user. Next time when someone view pdf from application or download it, system should show signature as watermark. I have enabled signature and pdf watermarking. I am able to sign a document. When

  • I need help adding texture to a logo again.

    How can I get the metal texture on the black part instead of just the words having the texture on them? I didn't want the font to be textured, just the black part. Thanks in advance.

  • Upgrading iTunes and ios

    I am trying to upgrade my iOS to 5.1 from 4.3.  I get a message to first download a newer version of iTunes.  I download the file but when I install I get an error message.  I am in Panama so the message is in Spanish.  Here is the google translation

  • Customer master creation time

    Hi where can i find customer master creation time ? regards

  • Nokia Music - Where can I find the release date fo...

    There is a song that I really like and I was very pleased when I found it, 'till I realised it wasn't available for download or streaming. There is an album version that is available but I would rather wait for the soundtrack version. I just wish I c