Combo box in multi level block

Hi,
I am facing one pbm with combo box. I will explain my scenario. Pl help me.
In new-form-instance-trigger,
opening cursor for fetching item1, item2 from table1; - C1
opening cursor for fetching item3 from table1 based on item1--C2
begin
open the loop loop1 in C1 and assigning values item1,item2 in the block
opening loop2 in C2 and adding item3 into combo box.
close loop2
close loop1
end
--here whatever value is added in combo box, is getting repeated in all the combo boxes. For eg, item 1 value is  'priya' and item3 values are i1,i2 and i3 for 'priya'
for item 1 value 'arthi' item3 values are i4 and i5.
After running, all the values i1,i2,i3,i4 and i5 is fetched in combobox regardless of item1 values.
so for 'priya' all 5 are displayed in combo. similar case for 'arthi' also.
Any suggestions/help??
Regards
Priya

I wish to populate like this
priya|| i1/i2/i3 in combobox
arthi||i4/i5in combobox
Now, all the values from i1 to i5 are displayed in combo for the value "priya".
Hope u undertood my requirement.
regards
priya

Similar Messages

  • Creating "Control Combo Box " Relation with data block

    Hi all dears
    i am switching from C# to oracle developer for joining gulf net software house, i have a problem regarding master detail data
    the senerio is
    "List items" control Filled programatically as under shortly:-
    rg_id := create_group_from_query('myrg', 'select dname a, dname b from dept');
    populate_group(rg_id);
    populate_list('mylist', rg_id);
    using this i fill my combo box during new form instance trigger
    i have created a datablock emp through wizard which can show 10 record.
    now
    Problem 1
    i want to show records on form when user select any dept from combo box.
    Problem 2
    if i create group from query and in select statement is like this "select dname, dpetno from dept" the record group is created successfully but i am unable to populate_list due to different data type colums in record group how i will populate list so that List items Labels are department name and value is department no
    Thanks in advance for persual

    Hi dears all
    I have solved this problem my self
    1. select dept name form combo box and the data block shows the emp's of concern depat
    solution
    create a data block of emp table through wizard
    create its table view and show 10 records
    go to datablock i consider its name "emp" datablock properties
    in Where clause condition specify deptno = : my_combo_box;
    now go to combo box when item changed event
    go_bolck("emp);
    execute_query;

  • How can I create a multi-line combo box?

    I am using Adobe Acrobat Pro 9 and I am trying to create a multi-line combo box on my fillable form.  At the bottom of this form/letter I would like to have a several paragraps that the user can choose from, but it's only allowing me to enter one line at a time.  Any help??

    Hi, Did you find the answer to this? I'm looking to create a combo box with multi-lines

  • Check box in a multi record block

    I have a multi record block that has a check box. I need to be able to go to the first record on the block, go through each row and check to see if it's selected. I will then get all the rows that were selected and passed it as a parameter in a package.I have already declared a global variable in the package to get all the rows selected.
    Can anyone please help.

    Hi
    This is my solution for your problem. If I understand correctly as you have to post the selected records from form to journal entry (a server operation). What you need to do is in your Oracle Forms multi record block construct a loop which goes from first record to last record of your data block, capture the selected records (wherever the check box is CHECKED ON) into a PL/SQL table structure (PL/SQL table is quite simillar to Oracle Forms RECORD GROUP structure, but more versatile as it can be recognized on the back end too).
    Once you populate the PL/SQL table with the selected record, pass the PL/SQL table itself as parameter to your package.
    Open the PL/SQL table in your destination code and do further processing with those selected records !!
    Hope this will work !!
    MOHAMMED R.QURASHI
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by kay:
    I CANNOT USE A RECORD GROUP. I HAVE TO EVENTUALLY POST THE SELECTED ROWS INTO JOURNAL ENTRIES. I STILL NEED TO BE ABLE TO
    GET ALL THE ROWS SELECTED BY THE USER.CAN I USE A CURSOR IN THE FORM TO GET ALL THE ROWS
    SELECTED?.
    THANKS FOR THE REPLY GANESAN.<HR></BLOCKQUOTE>
    null

  • Determine the best width for ListCellRenderer - Multi-column combo box

    Currently, I am having a multi column combo box. In order for the column to align properly during show popup, I use box layout to do so. However, the short coming for box layout is that, the size for each column is fixed. This makes me have a difficulty, when I have a long string to be displayed. The problem is shown through the following screen shoot.
    http://i.imgur.com/4Nfc6.png
    This is because in 2nd column,
    1) All the 3 rows must be in same size so that they are aligned.
    2) But 1st row and 2nd row cell renderer, do not know 3rd row is holding such a long string.
    The code (2 files) to demo this problem is as follow. Is there any way the size of the cell will be adjusted automatically? Yet, all the row will be aligned properly.
    ResultSetCellRenderer.java
    package javaapplication24;
    import java.awt.Color;
    import java.awt.Component;
    import javaapplication24.NewJFrame.ResultType;
    import javax.swing.JList;
    import javax.swing.ListCellRenderer;
    import javax.swing.UIManager;
    * @author yccheok
    public class ResultSetCellRenderer extends javax.swing.JPanel implements ListCellRenderer {
        /** Creates new form ResultSetCellRenderer */
        public ResultSetCellRenderer() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.X_AXIS));
            jLabel1.setText("jLabel1");
            jLabel1.setMaximumSize(new java.awt.Dimension(88, 14));
            jLabel1.setMinimumSize(new java.awt.Dimension(88, 14));
            jLabel1.setPreferredSize(new java.awt.Dimension(88, 14));
            add(jLabel1);
            jLabel2.setText("jLabel2");
            jLabel2.setMaximumSize(new java.awt.Dimension(100, 14));
            jLabel2.setMinimumSize(new java.awt.Dimension(200, 14));
            jLabel2.setPreferredSize(new java.awt.Dimension(100, 14));
            add(jLabel2);
        }// </editor-fold>
        // Variables declaration - do not modify
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel2;
        // End of variables declaration
        // Do not use static, so that our on-the-fly look n feel change will work.
        private final Color cfc  = UIManager.getColor("ComboBox.foreground");
        private final Color cbc  = UIManager.getColor("ComboBox.background");
        private final Color csfc = UIManager.getColor("ComboBox.selectionForeground");
        private final Color csbc = UIManager.getColor("ComboBox.selectionBackground");
        private final Color cdfc = UIManager.getColor("ComboBox.disabledForeground");
        // For Nimbus look n feel.
        private final Color nimbus_csfc;
             Color c = UIManager.getColor("ComboBox:\"ComboBox.renderer\"[Selected].textForeground");
             // Pretty interesting. Applying "c" directly on the component will not
             // work. I have the create a new instance of Color based on "c" to make
             // it works.
             nimbus_csfc = c != null ? new Color(c.getRed(), c.getGreen(), c.getBlue()) : null;
        private final Color nimbus_csbc;
            Color c = UIManager.getColor("ComboBox:\"ComboBox.renderer\"[Selected].background");
             // Pretty interesting. Applying "c" directly on the component will not
             // work. I have the create a new instance of Color based on "c" to make
             // it works.
            nimbus_csbc = c != null ? new Color(c.getRed(), c.getGreen(), c.getBlue()) : null;
        @Override
        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
            final Color _csbc = csbc != null ? csbc : nimbus_csbc;
            final Color _csfc = csfc != null ? csfc : nimbus_csfc;
            this.setBackground(isSelected ? _csbc : cbc);
            this.setForeground(isSelected ? _csfc : cfc);
            jLabel1.setBackground(isSelected ? _csbc : cbc);
            jLabel1.setForeground(isSelected ? _csfc : cfc);
            jLabel2.setBackground(isSelected ? _csbc : cbc);
            jLabel2.setForeground(isSelected ? _csfc : cfc);
            final ResultType result = (ResultType)value;
            jLabel1.setText(result.symbol);
            jLabel2.setText(result.name);
            return this;
    NewJFrame.java
    package javaapplication24;
    import java.awt.Container;
    import java.awt.Dimension;
    import javax.swing.JComboBox;
    import javax.swing.JList;
    import javax.swing.JScrollBar;
    import javax.swing.JScrollPane;
    import javax.swing.SwingUtilities;
    import javax.swing.event.PopupMenuEvent;
    import javax.swing.event.PopupMenuListener;
    import javax.swing.plaf.basic.BasicComboPopup;
    * @author yccheok
    public class NewJFrame extends javax.swing.JFrame {
        public static class ResultType {
             * The symbol.
            public final String symbol;
             * The name.
            public final String name;
            public ResultType(String symbol, String name) {
                this.symbol = symbol;
                this.name = name;
            @Override
            public String toString() {
                return symbol;
        /** Creates new form NewJFrame */
        public NewJFrame() {
            initComponents();
            this.jComboBox1.addPopupMenuListener(this.getPopupMenuListener());
            this.jComboBox1.setRenderer(new ResultSetCellRenderer());
            this.jComboBox1.addItem(new ResultType("Number 1", "Normal"));
            this.jComboBox1.addItem(new ResultType("Number 2", "Normal"));
            this.jComboBox1.addItem(new ResultType("Number 3", "A VERY VERY VERY VERY long text"));
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            jComboBox1 = new javax.swing.JComboBox();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
            jComboBox1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jComboBox1ActionPerformed(evt);
            getContentPane().add(jComboBox1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 110, -1));
            pack();
        }// </editor-fold>
        private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {
            // TODO add your handling code here:
        * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                @Override
                public void run() {
                    final NewJFrame frame = new NewJFrame();
                    frame.setVisible(true);
        private PopupMenuListener getPopupMenuListener() {
            return new PopupMenuListener() {
                @Override
                public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
                    // We will have a much wider drop down list.
                    adjustPopupWidth(jComboBox1);
                @Override
                public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
                @Override
                public void popupMenuCanceled(PopupMenuEvent e) {
         * Adjust popup for combo box, so that horizontal scrollbar will not display.
         * Resize JComboBox dropdown doesn't work without customized ListCellRenderer
         * http://www.camick.com/java/source/BoundsPopupMenuListener.java
         * @param comboBox The combo box
        public static void adjustPopupWidth(JComboBox comboBox) {
            if (comboBox.getItemCount() == 0) return;
            Object comp = comboBox.getAccessibleContext().getAccessibleChild(0);
            if (!(comp instanceof BasicComboPopup)) {
                return;
            BasicComboPopup popup = (BasicComboPopup)comp;
            JList list = popup.getList();
            JScrollPane scrollPane = getScrollPane(popup);
            // Just to be paranoid enough.
            if (list == null || scrollPane == null) {
                return;
            //  Determine the maximimum width to use:
            //  a) determine the popup preferred width
            //  b) ensure width is not less than the scroll pane width
            int popupWidth = list.getPreferredSize().width
                            + 5  // make sure horizontal scrollbar doesn't appear
                            + getScrollBarWidth(popup, scrollPane);
            Dimension scrollPaneSize = scrollPane.getPreferredSize();
            popupWidth = Math.max(popupWidth, scrollPaneSize.width);
            //  Adjust the width
            scrollPaneSize.width = popupWidth;
            scrollPane.setPreferredSize(scrollPaneSize);
            scrollPane.setMaximumSize(scrollPaneSize);
         *  I can't find any property on the scrollBar to determine if it will be
         *  displayed or not so use brute force to determine this.
        private static int getScrollBarWidth(BasicComboPopup popup, JScrollPane scrollPane) {
            int scrollBarWidth = 0;
            JComboBox comboBox = (JComboBox)popup.getInvoker();
            if (comboBox.getItemCount() > comboBox.getMaximumRowCount()) {
                JScrollBar vertical = scrollPane.getVerticalScrollBar();
                scrollBarWidth = vertical.getPreferredSize().width;
            return scrollBarWidth;
         *  Get the scroll pane used by the popup so its bounds can be adjusted
        private static JScrollPane getScrollPane(BasicComboPopup popup) {
            JList list = popup.getList();
            Container c = SwingUtilities.getAncestorOfClass(JScrollPane.class, list);
            return (JScrollPane)c;
        // Variables declaration - do not modify
        private javax.swing.JComboBox jComboBox1;
        // End of variables declaration
    }Edited by: yccheok on Jan 13, 2011 9:35 AM

    Are these two lines intentionally or is it just a mismatch?
    jLabel2.setMaximumSize(new java.awt.Dimension(100, 14));
    jLabel2.setMinimumSize(new java.awt.Dimension(200, 14));
    2) But 1st row and 2nd row cell renderer, do not know 3rd row is holding such a long string.There is only one cell renderer for all rows, so no need for the rows to know each other.
    To calculate the exact maximum width of column two, you have to check each entry.
    If you can do this BEFORE creating the combo, you could do this in a loop similar to this pseudo code
    FontMetrics fm= jComboBox1.getFontMetrics(jComboBox1.getFont());
    foreach (column2String) {
      int length= fm.stringWidth(column2String);
      if (length>max) max= length;
    }Now you have a max value to dimension jLabel2 in your renderer.
    If you don't fill your combo in one go, but rather at runtime, you have to check at each
    jComboBox1.addItem(...)
    whether the string for label2 is extending the current max, redefine max, and repaint the combo.
    This second approach I haven't done so far, but that's how I would try.

  • HOW TO MAKE CHECK BOXES EXCLUSIVE IN MULTI ROW BLOCK

    Hi,
    I have a multi row block with one item as check box.It is
    required that at a time only one record can be marked as
    selected through this item. If user marks a record as selected
    the previous selected record should be marked as deselected.
    How i can make these check boxes mutually exclusive ?
    can anybody help me?
    Thanks in Adv
    Sharath.
    null

    SHARATH (guest) wrote:
    : Hi,
    : I have a multi row block with one item as check box.It is
    : required that at a time only one record can be marked as
    : selected through this item. If user marks a record as selected
    : the previous selected record should be marked as deselected.
    : How i can make these check boxes mutually exclusive ?
    : can anybody help me?
    : Thanks in Adv
    : Sharath.
    Hi
    The check box can not be mutually exclusive.
    This is a basic functionality.
    You convert this item type into radio button.
    It will satisfy your requirements.
    Jeya Raman R
    null

  • URGENT HELP PLS :  Issue with Multi Level Master Detail block

    This is an issue someone else had posted in this forum few years back but there was no solution mentioned, I have run into this same issue , The problem is as explained below.
    Any help on this is appreciated.
    Scenario:
    There are 3 Blocks in the form : A (Master Block)
    : B (Detail of A )
    : C (Detail of B )
    There is master detail relation created between A and B and B and C. So initially when we query for a record in Master A, it shows all records properly in B and C.
    Now if i navigate to the first record of B , and then second record of B , records corresponding to that record shows up properly in C block.
    Till now everything works fine.
    Issue 1:
    But in case after querying initially on Master Block A,If I go directly to the second record of B block, it clears the whole B block and C block.
    Issue 2:
    Same thing happens if I am on C block ( corresponding to second record of B block) and then navigate to first record in B block , it again clears the whole B block and C block.
    Please Help !!
    Thanks !

    Thanks Xem for Your reply , I tried those settings but it did not help..here is the original link that to the thread that talks about the same problem ,
    Issue with Multi Level Master Detail block
    The last update to this was the following :
    "I figured out that this is happening because Block Status is set to 'Changed' and this is causing it to clear out the blocks.
    But cant figure out why the status is setting to 'Changed' "
    Any Help from the form Gurus on this form in this matter is truely appreicated !!
    Thanks,
    Zid.

  • Combo Box Edits in acrobat Forms, how to do a multi-line combo box?

    Could only create a one-liners for this editable combo box, is there a way to create a multi-line like the other fields?

    Nope. But you can set up a multiline text field that gets populated with the complete text you want when an item is selected from a combo box.The combo box items might be abbreviated or coded versions of the complete text you want to display.

  • Record level commit in a multi record block

    Dear all,
    i have a multi record block in my form (only one block)
    after entring record the save buttons commites the form
    if any error is raised then total commit processs stop for example if DUP_VAL_ON_INDEX is raised
    what i want is that the form shoud act record level,i.e; it should commit record wise so that though a excepton is raised atleast record above that are commited.
    thank U
    Raj
    mail : [email protected]

    you can have non-database block and write "insert into <table>" statements for each row of block at when-button-pressed of 'commit' button. Commit after each row insertion. This will serve your purpose.

  • Add a Drop down menu / Combo Box into a specified cell of a multi column lsit box

    Hello,
    i have a question how to manipulate a cell of a multi column list box in that way that i can add a drop down menu or a combo box in this cell?
    Is this possible in LabView?
    Thank you!

    Wow, I took a look at the alternate code posted here at that really takes you through gyration (also a similiar comment I see on Lava) to perform what I've done with a few functions....
    See the Pics and attached VI for how its done. KISS, I added an event stucture and changed my first enum case to " " (i.e. a blank) to make it look like the other posted code....
    Attachments:
    DropDownMenuInABox.vi ‏18 KB
    DropDownMenuInABox_FP.PNG ‏18 KB
    DropDownMenuInABox_BD.PNG ‏36 KB

  • Mult-Column Combo Box

    Hellow
    Dose anybody know how to manipulate Multi-Column Combo box in Forms 6i. for more details check this link. http://home.component1.com/img/flex7screen.jpg
    If somebody could do it before .. then please just give me some info.
    Regards
    Tariq
    null

    populate list using record group & create record group using query having multiple columns merged together through concatenatio.
    Ahmer

  • Needs multi column dynamic combo box using C#

    I need a dynamic Combo box to display multi columns on Drop Down Event 
    such as Stock Code, Make, Model,Sub Model, Measurement Type and so on for  my C# Application with Columns Headers 
    Please Help Me
    Thanks in Advance

    You should create a class that represents your model and then you could use a CompositeCollection as the ItemsSource of the ComboBox.
    Here is an example for you:
    namespace WpfApplication59
    public class YourModel
    public string StockCode { get; set; }
    public string Model { get; set; }
    //+ the rest of your properties
    MainWindow.xaml.cs:
    public partial class MainWindow : Window
    public MainWindow()
    InitializeComponent();
    List<YourModel> models = new List<YourModel>();
    models.Add(new YourModel() { Model = "m1", StockCode ="c1"});
    models.Add(new YourModel() { Model = "m2", StockCode = "c2" });
    cb.ItemsSource = models;
    MainWindow.xaml:
    <ComboBox x:Name="cb" Grid.IsSharedSizeScope="True" ItemsSource="{DynamicResource items}"
    xmlns:local="clr-namespace:WpfApplication59">
    <ComboBox.Resources>
    <CompositeCollection x:Key="items">
    <ComboBoxItem IsEnabled="False">
    <Grid TextElement.FontWeight="Bold">
    <Grid.ColumnDefinitions>
    <ColumnDefinition SharedSizeGroup="A"/>
    <ColumnDefinition Width="5"/>
    <ColumnDefinition SharedSizeGroup="B"/>
    </Grid.ColumnDefinitions>
    <Grid.Children>
    <TextBlock Grid.Column="0" Text="Model"/>
    <TextBlock Grid.Column="2" Text="Stock Code"/>
    </Grid.Children>
    </Grid>
    </ComboBoxItem>
    <Separator/>
    <CollectionContainer Collection="{Binding Source={x:Reference cb}, Path=DataContext}"/>
    </CompositeCollection>
    <DataTemplate DataType="{x:Type local:YourModel}">
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition SharedSizeGroup="A"/>
    <ColumnDefinition Width="5"/>
    <ColumnDefinition SharedSizeGroup="B"/>
    </Grid.ColumnDefinitions>
    <Grid.Children>
    <TextBlock Grid.Column="0" Text="{Binding Model}"/>
    <TextBlock Grid.Column="2" Text="{Binding StockCode}"/>
    </Grid.Children>
    </Grid>
    </DataTemplate>
    </ComboBox.Resources>
    </ComboBox>
    You could restyle the the templates (Grids) as per your requirements.
    Please remember to mark helpful posts as answer to close your threads and then start a new thread if you have a new question.

  • How to populate the combo boxes that are created dynamically in jsp

    Hi,
    I am using JSP.
    I am creating combo boxes dynamically (based on the num selected by the user). These dynamically created combo boxes need to have A-Z as options (each box) . Now, when the user chooses the option A in any of the combo-boxes,the rest should not have this option. so on..
    how do i achieve this.Kindly help.

    You'll need to use JavaScript...I have a complicated example and a simple example, however, I cannot really understand the complex example but I know how it works. The looping is too complex for me.
    First you'll need to populate a server side variable...depending on how often the data is updated you may want this to run each time a new session is created...this example is run each time Tomcat is started and the application context is initialized:
    package kms.web;
    // Servlet imports
    import javax.servlet.ServletContextListener;
    import javax.servlet.ServletContextEvent;
    import javax.servlet.ServletContext;
    // utility imports
    import java.util.Map;
    // domain imports
    import kms.domain.LocationService;
    import kms.domain.DeptService;
    import kms.domain.PatentService;
    * This listenter is used to initialize
    * the Maps of Locations, Patents & Depts used to populate
    * pulldown lists in JSPs
    public class InitializeData implements ServletContextListener {
        * This method creates the Maps.
       public void contextInitialized(ServletContextEvent sce) {
          ServletContext context = sce.getServletContext();
          LocationService lServ = new LocationService();
          // Create the Maps
          Map campuses = lServ.getCampuses();
          Map buildings = lServ.getBuildings();
          Map floors = lServ.getFloors();
          Map locs = lServ.getLocations();
          // And store them in the "context" (application) scope
          context.setAttribute("campuses", campuses);
          context.setAttribute("buildings", buildings);
          context.setAttribute("floors", floors);
          context.setAttribute("locs", locs);
          DeptService dServ = new DeptService();
          Map depts = dServ.getDepts();
          context.setAttribute("depts", depts);
          PatentService pServ = new PatentService();
          Map patents = pServ.getPatents();
          context.setAttribute("patents", patents);
          //I did this one myself
    /*    CodeService cServ = new CodeService();
          Map masterMks = cServ.getCodes();
          context.setAttribute("masterMks", masterMks);
        * This method is necessary for interface.
       public void contextDestroyed(ServletContextEvent sce) {
       // I have no clue what the heck this is for???
       // Let me know if you do!
    }So now we travel into the PatentService method called 'getPatents();' which in turn calls a PatentDAO method
    Map patents = pServ.getPatents();
    Below is the code for the PatentService object:
    package kms.domain;
    import kms.util.ObjectNotFoundException;
    import java.util.*;
    * This object performs a variety of dept services, like retrieving
    * a dept object from the database, or creating a new dept object.
    public class PatentService {
       * The internal Data Access Object used for database CRUD operations.
      private PatentDAO patentDAO;
       * This constructor creates a Dept Service object.
      public PatentService() {
        patentDAO = new PatentDAO();
    public Map getPatents() {
          Map patents = null;
          try {
            patents = patentDAO.retrieveAll();
          // If the dept object does not exist, simply return null
          } catch (ObjectNotFoundException onfe) {
            patents = null;
          return patents;
    }It may be useful for you to see the code of the Patent class:
    package kms.domain;
    /*** This domain object represents a dept.
    public class Patent implements java.io.Serializable {
      private int codeGgm;
      private String name = "";
      private String description = "";
      private int creator;
      private String creationDate = "";
      private int used;
       * This is the full constructor.
      public Patent(int codeGgm, String name, String desc, int creator, String creationDate, int used) {
        this.codeGgm = codeGgm;
        this.name = name;
        this.description = desc;
        this.creator = creator;
        this.creationDate = creationDate;
        this.used = used;
      public Patent() { }
      public int getCodeGgm() {
          return codeGgm;
      public void setCodeGgm(int codeGgm) {
           this.codeGgm = codeGgm;
      public String getName() {
        return name;
      public void setName(String name) {
          this.name = name;
      public String getDesc() {
        return description;
      public void setDesc(String desc) {
          this.description = desc;
      public int getCreator() {
          return creator;
      public void setCreator(int creator) {
             this.creator = creator;
      public String getCreationDate() {
          return creationDate;
      public void setCreationDate(String creationDate) {
             this.creationDate = creationDate;
      public int getUsed() {
           return used;
      public void setUsed(int used){
           this.used = used;
    }And here is the Database table which stores the Patents:
    DESC PATENT:
    CODE_GGM NUMBER(3)
    NAME VARCHAR2(15)
    DESCRIPTION VARCHAR2(250)
    CREATOR NUMBER(10)
    CREATION_DATE DATE
    USED NUMBER(1)
    So, we then travel into the code of the PatentDAO to see how the DAO object executes the DB query to get all of the Data we need for the select list:
    package kms.domain;
    import javax.naming.*;
    import javax.sql.*;
    import java.util.*;
    import java.sql.*;
    import kms.util.*;
    * This Data Access Object performs database operations on Patent objects.
    class PatentDAO {
       * This constructor creates a Patent DAO object.
       * Keep this package-private, so no other classes have access
    PatentDAO() {
    * This method returns a Map of all the Dept names
    * The key is the Dept id
    Map retrieveAll()
           throws ObjectNotFoundException {
          Connection connection = null;
          ResultSet results = null;
          // Create the query statement
          PreparedStatement query_stmt = null;
          try {
            // Get a database connection
          Context initContext = new InitialContext();
           DataSource ds = (DataSource)initContext.lookup("java:/comp/env/jdbc/keymanOracle");
           connection = ds.getConnection();
            // Create SQL SELECT statement
            query_stmt = connection.prepareStatement(RETRIEVE_ALL_NAMES);
            results = query_stmt.executeQuery();
            int num_of_rows = 0;
          Map patents = new TreeMap();
             // Iterator over the query results
            while ( results.next() ) {
                patents.put(new Integer(results.getInt("code_ggm")), results.getString("name"));
             if ( patents != null ) {
                      return patents;
                    } else {
                      throw new ObjectNotFoundException("patent");
           // Handle any SQL errors
         } catch (SQLException se) {
            se.printStackTrace();
           throw new RuntimeException("A database error occured. " + se.getMessage());
        } catch (NamingException se) {
          throw new RuntimeException("A JNDI error occured. " + se.getMessage());
          // Clean up JDBC resources
          } finally {
            if ( results != null ) {
              try { results.close(); }
              catch (SQLException se) { se.printStackTrace(System.err); }
            if ( query_stmt != null ) {
              try { query_stmt.close(); }
              catch (SQLException se) { se.printStackTrace(System.err); }
            if ( connection != null ) {
              try { connection.close(); }
              catch (Exception e) { e.printStackTrace(System.err); }
    private static final String RETRIEVE_ALL_NAMES
          = "SELECT code_ggm, name FROM patent ";
    }Now when you wish to use the 'combo box' (also called select lists), you insert this code into your jsp:
    <TR>
    <%@ include file="../incl/patent.jsp" %>
    </TR>
    depending on how your files on your server are organized, the "../incl/patent.jsp"
    tells the container to look up one directory from where the main jsp is to find the 'patent.jsp' file in the 'incl' directory.
    I need some help creating multi-level select lists with JavaScript:
    Can anyone explain this code:
    <%@ page import="java.util.*,kms.domain.*" %>
    <jsp:useBean id="campuses" scope="application" class="java.util.Map" />
    <TR><TD ALIGN='right'>Campus: </TD>
    <TD>
    <select name="campus" size="1" onChange="redirect(this.options.selectedIndex)">
    <option value="0" selected>No Campus</option>
    <% LocationService ls = new LocationService();
       Iterator c = campuses.keySet().iterator();
       Map[] bm = new Map[campuses.size()];
       Map[][] fm = new Map[campuses.size()][0];
       Map[][][] lm = new Map[campuses.size()][0][0];
       int i2 = 0;
       int j2 = 0;
       int k2 = 0;
       int jj = 0;
       int kk = 0;
       while (c.hasNext()) {
          Integer i = (Integer)c.next();
          out.print("<OPTION ");
          out.print("VALUE='" + i.intValue()+ "'>");
          out.print( (String) campuses.get(i) );
          out.print("</OPTION>");
          bm[i2] =  ls.getBuildingsByCampus(i.intValue());
          fm[i2] = new Map[bm[i2].size()];
          lm[i2] = new Map[bm[i2].size()][];
          Iterator b = bm[i2].keySet().iterator();
          j2 = 0;
          while (b.hasNext()) {
            Integer j = (Integer)b.next();
            fm[i2][j2] = ls.getFloorsByBuilding(j.intValue());
            lm[i2][j2] = new Map[fm[i2][j2].size()];
            Iterator f = fm[i2][j2].keySet().iterator();
            k2 = 0;
            while (f.hasNext()) {
              Integer k = (Integer)f.next();
              lm[i2][j2][k2] = ls.getLocationsByFloor(k.intValue());
              k2++;
              kk++;
            j2++;
            jj++;
          i2++;
       } %>
    </select></TD>
    </TR>
    <TR><TD ALIGN='right'>Building: </TD>
    <TD>
    <select name="building" size="1" onChange="redirect1(this.options.selectedIndex)">
    <option value="0" selected>No Building</option>
    </select></TD>
    </TR>
    <TR><TD ALIGN='right'>Floor: </TD>
    <TD>
    <select name="floor" size="1" onChange="redirect2(this.options.selectedIndex)">
    <option value="0" selected>No Floor</option>
    </select></TD>
    </TR>
    <TR><TD ALIGN='right'>Room: </TD>
    <TD>
    <select name="location_id" size="1">
    <option value="0" selected>No Room</option>
    </select></TD>
    </TR>
    <script>
    var cNum = <%=i2%>
    var bNum = <%=jj%>
    var fNum = <%=kk%>
    var cc = 0
    var bb = 0
    var ff = 0
    var temp=document.isc.building
    function redirect(x){
    cc = x
    for (m=temp.options.length-1;m>0;m--)
      temp.options[m]=null
      temp.options[0]=new Option("No Building", "0")
      if (cc!=0) {
        for (i=1;i<=group[cc-1].length;i++){
          temp.options=new Option(group[cc-1][i-1].text,group[cc-1][i-1].value)
    temp.options[0].selected=true
    redirect1(0)
    var group=new Array(cNum)
    for (i=0; i<cNum; i++) {
    group[i]=new Array()
    <% for (int i=0; i< bm.length; i++) {
    Iterator bldgs = bm[i].keySet().iterator();
    int j = 0;
    while (bldgs.hasNext()) {
    Integer intJ =(Integer) bldgs.next(); %>
    group[<%=i%>][<%=j%>] = new Option("<%=bm[i].get(intJ)%>", "<%=intJ%>");
    <% j++;
    } %>
    var group2=new Array(cNum)
    for (i=0; i<cNum; i++) {
    group2[i] = new Array()
    for (j=0; j<=bNum; j++) {
    group2[i][j] = new Array()
    <% for (int i=0; i< fm.length; i++) {
    for (int j=0; j< fm[i].length; j++) {
    Iterator flrs = fm[i][j].keySet().iterator();
    int k = 0;
    while (flrs.hasNext()) {
    Integer intK =(Integer) flrs.next(); %>
    group2[<%=i%>][<%=j%>][<%=k%>] = new Option("<%=fm[i][j].get(intK)%>", "<%=intK%>");
    <% k++;
    } %>
    var temp1=document.isc.floor
    var camp=document.isc.campus.options.selectedIndex
    function redirect1(x){
    bb = x
    for (m=temp1.options.length-1;m>0;m--)
    temp1.options[m]=null
    temp1.options[0]=new Option("No Floor", "0")
    if (cc!=0 && bb!=0) {
    for (i=1;i<=group2[cc-1][bb-1].length;i++){
    temp1.options[i]=new Option(group2[cc-1][bb-1][i-1].text,group2[cc-1][bb-1][i-1].value)
    temp1.options[0].selected=true
    redirect2(0)
    var group3=new Array(cNum)
    for (i=0; i<cNum; i++) {
    group3[i] = new Array()
    for (j=0; j<=bNum; j++) {
    group3[i][j] = new Array()
    for (k=0; k<=fNum; k++) {
    group3[i][j][k] = new Array()
    <% for (int i=0; i< lm.length; i++) {
    for (int j=0; j< lm[i].length; j++) {
    for (int k=0; k< lm[i][j].length; k++) {
    Iterator locs = lm[i][j][k].keySet().iterator();
    int m = 0;
    while (locs.hasNext()) {
    Integer intM =(Integer) locs.next(); %>
    group3[<%=i%>][<%=j%>][<%=k%>][<%=m%>] = new Option("<%=lm[i][j][k].get(intM)%>", "<%=intM%>");
    <% m++;
    } %>
    var temp2=document.isc.location_id
    function redirect2(x){
    ff = x
    for (m=temp2.options.length-1;m>0;m--)
    temp2.options[m]=null
    temp2.options[0]=new Option("No Room", "0")
    if (cc!=0 && bb!=0 && ff!=0) {
    for (i=1;i<=group3[cc-1][bb-1][ff-1].length;i++){
    temp2.options[i]=new Option(group3[cc-1][bb-1][ff-1][i-1].text,group3[cc-1][bb-1][ff-1][i-1].value)
    temp2.options[0].selected=true
    </script>
    This produces a related select list with 4 related lists by outputting JavaScript to the page being served. It works the same way as the first example that I describe but I don't understand the looping...maybe someone could explain how to go from the single select list to a double and/or triple level drill down?

  • Question on Combo Box

    I have a form with Master (Single Record ) and Detail ( Multi Record ) blocks. There is a Combo Box in Header block. When I select a value from Combo box ( When list changed ) detail block records are to re queried. Similarly when I enter some value manulally and by pressing tab/enter key ( Key Next Item) , the detail records are to re queried.
    While entering a value with Key board, the trigger When-List-Changed trigger is firing for each letter I'm typing. Is there any work around solution for this?

    Quote:I think it will be nice to close the editor if we click again on the down arrow or the cell without selecting any item in the combobox, so that users can see original cell view
    Your opinion collides with the opinion of other users that say they want to keep the combobox active to see what is underneath the open dropdown to open it again.
    Adding your code to the iconCanvas in NatCombo breaks the behavior on clicking the down arrow. At least in my workspace. I don't know of which version we are talking about and which codebase you have. But hideDropDownControl() does not close the editor, it only hides the dropdown. This can't be the solution.
    What you need is to override mouseDown() to close the editor instead of hiding it.
    BTW, with this change you remove the ability to move the focus to the text control to allow editing.

  • Analyzer Combo Boxes

    Hi there,<BR><BR>When putting Combo Box Subscriptions onto Analyzer reports is there any way to ONLY show members that have data held againt then?<BR><BR>For example:<BR><BR>Multi level combo box....<BR><BR>1st Level: Name<BR><BR>2nd Level: Accounts<BR><BR>When selecting the name, can we only show accounts that have data against them? SOmetimes there maybe upto 1,000 accounts held against a name, but only 2 of them have any data held against them, so its a bit of a waste!<BR><BR>The excel spreadsheet addin does this fine by using suppress 0 or #Missing values, can we do the same for COMBO BOXES in Analyzer (not charts, spreadsheets etc..)<BR><BR>Cheers

    Thanks for the reply mate. It was a bit of a long shot but no harm in askin <img src="i/expressions/face-icon-small-wink.gif" border="0"><BR><BR>Your idea sounds very useful and will give it a whirl.<BR><BR>Thanks again! <img src="i/expressions/beer.gif" border="0"><BR><BR><blockquote>quote:<br><hr><i>Originally posted by: <b>garycris</b></i><BR>I have not seen that functionality. It would be nice. But since a combo box is dimension specific and you would need to evaluate the intersections of that dimesnion with every other dimension to determine if in fact it was a NULL value being returned, I can see where it could pose some issues. To get around it, I usually put the top member in the drop down with children (descendants, etc) seelcted and then move the dim onto the rows and use Suppress Missing. When they select from the drop down they only get the ones that have values and then I tell them to use right click keep only for the one they want.<hr></blockquote><BR><BR>

Maybe you are looking for

  • Two graphics card on macbook pro which one do I use?

    I have two graphics cards on my macbook pro. ADM random 6490m (256mb vram) and Intel HD graphics 3000 (512mb vram). My question is which one should I use? I don't do any hardcore gaming or photoshop. I guess that I am just looking for the best displa

  • How to use a SAME form between two JSP ?

    Hi, I have a JSP called jsp1 that use a form called form1. I use the next line in jsp1 to tell this : <jsp:useBean id="form1" class="Form" scope="request"/> In struts-config : <form-beans> <form-bean name="form1" type="Form"/> </form-beans> <action p

  • Read only filesystem?

    When starting up archlinux it says: kinit: mounting root ( ext3 filesystem) readonly and also it says cannot find default font. how do i fix this?

  • Problem in a drawing program

    Dear experts, While working on a program,i am having a problem which is just killing me.This is a simple drawing program.On clicking draw button,user can do free hand drawing.On clicking line he can stretch line to any coordinate.Similarily do erasin

  • Since installing Firefox, my number pad on my laptop & my Cannon printer don't work

    Acer aspire5742 G using Window 7 Cannon printer MX880 series - whether in wifi mode or plugged in to pc get message printer off line. All plug in properly new cartridges put in properly but cartridge lights are shining. Thanks Roseskick