Adding mouselisteners to JPanels created through for loop

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.io.File;
import java.io.IOException;
import java.util.Vector;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JViewport;
import javax.swing.SwingConstants;
import javax.swing.filechooser.FileSystemView;
public class ScrollableWrapTest {
    public static void main(String[] args) {
        try {
              ScrollableWrapTest st = new ScrollableWrapTest();
            final JPanel mainPanel = new JPanel(new WrapScollableLayout(FlowLayout.LEFT, 10, 10));
            mainPanel.setBackground(Color.WHITE);
            JScrollPane pane = new JScrollPane(mainPanel);
            pane.setPreferredSize(new Dimension(550, 300));
            Vector v = new Vector();
            v.add("first.doc");
            v.add("second.txt");
            v.add("third.pdf");
            v.add("fourth.rar");
            v.add("fifth.zip");
            v.add("sixth.folder");
            v.add("seventh.exe");
            v.add("eighth.bmp");
            v.add("nineth.jpeg");
            v.add("tenth.wav");
            JButton button = null;
            for(int i =0;i<v.size();i++){
                JPanel panel = new JPanel(new BorderLayout());
                Icon icon = st.getIcone(st.getExtension(v.elementAt(i).toString().toUpperCase()));
                  panel.setBackground(Color.WHITE);
                 Action action = new AbstractAction("", icon) {
                     public void actionPerformed(ActionEvent evt) {
                 button = new JButton(action);
                 button.setPreferredSize(new Dimension(icon.getIconWidth(), icon.getIconHeight()));
                 JPanel buttonPanel = new JPanel();
                 buttonPanel.setBackground(Color.WHITE);
                 buttonPanel.add(button);
                 JLabel label = new JLabel((String)v.elementAt(i));
                 label.setHorizontalAlignment(SwingConstants.CENTER);
                 panel.add(buttonPanel , BorderLayout.NORTH);
                 panel.add(label, BorderLayout.SOUTH);
                 mainPanel.add(panel);
                mainPanel.revalidate();
            st.buildGUI(pane);
        } catch (Exception e) {e.printStackTrace();}
    public void buildGUI(JScrollPane scrollPane)
         JFrame frame = new JFrame("Scrollable Wrap Test");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(scrollPane, BorderLayout.CENTER);
        frame.setLocationRelativeTo(null);
        frame.pack();
        frame.setVisible(true);
    public String getExtension(String name)
          if(name.lastIndexOf(".")!=-1)
               String extensionPossible = name.substring(name.lastIndexOf(".")+1, name.length());
               if(extensionPossible.length()>5)
                    return "";
               else
                    return extensionPossible;
          else return "";
     public Icon getIcone(String extension)
          //we create a temporary file on the local file system with the specified extension
          File file;
          String cheminIcone = "";
          if(((System.getProperties().get("os.name").toString()).startsWith("Mac")))
               cheminIcone = System.getProperties().getProperty("file.separator");
          else if(((System.getProperties().get("os.name").toString()).startsWith("Linux")))
               //cheminIcone = FileSystemView.getFileSystemView().getHomeDirectory().getAbsolutePath()+
               cheminIcone = "/"+"tmp"+"/BoooDrive-"+System.getProperty("user.name")+"/";
          else cheminIcone = System.getenv("TEMP") + System.getProperties().getProperty("file.separator");
          File repIcone = new File(cheminIcone);
          if(!repIcone.exists()) repIcone.mkdirs();
          try
               if(extension.equals("FOLDER"))
                    file = new File(cheminIcone + "icon");
                    file.mkdir();
               else
                    file = new File(cheminIcone + "icon." + extension.toLowerCase());
                    file.createNewFile();
               //then we get the SystemIcon for this temporary File
               Icon icone = FileSystemView.getFileSystemView().getSystemIcon(file);
               //then we delete the temporary file
               file.delete();
               return icone;
          catch (IOException e){ }
          return null;
    private static class WrapScollableLayout extends FlowLayout {
        public WrapScollableLayout(int align, int hgap, int vgap) {
            super(align, hgap, vgap);
        public Dimension preferredLayoutSize(Container target) {
            synchronized (target.getTreeLock()) {
                Dimension dim = super.preferredLayoutSize(target);
                layoutContainer(target);
                int nmembers = target.getComponentCount();
                for (int i = 0 ; i < nmembers ; i++) {
                    Component m = target.getComponent(i);
                    if (m.isVisible()) {
                        Dimension d = m.getPreferredSize();
                        dim.height = Math.max(dim.height, d.height + m.getY());
                if (target.getParent() instanceof JViewport)
                    dim.width = ((JViewport) target.getParent()).getExtentSize().width;
                Insets insets = target.getInsets();
                dim.height += insets.top + insets.bottom + getVgap();
                return dim;
}How can I add mouse listener to each of the 'panel' in 'mainpanel' created inside the 'for loop' using the code mainPanel.add(panel);Rony

>
How can I add mouse listener to each of the 'panel' in 'mainpanel' created inside the 'for loop' using the code mainPanel.add(panel);
Change the first part of the code like this..
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.File;
import java.io.IOException;
import java.util.Vector;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JViewport;
import javax.swing.SwingConstants;
import javax.swing.filechooser.FileSystemView;
public class ScrollableWrapTest {
    public static void main(String[] args) {
        try {
              ScrollableWrapTest st = new ScrollableWrapTest();
            final JPanel mainPanel = new JPanel(new WrapScollableLayout(FlowLayout.LEFT, 10, 10));
            mainPanel.setBackground(Color.WHITE);
            JScrollPane pane = new JScrollPane(mainPanel);
            pane.setPreferredSize(new Dimension(550, 300));
            Vector<String> v = new Vector<String>();
            v.add("first.doc");
            v.add("second.txt");
            v.add("third.pdf");
            v.add("fourth.rar");
            v.add("fifth.zip");
            v.add("sixth.folder");
            v.add("seventh.exe");
            v.add("eighth.bmp");
            v.add("nineth.jpeg");
            v.add("tenth.wav");
            JButton button = null;
            MouseListener ml = new MouseAdapter() {
                    @Override
                    public void mouseClicked(MouseEvent me) {
                         System.out.println(me);
            for(int i =0;i<v.size();i++){
                JPanel panel = new JPanel(new BorderLayout());
                Icon icon = st.getIcone(st.getExtension(v.elementAt(i).toString().toUpperCase()));
                  panel.setBackground(Color.WHITE);
                 Action action = new AbstractAction("", icon) {
                     public void actionPerformed(ActionEvent evt) {
                 button = new JButton(action);
                 button.setPreferredSize(new Dimension(icon.getIconWidth(), icon.getIconHeight()));
                 JPanel buttonPanel = new JPanel();
                 buttonPanel.setBackground(Color.WHITE);
                 buttonPanel.add(button);
                 JLabel label = new JLabel((String)v.elementAt(i));
                 label.setHorizontalAlignment(SwingConstants.CENTER);
                 panel.add(buttonPanel , BorderLayout.NORTH);
                 panel.add(label, BorderLayout.SOUTH);
                 mainPanel.add(panel);
                 panel.addMouseListener( ml );
                mainPanel.revalidate();
            st.buildGUI(pane);
        } catch (Exception e) {e.printStackTrace();}
...

Similar Messages

  • Garbage Collection: how many objects are created after for loop?

    Please see the fallowing java code
    1 public class Test1 {
    2     
    3     public static void main(String[] args) {
    4          
    5          MyObj obj = null;
    6          for(int i=0;i<5;i++){
    7               obj = new MyObj();
    8          }
    9 // do something
    10
    11     }
    12 }
    so my question is How may objects are eligible for garbage collection at line no: 9 (// do something)?

    so my question is How may objects are eligible for
    garbage collection at line no: 9 (// do something)?It's impossible to answer that question since we don't know how MyObj is implemented.
    Kaj

  • Need help in creating for loop

    Hi,
    I want to create two different Xquery transformation by checking attribute value in the input xml.
    <n:DIAMessage xsi:schemaLocation="http://pearson.com/DIA C:/shashi/rewrite/DIA/DIA_Schemas/DIA_new.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:n="http://pearson.com/DIA">
    <n:Customer>
    <n:Account sourceClassName="Account" sourceInstanceID="01560900" sourceSystem="MDR">
    <n:hasAccountRelation sourceClassName="AccountRelation" sourceInstanceID="01560900" sourceSystem="MDR">
    <n:hasAccountPerson name="BRIAN C STRICKLAND" sourceClassName="Person" sourceInstanceID="01560900|$|00114" sourceSystem="MDR"/>
    </n:hasAccountRelation>
    </n:Account>
    <n:Account sourceClassName="Account" sourceInstanceID="01560900" sourceSystem="MDR">
    <n:hasAccountRelation sourceClassName="AccountRelation" sourceInstanceID="01560900" sourceSystem="MDR">
    <n:hasAccountPerson name="BRIAN C STRICKLAND" sourceClassName="Person" sourceInstanceID="01560900|$|00114" sourceSystem="MDR"/>
    </n:hasAccountRelation>
    </n:Account>
    <n:Person name="BRIAN C STRICKLAND" sourceClassName="Person" sourceInstanceID="01560900|$|00114" sourceSystem="MDR">
    <n:hasIdentifier sourceClassName="Identifier" sourceInstanceID="01560900|$|00114" sourceSystem="MDR">
    <n:IDType>GENDER</n:IDType>
    <n:IDTypeName>GENDER</n:IDTypeName>
    <n:IDValue>M</n:IDValue>
    </n:hasIdentifier>
    </n:Person>
    <n:Person name="BRIAN C STRICKLAND" sourceClassName="Person" sourceInstanceID="01560900|$|00114" sourceSystem="MDR">
    <n:hasIdentifier sourceClassName="Identifier" sourceInstanceID="01560900|$|00114" sourceSystem="MDR">
    <n:IDType>GENDER</n:IDType>
    <n:IDTypeName>GENDER</n:IDTypeName>
    <n:IDValue>M</n:IDValue>
    </n:hasIdentifier>
    </n:Person>
    </n:Customer>
    </n:DIAMessage>
    From the above Message i need to create two transformation by checking
    if (DIAMessage/Customer/Account/@sourceClassName="Account")
    then call {
    Xquery1
    if(DIAMessage/Customer/Person/@sourceClassName="Person")
    then call{
    Xquery2
    Constraint here is Account and Person block occurence will be many times.As they are in same hierarchy how to create a for loop concept here?
    Please anyone can help me on this?

    Hi,
    Create a numeric variable to act as While loop counter and assign value of 1. Create a boolean variable to act as a flag to exit loop and assign value of true.
    Create a while object with a condition that while flag variable is true loop.
    Then you can create a switch with a case for each of your scenarios, referencing the xth record (defined by loop counter variable) in xml using ora:getElement
    When the count of required elements in input xml is less than your loop variable, assign the variable to exit loop as false...otherwise increment counter by one to loop to next record.
    Hope this helps.

  • Adding to a List which is being looped?

    Hello,
    I am trying to add items to a list which is being looped.
    Here is a demostration of what I want to do.
    List<MyObject> myObjects = new ArrayList<MyObject>();
    myObjects.add(new MyObject());
    for (MyObject mo : myObjects) {
            if (mo.process()) { // assume 'true' for couple of loops
                MyObject mo2 = (MyObject) mo.clone();
                myObjects.add(mo2);
    }I know I could keep a seperate list and then addAll to the myObjects list but that is not an option in my case. (code above is just a sample).
    And I also don't want the items to be added to the list after the for loop is existed which I think will happen if i do the list synchronized. (correct me if i am wrong please).
    Is there a way for this?
    thanks.

    This is a hard one. What you say you want can't be done with the new for loop nor with an iterator. You'll have to find a different way. If you know exactly what you want, there'll be a way to obtain it.
    Why is it that you cannot use addAll() or another means to add the elements after the loop?
    In your loop, do you want to loop through the added items too?
    I never used a ListIterator, but I think it has a few more options than the plain Iterator. Did you look at that yet?

  • How do i sweep two voltage at the same time by using for loop ?

    Hello, Can anyone help me on this topic ?
    My problem is to sweep Vds and Vgs as same time vs Id in MOSFET by using for loop. I also use the Agilent power supply source. Let me tell a litle bit about what i'm doing. For different value of Vds, i will get Vgs vs Id curve. (The x axis is Vgs, the y-axis is Id).
    I started to create two for-loop, the inner to sweep Vgs, and the outer one to sweep Vds. My problem is don't know how to connect all the wire in  the for loop.
    In the for loop i saw N, i icon. Suppose I have the two variable for Vgs such as Vgs start and Vgs_stop. Should the Vgs_start( or Vgs_stop) be connected to N or leave it in the for_loop ?
     for example: I want to sweep Vgs from 0(for Vgs_start)  to  5(Vgs_strop) V, and the step increment is .5V how do i connect these variables in the for loop ?
    Thank you for your time
    Ti Nguyen

    It is easier to use a while loop.  Dennis beat me to the punch.  Here is my solution:
    You can remove the flat sequence structure if you use Error In and Error Out to ensure the execution flow will occur in the proper order.  Be sure to include the delay time in the loop so that your vi doesn't hog all the CPU time.
    Message Edited by tbob on 10-17-2005 01:00 PM
    - tbob
    Inventor of the WORM Global
    Attachments:
    RampVoltage.PNG ‏8 KB

  • Need help with a For loop that uses a Break statement

    I need to create a for loop which counts down from 100-50 and divides the number being counted down by a counter. Can anyone help me?
    public class Break
    public static void main ( String args []) (;
         int total = 0
         int counter = 0
         for { (int number = 100; total >=50; total --)
         if (counter == 0)
         break;
         } // end of for loop
         int output = number/counter
         system.out.printf("The number is" %d output/n)
         }// end of method main
    }// end of class Break

    Im sorry I didnt explain myself very well i do not need the break statement at all.
    I now have this code:
    public class BreakTest
       public static void main( String args[] )
          int count; // control variable also used after loop terminates
         for (int i = 100; i >= 50; i = ++count)
       if (i >= 50) {
        continue;
          System.out.printf( "\nBroke out of loop at count = %d\n", count );
       } // end main
    } // end class BreakTest
    /code]
    and i get these error messages:
    F:\csc148>javac BreakTest.java
    BreakTest.java:9: variable count might not have been initialized
         for (int i = 100; i >= 50; i = ++count)
                                          ^
    BreakTest.java:15: variable count might not have been initialized
          System.out.printf( "\nBroke out of loop at count = %d\n", count );
                                                                    ^
    2 errors                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Please help with the FOR loop and the array..

    I was trying to place some words in the Movie Clip
    "TextPanel" and set a
    random position to each of them.
    But it's not working.
    1) I created a Movie Clip "word" and inside that MC I created
    a text field
    and gave it an identifier "textFiled".
    2) The linkage name for Movie Clip "word" I set to "word".
    3) In the actionscript I created an Array called "aWords".
    4) Then I created a FOR loop that should
    place (attach) Movie Clips "word0", "word1", "word2" and
    "word3" to the
    movie clip TextPanel, and set the textField text for each of
    them to the
    text from the Array.
    But the script attaches 4 Movie Clips with a name
    "Undefined", instead of 4
    different names (from the Array).
    What is wrong with this script?
    var aWords:Array = [apple,banana,orange,mango];
    for(i=0;i<aWords.length;i++){
    var v = TextPanel.attachMovie("word","word"+i,i);
    v.textFiled.text = aWords
    v._x = randomNumber(0,Stage.width);
    v._y = randomNumber(0,Stage.height);
    Thanks in advance

    But in my Post I already wrote v.textFiled.text = aWords
    so I don't understand what were you correcting..
    And one more:
    I have tested it by changing the
    v.textFiled.text = aWords; to v.textFiled.text = "some
    word";
    and it's working fine.
    So there is something wrong with the Array element, and I
    don't know why..
    "aniebel" <[email protected]> wrote in
    message
    news:ft2d5k$lld$[email protected]..
    > Change:
    > v.textFiled.text = aWords;
    >
    > to:
    > v.textFiled.text = aWords
    >
    > It needs to know which element inside the array you want
    to place in the
    > textfield (or textfiled) :)
    >
    > If that doesn't work, double check that your instance
    name is correct
    > inside
    > of "word".
    >

  • Need help with a for loop - string checking

    I am trying to create a for loop to make sure a user entered string contains only letters but something doesn't take. No errors, but the inner loop of try again doesn't ever come into play. What am I missing please.
         String k = keyboard.nextLine();
         for (int i = 0; i < k.length(); i++)
              char c = k.charAt(i);
              int m = c; 
              if (((m < 97) && (m > 122)) || ((m < 65) && (m > 90)))
                        System.out.print("Try again please: ");
                        k = keyboard.nextLine();
    System.out.println(k);

    molested,
    (you and BigDaddyLoveHandles should get on well)
    I would use regular expression for that... which would look something like this...
    // get response containing at least one letter.
    while (true) {
      String response = keyboard.nextLine();
      if( response.matches("[a-zA-Z]+") ) break;
      System.out.print("Try again please: ");
    }Message was edited by: corlettk - frog got the {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • My for loop pauses after completion of the prescribed number of loops.

    I've created a FOR loop to alternate the value of an analog output between two setpoints. Since there are only 2 setpoints there need only be 2 complete 'loops'. After these two loops are complete the program pauses before continuing restarting the loop. I used the FOR loop instead of a WHILE loop because I use the value of the loop number to change the value of the output.

    Maybe you are initializing DAQ before the For Loop executes or you have a Wait timer outside of your For Loop.

  • Variable not defined after running for() loop.

    Hi,
    I have a little problem, I have created a for loop, which seems to work, except that a variable within the for() loop gets lost, because if I try to call the variable after the loop, it says it's not there. anyway, here is my code, followed by the error. Thanks!
    <%
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:testdb");
    Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    String sql_count = "SELECT COUNT(*) FROM users";
    ResultSet cn = stmt.executeQuery(sql_count);
    cn.first();
    int row_count = cn.getInt(1);
    int num = (int)(Math.random() * (row_count));
    int inum;
    for (inum=0; inum<row_count; inum++)
    int jnum = inum + num;
    if (jnum >= row_count) { jnum = 1; }
    String sql = "SELECT * FROM users WHERE ID = "+jnum+"";
    ResultSet rs = stmt.executeQuery(sql);
    int ce = rs.getInt("cr_earned");
    int cu = rs.getInt("cr_used");
    if ((ce-cu) > 0) { inum = row_count + 1; }
    String sql = "SELECT * FROM users WHERE ID = "+jnum+"";
    ResultSet rs = stmt.executeQuery(sql);
    rs.first();
    String url = rs.getString("url");
    con.close();
    %>
    ***********************ERROR***********************
    Generated servlet error:
    C:\tomcat\jakarta-tomcat-4.0\work\localhost\examples\gtt\surf$jsp.java:93: Undefined variable or class name: rs
    rs.first();
    ^
    An error occurred between lines: 17 and 43 in the jsp file: /gtt/surf.jsp
    Generated servlet error:
    C:\tomcat\jakarta-tomcat-4.0\work\localhost\examples\gtt\surf$jsp.java:94: Undefined variable or class name: rs
    String url = rs.getString("url");
    ^

    now i've defined them all before the loop and I get this error. Error is following modified code below.
    <%
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:testdb");
    Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    String sql_count = "SELECT COUNT(*) FROM users";
    ResultSet cn = stmt.executeQuery(sql_count);
    cn.first();
    int row_count = cn.getInt(1);
    int num = (int)(Math.random() * (row_count));
    int inum;
    int jnum;
    ResultSet rs;
    for (inum=0; inum<row_count; inum++)
    jnum = inum + num;
    if (jnum >= row_count) { jnum = 1; }
    String sql = "SELECT * FROM users WHERE ID = "+jnum+"";
    rs = stmt.executeQuery(sql);
    int ce = rs.getInt("cr_earned");
    int cu = rs.getInt("cr_used");
    if ((ce-cu) > 0) { inum = row_count + 1; }
    rs.first();
    String url = rs.getString("url");
    con.close();
    %>
    ***********ERROR***************
    An error occurred between lines: 17 and 45 in the jsp file: /gtt/surf.jsp
    Generated servlet error:
    C:\tomcat\jakarta-tomcat-4.0\work\localhost\examples\gtt\surf$jsp.java:95: Variable rs may not have been initialized.
    rs.first();
    ^
    Thanks anyone.... ;-)

  • What are the "Add to Loop Library" requirements for creating automatically conforming loops?

    I am trying to create my own loops that conform to the tempo and key of a song. I have made several loops in this way by selecting a region that is exactly 4 bars, for example, and then selecting "Add to Loop Library". If the sample is cut correctly, the "Type:" field is enabled which allows you to make it a Loop and therefore have it automatically conform to the song tempo.
    In the past I have made loops that were very long, up to 128 beats, for the purpose of making mashups using instrumental tracks that I want to conform to the song. I now can't seem to create a large loop but I am not sure why. I know it is possible, but I don't know the steps I took to get there.
    What are the exact requirements that allow a loop to be added to the loop library while also conforming to song key and tempo?

    In the past I have made loops that were very long, up to 128 beats
    The longest loop I managed to save as "Loop" had 55 measures (220 beats, 203 bpm). Longer loops could only be saved as "One shot". And the loop had to be cut at the end, not simply be trimmed by dragging the end of the region. The tempo matters; for a slow song the loop can only have fewer measures.

  • Email notification for user created through reconciliation in OIM

    Hi..
    I have done the following configurations for email notification when user is created through reconciliation in OIM
    Configuring IT Resource     
    Name     Email Server
         Type      Mail Server
         Authentication     FALSE
         Server Name     *.*.*.*
         Username     
         Password     
    Creating email definition with the following values     
    Name     Create User Email Notification
         Type     Provisioning Related
         Language     en
         Region     US
         Object Name     Xellerate User
         Process name     Xellerate User
         From     User
         User Login     Xelsysadm
         Subject      User Created
    Add Email notification in a new process task with name Notify     
    Process definition     Xellerate User
         Task     Notify
         Disable Manual Insert     Enable
         Required for Completion     Enable
         Allow Cancellation while Pending     Enable
         Handler Name     tcComplete Task
         Assignment Rule     Default
         Target Type     User
         User     Xelsysadm
         Email name     Create User Email Notification
         Send Email     Enable
         Notification Assignee     Enable
         Email      Create User Email Notification
         Status     Completed
    Xelsysadm has a valid email id. Now when I am reconciling any user, two mail notifications are being sent. Not able to know from where these two notifications are being triggered.
    Am i suppose to make any changes in the configurations?
    Edited by: Amruta Agarwal on Sep 28, 2011 4:21 AM

    Sorry re-read your issue again. I believe there are two notifications because you have added your notify task in the process definition and OIM OOTB sends a notification when a user is recon'd. Thus remove your task or disable the OOTB notification. The property is Recon.SEND_NOTIFICATION
    HTH,
    BB
    Edited by: bbagaria on Oct 7, 2011 9:13 AM

  • For loop to iterate through temp table in store procedure in pl/sql

    Hi,
    how to create For loop to iterate through the temporary table in the store procedure?

    Neha RK wrote:
    hi,
    its not working , i need to check each record of table and do some task using if else loop inside that for..
    if not possible to loop each row of table using for then how to use while loop.
    please helpWhat's not working? We haven't got psychic powers so we can't see the code you say isn't working.
    Please provide more information like create table statements, insert statements with test data, the code you've tried
    and the output you are expecting from the input data.
    Read {message:id=9360002} and follow the advice there.

  • Creating a function with  a for loop and %type

    Hello,
    I am trying to create a function which contains a for loop as well as %type.
    This function is on a student table and i am trying to create a function which will display the zip which is a varchar2(5).
    I need to do this through this function.
    However, I can't seem to get it running.
    Can anyone help?
    below is what i tried as well as other options and was not successful.
    I also displayed my error with the show error command.
    SQL> create or replace function zip_exist
    2 return varchar2
    3 is
    4 v_zip student.zip%TYPE;
    5 cursor c_zip is
    6 select zip
    7 from
    8 student
    9 where zip=zip;
    10 begin
    11 open c_zip;
    12 v_zip IN c_zip
    13 loop
    14 v_zip:=c_zip%TYPE;
    15 end loop;
    16 close c_zip;
    17 end;
    18 /
    Warning: Function created with compilation errors.
    SQL> show error
    Errors for FUNCTION ZIP_EXIST:
    LINE/COL ERROR
    12/7 PLS-00103: Encountered the symbol "IN" when expecting one of the
    following:
    := . ( @ % ;
    16/1 PLS-00103: Encountered the symbol "CLOSE"
    SQL>
    kabrajo

    user10873577 wrote:
    Hello,
    I am trying to create a function which contains a for loop as well as %type.
    This function is on a student table and i am trying to create a function which will display the zip which is a varchar2(5).
    I need to do this through this function.
    However, I can't seem to get it running.
    Can anyone help?
    below is what i tried as well as other options and was not successful.
    I also displayed my error with the show error command.
    SQL> create or replace function zip_exist
    2 return varchar2
    3 is
    4 v_zip student.zip%TYPE;
    5 cursor c_zip is
    6 select zip
    7 from
    8 student
    9 where zip=zip;
    10 begin
    11 open c_zip;
    12 v_zip IN c_zip
    13 loop
    14 v_zip:=c_zip%TYPE;
    15 end loop;
    16 close c_zip;
    17 end;
    18 /
    Warning: Function created with compilation errors.
    SQL> show error
    Errors for FUNCTION ZIP_EXIST:
    LINE/COL ERROR
    12/7 PLS-00103: Encountered the symbol "IN" when expecting one of the
    following:
    := . ( @ % ;
    16/1 PLS-00103: Encountered the symbol "CLOSE"
    SQL>
    kabrajoTry This
    Create a sample table
    SQL> create table student(id number(10),zip varchar2(5));
    Table created.Insert the record
    SQL> insert into student values(1111,'A5454');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from student;
            ID ZIP
          1111 A5454
    SQL> create or replace function zip_exist(v_id number)
      2   return varchar2
      3   is
      4   v_zip student.zip%TYPE;
      5  BEGIN
      6   select zip
      7   INTO v_zip
      8   FROM student
      9   where id=v_id;
    10   Return v_zip;
    11  EXCEPTION WHEN NO_DATA_FOUND THEN
    12                  RETURN 'INVALD';
    13  WHEN OTHERS THEN
    14                 return  'NA!';
    15   end;
    16  /
    Function created.
    SQL> set serveroutput on
    SQL> select zip_exist(1111) from dual;
    ZIP_EXIST(1111)
    A5454
    SQL> select zip_exist(2222) from dual;
    ZIP_EXIST(2222)
    INVALDHope this helps
    Regards,
    Achyut K

  • Workflow fails when page is created through the CreatePublishingPageDialog.aspx. The settings for this list have been recently changed.

    Hi,
    I've created a content type and attached a workflow to it so when I create a publishing page the workflow should run.
    My Page creation is based on the "_layouts/15/CreatePublishingPageDialog.aspx" page in order to be allowed to fill in the required fields on item creation (so I don't have to go to the page afterwards and choose "edit properties").
    On my page library I have "Require content approval for submitted items" and "Require documents to be checked out before they can be edited?" set to YES.
    This design has worked fine before I added my workflow. However now when I click save or check in/publish I get the below error. My guess is that the workflow starts (and blocks) right after I fill in the filename and click next in the "CreatePublishingPageDialog.aspx"
    step to go to the required fields.
    If I go back to my page after I receive the error below I can edit the required properties again and then publish the page correctly.
    How do I avoid this? thank you
    My pages are created through
    Checking the ULS log I get this error:
    Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Microsoft.SharePoint.SPException: The settings for this list have been recently changed. Refresh
    your browser before editing this list.   
    at Microsoft.SharePoint.WebControls.BaseFieldControl.OnLoad(EventArgs e)   
    at System.Web.UI.Control.LoadRecursive()   
    at System.Web.UI.Control.LoadRecursive()   
    at System.Web.UI.Control.LoadRecursive()   
    at System.Web.UI.Control.LoadRecursive()   
    at System.Web.UI.Control.LoadRecursive()   
    at System.Web.UI.Control.LoadRecursive()   
    at System.Web.UI.Control.LoadRecursive()   
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)   
    at System.Web.UI.Page.HandleError(Exception e)   
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)   
    at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)   
    at System.Web.UI.Page.ProcessRequest()   
    at System.Web.UI.Page.ProcessRequest(HttpContext context)   
    at Microsoft.SharePoint.Publishing.TemplateRedirectionPage.ProcessRequest(HttpContext context)   
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()   
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    Hi Jan,
    Thanks for posting this issue, Kindly try out with the hot fixes provided in the below mentioned URLS
    https://support.microsoft.com/kb/2536591?wa=wsignin1.0
    http://elblanco.codeplex.com/releases/view/6856
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

Maybe you are looking for

  • Digital Signatures / Custom Signature Logo

    Good morning - I'm getting quickly acclimated to the concept of digital signatures as my employer is stiving towards a paperless office.  I have several questions that have come up, but I'll start with (hopefully) an easy one: When a digital signatur

  • Stocks not updating

    Since upgrading to 3.0, the stock app will not update my prices. It just clocks. Is this related to 3.0 or is the market just having a bad day?

  • CoreData.pdf - corrupt PDF on Apple's site?

    I'm attempting to download the PDF version of Apple's Core Data programming guide at the following URL: http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/CoreDat a/CoreData.pdf It appears that this PDF file is either truncated

  • Can't send Garageband ringtones to iTunes

    I can create ringtones with Garageband on my Macbook Pro, but on my 2013 iMac, when I send to iTunes, nothing happens. Any ideas on why that might be?Can

  • Does "What's This?" Help still exist?

    Does anyone know whether RoboHelp 7 still includes "What's This?" Help for creating context-sensitive help? In RoboHelp Office X5, this application was called Whatsths.exe. I will upgrade my license if it's still there.