Dynamic ComboBox

Hi,
I'd like to create a dynamic combobox that will add entries according to user input from a dialog box.
Can anyone advise on how to achieve this?
Thanks in advance
Bulleo

Hello,
import java.awt.event.*;
import javax.swing.*;
public class ComboDialog extends JFrame
     JComboBox combo = null;
     ComboDialog()
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          JPanel content = new JPanel();
          combo = new JComboBox(new String[] { "Please enter a new Entry" });
          JButton newEntry = new JButton("new Entry");
          newEntry.addActionListener(new ActionListener()
               public void actionPerformed(ActionEvent e)
                    combo.addItem(
                         JOptionPane.showInputDialog("Please enter a new Entry:"));
          content.add(newEntry);
          content.add(combo);
          setContentPane(content);
          setSize(200, 200);
          setLocationRelativeTo(null);
          setVisible(true);
     public static void main(String[] args)
          new ComboDialog();
}Hope it helps,
Regards
Tim

Similar Messages

  • Dynamic comboBox in a dataGrid?

    i have a dataGrid that starts out blank. When a button is
    clicked, it populates based on the contents of a few components.
    The 3rd column needs a comboBox. I need the following
    behaviors:
    1-when the button is clicked, this populates with the text
    values in a certain text field.
    2-under certain circumstances, i need to be able to add and
    subtract from this comboBox.
    i have read this:
    http://blog.flexmonkeypatches.com/2008/02/18/simple-datagrid-combobox-as-item-editor-examp le/
    but it looks like the comboBox in that example has fixed
    values. How can i dynamically alter the values in
    these comboBoxes? i have the comboBoxes in the dataGrid
    component, but i can't figure out how to access their
    dataProviders!
    thanks!

    You can have your comboBox itemRenderer populate based on an
    ArrayCollection in your dataDrid dataProvider. Then, by changing
    the dataProvider's ArrayCollection field, you could change each of
    the comboBoxes accordingly. If you need different comboBox values
    for different comboBoxes, then you will need something a bit
    different. It would help to see your code.
    Vygo

  • Attach Dynamic ComboBox

    Hi dear,
    I am still working with Jdev9i and need to attach a dynamic combo box to the grid in applet. i found an oracle class called StaticGridComboBox(), but this good only for a static combo. Is there a class/method to attach a dynamic combo to the grid? or any work around?
    Thanks

    Frank,
    I meant a combobox that could be bound to a table.
    Thanks.

  • How to get the values of 2 dynamic comboboxes in one jsp to another jsp?

    I have 2 comboboxes and one submit button on my jsp page.I select a value in 1st combobox then the values in the second combobox populated from the database. next i select 2nd combobox and then submit the button.After submit the button call the next jsp page. In that page i want to display the values of two comboboxes. but my problem is , in that page only 2nd combobox value is displayed.1st combobox is displayed as null. plz tell me, how to get the values of two comboboxes at a time?
    Select.jsp:
    <%@ page language="java" import="java.sql.*" %>
    <%!
         Connection con = null;
         Statement  st  = null;
         ResultSet  rs  = null;
         String     sql = null;
         void addItems(javax.servlet.jsp.JspWriter out, String sql)
           try{     
              rs = st.executeQuery(sql);
              while( rs.next() )
                   out.println("<option>" + rs.getString(1) + "</option>");               
         }catch(Exception e)
                   System.out.println(e);
    %>
    <HTML>
    <HEAD>
    <TITLE>JSP WITH  MULTIPLE FORMS</TITLE>
    <script language="javascript">
              function checking()
                        form1.submit();
         </script>
    </HEAD>
         <body>
             <center>
             <b><font size="5" color="#333399">Staff ID:</font></b></center>
                     <FORM NAME="form1" METHOD="POST" ACTION="Select.jsp">
                         <p align=center>
                         Details of Staff :  
                       <SELECT 1 NAME="type" onchange="checking();">
                                    <option> Administrator </option>
                              <option> OfficeAssistent </option>
                              <option> Clerk </option>
                                  </SELECT 1>
                          </p>
    </FORM>
                      <FORM NAME="form2" METHOD="POST" action="welcome1.jsp">
                      <center>
                          <TABLE><TR><TD>Staff ID:</TD>
                                 <TD><SELECT 2 NAME="staff_id">
                    <%    
            String type = request.getParameter("type");
            try {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            con = DriverManager.getConnection("jdbc:odbc:java","system","manager");
            catch (ClassNotFoundException ex) {
                   System.out.println(ex);
            catch (SQLException ex)
                System.out.println(ex);
         st  = con.createStatement();
         sql = "select staff_id from "+type+"";
         addItems(out, sql);
    %>
              </SELECT 2>
           </TD>
         </TR>
    </table></center>
    <h2> Details of <%= type + "s" %> </h2>
                         <center><input type=submit value=ok onclick="submit();"></center>
                  </FORM>
         </BODY>
    </HTML>
    welcome1.jsp
    <center><h1>WEL COME</h1></center>
    <%    
            String type = request.getParameter("type");
            String sid = request.getParameter("staff_id");
    %>
    <h2> Details of <%= type + "s" %> </h2>
    <h2> Details of <%= sid %> </h2>

    <SELECT 1 NAME="type" onchange="checking();">
                                    <option value = "0"> Administrator </option>
                              <option value = "1"> OfficeAssistent </option>
                              <option value = "2"> Clerk </option>
                                  </SELECT 1>

  • DataGrid with dynamic comboboxes

    I need to design a dataGrid with comboboxes in one column. These comboboxes should all have different dataProviders based on a value from column 1. What would a general approach be?
    Thanks

    The renderer's data property is the data for the entire row so you can get the column1 data and assign the combobox's dataprovider accordingly.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • How to create dynamic combobox

    hi Gurus,
    I have a jsp page and I want to setup a combobox on it that will get clientnames from the databse(mysql). Can someone give me source code to get the job done. I have class for connection.
    here is my code for class
    package admin;
    import java.sql.*;
    //     http://www.javaservice.net/%7Ejava/bbs/read.cgi?b=javatip&c=r_p&m=devtip&n=1014323889&s=t
    public class DBPool {
         private static boolean connect = false;
         private static Connection[] cons = null;
         private static int maxCons = 10;
         //private static Boolean[] consStatus = new Boolean[maxCons];
         private static int conID = -1;
         private static final String dbURL = "jdbc:mysql://localhost:3306/virsarmedia";
         private static final String user = "root";
         private static final String password = "";
         // This DB Pool needs to be re-written so that uses Vector(or Hashtable)
         // not to share one Connection for many Statements
         static{
              try
                   System.out.print("Loading MySQL Driver ... ");
                   Class.forName("org.gjt.mm.mysql.Driver");
                   System.out.println("OK");
              }catch(ClassNotFoundException e){System.out.println(e.getMessage());}
         // create Connection
         public static final synchronized Connection createConn(){
              try{
                   return DriverManager.getConnection(dbURL,user,password);
              } catch (SQLException e){
                   e.printStackTrace();
                   return null;
         // get db pool manager
         public static final synchronized Connection getConnMgr(){
              // create connections when it's called at the first
              if(!connect){
                   cons = new Connection[maxCons];
                   for(int i=0; i<maxCons; i++){
                        cons[i] = createConn();
                        if(cons[i] == null) return null;
                   connect = true;
              // round robin returning Connection
              conID++;
              if(conID <= maxCons) conID = 0;
              try{
                   if(cons[conID].isClosed()) cons[conID] = createConn();
              } catch(SQLException se){
                   System.out.println(se.getMessage());
                   cons[conID] = createConn();
              return cons[conID];
         // destory all connections
         public static final void destory(){
              connect = false;
              for(int i=0; i<maxCons; i++){
                   if(cons[i] != null){
                        try{
                             cons.close();
                        } catch(SQLException se){
                             cons[i] = null;
              cons = null;
         // get numberOfRows
         public static final int getRows(ResultSet rs){
              int numberOfRows = 0;
              try{
                   rs.last();
                   numberOfRows = rs.getRow();
                   rs.beforeFirst();
              } catch(SQLException se){
                   se.printStackTrace();
              return numberOfRows;
    I have a servet doing the job of retrieveing the records from the databse.
    I want to retrieve all records client names from the databse and display it in the combo box.package data;
    import admin.*;
    import business.*;
    import java.sql.ResultSet;
    import java.sql.*;
    import java.util.Vector;
    public class ClientDB {
         final static String TBL_USER = "client";
    public static int readClientID(Connection connection, Client client) throws SQLException{
    //This method will return 0 if ClientID isn't found.
    String query = "SELECT ClientID FROM Client " +
    "WHERE ClientID = '" + client.getClientID() + "'";
    Statement statement = connection.createStatement();
    ResultSet record = statement.executeQuery(query);
    record.next();
    int clientID = record.getInt("ClientID");
    record.close();
    statement.close();
    return clientID;
    Here is code for JSP where I want to set combobox <%@ page import="java.util.*" %>
    <%@ page language="java" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="admin.*" %>
    <%@ page import="data.*" %>
    <%
    String query = "SELECT clientName from client";
         //     Statement statement = null;
         %>
    <SELECT NAME="userSelectedCategory" onChange="this.form.submit();">
    <%
    try{
                   Statement statement = connection.createStatement();
    ResultSet result = statement.executeQuery(query);
              }catch(Exception e){
                   e.printStackTrace();
              } finally{
                   try{
                        if(statement != null) statement.close();
                   }catch(SQLException se){
                        se.printStackTrace();
    //Create a blank first option so the onChange event works.
    out.println("<option value=\"-\">-</option>");
    //Loop though all the categories in the database
    while(result.next())
    //This is a category from the database
    String optionCategoryValue = result.getString(1);
    //Construct the option tag in a String variable
    String optionTag = "<OPTION VALUE=\"" + optionCategoryValue + "\"";
    if(optionCategoryValue.equals(userSelectedCategory))
    optionTag += " selected=\"selected\"";
    //close the option tag
    optionTag += ">" + optionCategoryValue + "</OPTION>";
    //printout the option tag
    out.println(optionTag);
    //Close the result set and statment to free up resoures
    %>
    </SELECT>
    }Everything else is ok except the combo. Infact I don't know how I can set it. I am trying to do this since last 48 hours. please help me.
    Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Sorry Code for JSP is wrong here is right CODE. I am sorry about that
    <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN//">
    <html>
    <link href="../virsar.css" rel="stylesheet" type="text/css" />
    <head>
    <title>Virsar Media Administation Menu</title>
    </head>
    <body>
    <table cellspacing=0 cellpadding=0>
         <td><img src="../images/title.jpg"></td>
    </table>
    <table cellspacing=0 cellpadding=0 width=800>
         <td width=20>
    <!-- <br><br><br><br><br><br><br><br><br><br> -->
         </td>
         <!-- <td width=1 bgcolor=black></td> -->
         <td>
    <h1>Subscriptions Processing Menu!</h1>
    <%-- Following code can be used to Add the record on the front end--%>
    <script language="JavaScript">
    function validate(form) {
        if (form.paymentID.value=="") {
            alert("Please fill in PaymentID");
            form.paymentName.focus();
        else if (form.clientID.value=="") {
            alert("Please fill in ClientID");
            form.clientID.focus();
        else if (form.paymentType.value=="") {
            alert("Please fill in Payment Type");
            form.paymentType.focus();
        else {
            form.submit();
    </script>
    <table cellpadding="5" border=1>
      <tr valign="bottom">
        <th>Subscription ID</th>
        <th>Client ID</th>
        <th>Client Name</th>
        <th>Subscription Type</th>
        <th>Amount</th>
        <th>Subscription Start Date</th>
        <th>Subscription Expiry Date</th>
        <th>Description</th>
        <th>State</th>
           <th>Update Subscription</th>
              <th>Delete Subscription</th>
      </tr>
    <%@ page import="business.*" %>
    <% java.util.Vector payments = (java.util.Vector)session.getAttribute("payments");
    if(payments != null){
        for (int i =0; i<payments.size(); i++){
            Payment payment = (Payment)payments.get(i);
         if(payment instanceof Payment){
            %>
            <tr valign="top">
                <td><p><%= payment.getPaymentID() %></td>
                <td><p><%= payment.getClientID() %></td>
                <td><p><%= payment.getClientName() %></td>
                <td><p><%= payment.getPaymentType() %></td>
                <td><p><%= payment.getPaymentAmount() %></td>
                <td><p><%= payment.getPaymentStartDate() %></td>
                <td><p><%= payment.getPaymentExpiryDate() %></td>
                <td><p><%= payment.getPaymentDescription() %></td>
                <td><p><%= payment.getPaymentState() %></td>
                <td><a href="../servlet/admin.ShowPaymentServlet?paymentID=<%=payment.getPaymentID()%>">Update </a></td>
                <td><a href="../servlet/admin.DeletePaymentServlet?paymentID=<%=payment.getPaymentID()%>">Delete </a></td>
            </tr>
            <%
    %>
    </table>
    <form action="../servlet/admin.AddPaymentServlet" method="get">
    <table cellspacing="5" border="0">
        <tr>
            <td align="right">Subscription ID:</td>
            <td><input type="text" name="paymentID"
                    value="">
            </td>
        </tr>
        <tr>
            <td align="right"> Client Name :</td>
            <%-- ---------------------------------------- this is where I want to set my combo -------------------- --%>
                <td>
                          <input name="clientName" type = "text" value= "../servlet/admin/ShowCompanyNames.getClientID()"></input>
                </td>
            <!--  <td><input type="text" name="clientName"
                    value="">
            </td> -->
        </tr>
        <tr>
            <td align="right"> ClientID </td>
            <td><input type="text" name="clientID"
                    value="">
            </td>
        </tr>
        <tr>
            <td align="right"> Payment Type :</td>
         <!--   <td><input type="text" name="paymentType"
                    value="">
            </td>
         -->
               <td>
                <INPUT TYPE=RADIO NAME="paymentType" VALUE="Monthly">Montly
                   <INPUT TYPE=RADIO NAME="paymentType" VALUE="Yearly">Yearly
                   <INPUT TYPE=RADIO NAME="paymentType" VALUE="One Time">One Time
                   <INPUT TYPE=RADIO NAME="paymentType" VALUE="Other">Other<br>
                  </td>
        </tr>
           <tr>
            <td align="right"> Payment Amount :</td>
            <td><input type="text" name="paymentAmount"
                    value="">
            </td>
        </tr>
           <tr>
            <td align="right"> PaymentStartDate :</td>
            <td><input type="text" name="paymentStartDate"
                    value="">
            </td>
        </tr>
           <tr>
            <td align="right"> PaymentExpiryDate :</td>
            <td><input type="text" name="paymentTelephone"
                    value="">
            </td>
        </tr>
           <tr>
            <td align="right"> Description :</td>
            <td><input type="text" name="paymentDescription"
                    value="">
            </td>
        </tr>
           <tr>
            <td align="right"> Status :</td>
            <td><input type="text" name="paymentState"
                    value="">
            </td>
        </tr>
           <td></td>
            <td><input type="button" value="Add Subscription info."
                       onClick="validate(this.form)"></td>
        </tr>
    </table>
    </form>
    <table>
    <tr>
    <td>
    <form action="Cadmin.PaymentsServlet" method="get">
        <input type="submit" value="Refresh List">
    </form>
    </td><td>
    <form action="../Admin/index.html">
        <input type="submit" value="Go Back">
    </form>
    </td>
    </table>
         </td>
    </table>
    </html>
    </body>
    </html>

  • Dynamic combobox using jsp

    HI All,
    This is very urgent for me please help me to come out of this.
    I just want to display the values in combobox from database using jsp,but i have difficulty in doing it can any one help me for this.I will be thankfull if any one gives me a code for the same.
    Ramesh.R

    very simple example
    <%@ page import="java.sql.*" %>
    Add Item:
    <SELECT NAME="item">
    <ol>
    <%
    Connection con5 =
    DriverManager.getConnection("url","user","password");
    String q5 = "query" ;
    Statement stmt5 = (Statement)con5.createStatement();
    ResultSet rs5 = stmt5.executeQuery(q5);
    while(rs5.next()){
    String str5= rs5.getString("field");
    %>
    <li> <% out.print("<OPTION>" + str5); %>
    <% } %>
    </ol>
    </SELECT>

  • Dynamic comboboxes in netbeans

    Hi all,
    I have created java desktop application using netbeans 6.
    I have created two comboboxes, A and B combobox. The list of value of B combobox will depend on the value chosen from A combobox. Both comboboxes are bind to the database.
    The query for combobox A looks like:
    brandQuery2 = java.beans.Beans.isDesignTime() ? null : paint_dbPUEntityManager.createQuery("SELECT b FROM Brand b");
            brandList2 = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : brandQuery2.getResultList();while query for combobox B looks like : Select p from Product
      producttypeQuery = java.beans.Beans.isDesignTime() ? null : paint_dbPUEntityManager.createQuery("SELECT p FROM Producttype p WHERE p.pktype IN (Select pr.fktype FROM Product pr WHERE pr.fkbrand =" + getBrandSelected() + ")" );
            producttypeList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : producttypeQuery.getResultList();I have an action listener for combobox A which called the query again for combobox B.
    After value is selected from combobox A, there are no list of values for comboBox B.
    what i should at the action listener?
    Appreciate the help.
    Regard,
    yun

    Hello and welcome to the forum. I have a couple of friendly recommendations to help you better get your questions answered. First of all, try to avoid resurrecting old threads. If you have a problem that you want solved, start your own thread. If there's another thread that's related to yours, then by all means reference it in your thread, but don't resurrect it.
    Next, when posting your code, please use code tags so that your code will retain its formatting and be readable. To do this, you will need to paste already formatted code into the forum, highlight this code, and then press the "code" button at the top of the forum Message editor prior to posting the message. You may want to click on the Preview tab to make sure that your code is formatted correctly. Another way is to place the tag &#91;code] at the top of your block of code and the tag &#91;/code] at the bottom, like so:
    &#91;code]
      // your code block goes here.
      // note the differences between the tag at the top vs the bottom.
    &#91;/code]or
    {&#99;ode}
      // your code block goes here.
      // note here that the tags are the same.
    {&#99;ode}Finally you may have better luck getting your questions answered if you can post a compilable example of your problem. We don't want to see your whole program, but rather you should condense your code into the smallest bit that still compiles, has no extra code that's not relevant to your problem, but still demonstrates your problem, in other words, an SSCCE (Short, Self Contained, Correct (Compilable), Example). For more info on SSCCEs please look here:
    [http://homepage1.nifty.com/algafield/sscce.html|http://homepage1.nifty.com/algafield/sscce.html]

  • How can I assgin a master feild value in combobox bind variable in the detail

    Hi All,
    I'm working on a MD-Form in portal.
    I want to pass a master block value in the dynamic combobox where clause.
    Combo box is in the detail Block. Can anyone please give a solution for this?
    This a very urgent Requirement for me. I really appreciate.
    Thanks
    Murali

    Does this help?
    Dreamweaver Dynamic Master List with link to Detail - YouTube

  • Help with Comboboxes inside a repeater

    Hi, I have a problem that I really need some help, if anyone knows how to do it.
    I have to make in flex a dynamic form that has X questions and each question can be answered 3 times by sellecting Y options in a combobox. As you can Imagine the number of questions and answers can change.
    Something like this:
    QUESTION                          FIRST ANSWER   2nd ANSWER      3rd ANSWER
    1- Which option do you like?  Combobox: A      Combobox: C        CB: A
    2- Second Question?             Combobox: B      Combobox: C        CB: D
    3- Third Question?                 Combobox: A      Combobox: Blank  CB: B
    (CB: means Combobox - I just made it shorter so it could fit the window)
    I managed to correctly using a repeater show all the questions and each combobox has all the right options inside. All I want now is to get the data from those comboboxes.
    This is a Simplified code (I removed all the non-essencial stuff) so you can get an idea:
    <mx:Repeater id="rp">
    <mx:VBox label="{rp.currentItem.nome}"
    width="100%">
    <mx:Repeater id="qt"
    dataProvider="{rp.currentItem.tbdavaliacao_pergunta}">
    <mx:HBox width="100%"
    verticalAlign="middle"
    horizontalAlign="center">
    <!-- This is the question text -->
    <mx:Text text="{String(qt.currentItem.nome)}"
    textAlign="center"/>
    <!-- Next, are the 3 comboboxes that are repeated X times -->
                                            <mx:ComboBox dataProvider="{grau}"
                                                           id="auto"
                                                           textAlign="center">
                                             </mx:ComboBox>
                                            <mx:ComboBox dataProvider="{grau}"
                                                           id="superior"
                                                           textAlign="center">
                                            </mx:ComboBox>
                                            <mx:ComboBox dataProvider="{grau}"
                                                           id="resultado"
                                                           textAlign="center">
                                            </mx:ComboBox>
    </mx:HBox>
    </mx:Repeater>
    </mx:VBox>
    </mx:Repeater>
    Anyone has an idea of how can I get all the answers from all my dynamic comboboxes?
    The perfect AND ideal solution would be having X Dynamic objects with the question id + the combobox id storing the answer sellected.
    So I would know that the question 32 has the answers A, B and A for an example.
    qt.currentitem.id + combobox.id = selectedLabel
    (question ID) + (combobox id) = (selectedLabel)
    32auto = 'A'
    32superior = 'B'
    32resultado = 'A'
    Or just one arraycollection with all the answers...
    At this point, I would accept any answer or idea or sollution...
    Thanks a lot!!

    I've looked at the HR schema to provide an example
    From the EMPLOYEES table I would like to return the EMPLOYEE_IDs of the employees with the highest SALARY per JOB_ID. When considering the employees that have the same JOB_ID, if any of the employees have a MANAGER_ID of x then no employee is returned for that group of employees with the same JOB_ID. x will be passed in as a parameter to my procedure.
    Example
    MANAGER_ID of 99 passed in
    All of the EMPLOYEE_IDs with the max SALARY per JOB_ID returned - no one has a manager with MANAGER_ID of 99
    MANAGER_ID of 101 passed in
    101 returned - Neena has the max salary of all the AD_VPs and neither of the AD_VPs has a MANAGER_ID of 101 (ok I know this isn't true about the salary!)
    102 returned - Alexander has the max salary of all IT_PROGs and none of them has MANAGER_ID of 101
    (108 not returned as Nancy has MANAGER_ID of 101)
    109 returned - Daniel has the max salary of all the FI_ACCOUNTs and none of them has MANAGER_ID of 101
    etc... for all JOB_IDs
    MANAGER_ID of 102 passed in
    101 returned - Neena has the max salary of all the AD_VPs and neither of the AD_VPs has a MANAGER_ID of 102 (ok I know this isn't true about the salary!)
    (no IT_PROGs returned as Alexander has MANAGER_ID of 102)
    108 returned - Nancy has max SALARY and not a MANAGER_ID of 102
    109 returned - Daniel has the max salary of all the FI_ACCOUNTs and none of them has MANAGER_ID of 102
    etc... for all JOB_IDs
    MANAGER_ID of 103 passed in
    101 returned - Neena has the max salary of all the AD_VPs and neither of the AD_VPs has a MANAGER_ID of 103 (ok I know this isn't true about the salary!)
    (no IT_PROGs returned as several have MANAGER_ID of 103)
    108 returned - Nancy has max SALARY and not a MANAGER_ID of 103
    109 returned - Daniel has the max salary of all the FI_ACCOUNTs and none of them has MANAGER_ID of 103
    etc... for all JOB_IDs
    Hope this helps to explain things, and thanks to anyone that can help
    Rob

  • Flexdatagrid within combobox issue?

    hai friends,
          i am using dynamic datagrid . it include one of the  column include a dynamic combobox.
    for example
    that a dynamic combobox include like
    1
    10
    50
    100
    200
    then i retrive data like this its from db.
    sec_rights_level ---> db field name
    50   --- > first data
    1     ---> second data
    100   ---> 3rd data
    10
    200
    i want selected value(50)  in first row cmbox then
    i want selected value(1) in second row combobox.    i gave like this 
    <s:combobox dataprovider={outdocument.cb_dynamiccb}   selected item={data.db field name}/>// output is not coming
    give solution
    thanks in advance
    regards,
    welcome canv

    but id name not display  within script.check it .
    my code is below:
    <fx:script>
    <![CDATA[
    private  
    function setSelectedItem():void { 
    cb_combo.selectedItem = data.db field name;//  combobox id is not coming.i am getting error.
      <mx:DataGrid 
    id="dg_curtainmanager" showHeaders="true" creationComplete="" variableRowHeight="true" wordWrap="true" dataProvider="{fileListArray}" rowCount="{fileListArray.length}" width="100%" >  
         <mx:DataGridColumn 
    headerText="Rights Level" width="100" minWidth="75" sortable="true" >
    <mx:itemRenderer >
    <fx:Component>
    <mx:HBox>
    <mx:ComboBox id="cb_combo" dataProvider="{outerDocument.first.dataProvider}" labelField="sec_rights_level" creationComplete="setSelectedItem()" />
    <mx:Label id="lbl_dfcprightlevel" text="{data.dfcp_sec_rights_level}" color="black" />
    </mx:HBox>
    </fx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>
    </mx:DataGrid>

  • Dynamic JComboBox

    Hello ,
    Is it possible to implement a dynamic combobox.
    I mean, e.g.:
    A combobox that originally takes on the following values:
    e.g.: color, function and identity
    and if you press color, the list changes to contain only colors: e.g.: blue, brown, cyan, ...?
    Is it possible to reply with an example?
    Thanx a lot!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Evi

    ComboBoxModel handle both selected value and all values at the same time. Write your own ComboBoxModel to do something more or less like:
    1) trap selection change through setSelectedItem
    2) load in data for that item,
    3) reset the selection
    4) fire listeners

  • Combobox select problem?

    hai friends,
          i need select combobox item random.
    for example
    i created a dynamic combobox include like
    1
    2
    3
    4
    5
    now i insert to data grid column.it display in 5 rows then i am having data like this its from db.
    2
    5
    1
    3
    4
    i want select 2 in first row cmbox then
    i want select 5 in second row combobox.    i gave like this  
    <s:combobox dataprovider={outdocument.cb_dynamiccb}   selected item={data.db field name}/>// output is not coming
    give solution
    thanks in advance
    regards,
    welcome canv

    Set the combobox vlaue after you get the data from the server,
    like
    onRespones(evt:resultEvent):void{
    combo.selectedItem = someObject();

  • MDform - need a value to be defaulted.

    I'm new to portal forms
    I'm working on a Master Detail portal form.
    My tables
    webcust_header (master table)
    customer_id
    Webcust_detail (detail table)
    Customer_id
    How can I show or assign or default the customer_id selected in
    master into detail customer_id in the form.I don't see the
    customer_id in the detail block after selecting the values in
    master block from a combo box. I have to use the customer_id
    from detail for another LOV in the detail feild as a dynamic value.
    Can any one please help me out ?
    thanx
    Sirisha

    Thanks very much rahul for your reply.
    I hope I'm not explaining in a right way. Let me try again.
    I want to default a master block value in all the foreign key column in detail block even for the empty field. because I have a Dynamic combobox LOV based on that cloumn. It will only refresh if it has any value.
    Master Block
    Deptno Department Name (Combox Box)
    10 ACCOUNTS
    Details Block ******* I have 5 rows in detail block
    deptno Empno JOB (Dynamic combo box based on deptno in detail )
    10 1234 MANAGER
    10 2345 SALESMEN
    10 4321 MANAGER
    Note : ? is Combo box becomes very small without a value in it.
    In this form what I'm trying to do is
    1) I select department from combo box which will automatically put the deptno in master block.
    2) I hit the query button and all the 3 records in emp detail are displayed.
    3) Now when I what to create a new record in emp(detail block) and assign them a job.I can't Because my JOB field is set on a dynamic LOV as combo box. and it is expecting a deptno in detail block. which is acutally not there.
    I tried the following code it doesn't work. Can you please look into my problem again ...Thanks a lot
    Hope to see your reply soon .
    Thanks a lot
    Sirisha
    [email protected]
    ... before processing the form.
    declare
         V_DEPTNO number;
    begin
    V_DEPTNO := p_session.get_value_as_NUMBER(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => 'A_DEPTNO');
    FOR i in 1..g_max_det_rec LOOP
    p_session.set_value(p_block_name => 'DETAIL_BLOCK',
    p_attribute_name => 'A_DEPTNO',
    p_index => i,
    p_value => V_DEPTNO);
    END LOOP;
    end;

  • Trouble with combo box

    I am using a combo box with the code below, but each time I
    arrive on this
    screen that displays cbTREATMENT, the combo box first draws
    itself with the
    default style, then applies my style, which looks a bit ugly
    onscreen.
    Anything I can do to rectify this?
    Thanks.
    cbTREATMENT.setStyle( "fontSize", "13" );
    cbTREATMENT.setStyle( "color", "0x000000" );
    cbTREATMENT.setStyle( "fontWeight", "bold" );
    cbTREATMENT.setStyle( "fontFamily", "arial" );
    cbTREATMENT.dropdown.rowHeight = 18;
    cbTREATMENT.dataProvider=["","name1","name2","name3];
    cbTREATMENT.text=vTREATMENT;

    Thanks for the reply, but I'm not sure what you mean, can you
    explain any
    further?
    "niki tsanov" <[email protected]> wrote in
    message
    news:fm5qnf$elq$[email protected]..
    > Store your combobox only into the library after that try
    with
    > createClassObject() to make dynamicly ComboBox item into
    the stage for me
    > work perfect

Maybe you are looking for