Combo box , error type !

Hello,
I've got an error I can't find since 2 days ! I'm trying to build a simple combo box in which there are some data from my database . It's to deploy a process under jBoss jBPM but the error is a JSF one :
Here is my JSF form code :
    <jbpm:datacell>
      <f:facet name="header">
        <h:outputText value="Produit desire: "/>
      </f:facet>
       <h:selectOneMenu value="#{genList.value}">
            <f:selectItems value="#{genList.items}" />
       </h:selectOneMenu>
    </jbpm:datacell>Then, here is my genList.java :
public class genList {
     private String value="";
     private Connection conn;
     public genList() {}
     public String getValue() {
          return value;
     public void setValue(String value) {
          this.value = value;
     public Collection getItems() {
          Collection items = new ArrayList();
          SelectItem si = null;
          try{
               //-- Connexion
              Class.forName("com.mysql.jdbc.Driver");
              conn = DriverManager.getConnection ("jdbc:mysql://localhost:3306/databaseName", "root", " ");
              //-- Creation du statement et de la requete
              Statement stmt = conn.createStatement();
              String requete = null;
              requete = "SELECT ID_,NOM_ FROM materiel";
              //-- Execution de la requete
              ResultSet rs = stmt.executeQuery(requete);
              //-- Lecture des donnees
              while (rs.next())
                   si = new SelectItem (String.valueOf(rs.getInt(1)), rs.getString(2));
                   items.add(si);
              //-- Deconnexion
              conn.close();
          } catch(Exception e){
              System.out.println("\n\n\nCONNEXION ECHOUEE: "+e+"\n\n\n");
              System.exit(-1); 
          return items;
}Here is my Face config :
<managed-bean>
      <managed-bean-name>genList</managed-bean-name>
      <managed-bean-class>com.demande.action.genList</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
</managed-bean>Finally here is the error returned :
Argument Error: An option for component j_id48 was not an instance of javax.faces.model.SelectItem. Type found: java.util.ArrayList.
(j_id48 is the name given automatically to the combo box)
I tried a lot of things to repair that error, but nothing works... I can't see where is the problem, if you could help me.
Thanks,
Richard T.

I'm sorry i accidentaly put my topic on the watchlist... I don't know what it is, but I don't know how to correct it ...

Similar Messages

  • Combo box error

    I have the following code:
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String sourceURL = "jdbc:odbc:my_Library";
    Connection databaseConnection = DriverManager.getConnection(sourceURL);
    Statement statement = databaseConnection.createStatement();
         ResultSet authorNames = statement.executeQuery("SELECT distinct Topic FROM tblAvailable_Items order by Topic");
         out.println("<select name = \"Topic" + "\">");
         out.println("<option value = \"" + "\"></option>");
                   while(authorNames.next())
                        out.println("<option value=\""+authorNames.getString("Topic")+"\">"+authorNames.getString("Topic"));
         out.println("</select>");
         authorNames.close();
         databaseConnection.close();
    catch(ClassNotFoundException cnfe)
    out.println(cnfe);
    catch(SQLException sqle)
    out.println(sqle);
    For some reason this prints out a combo box with no entries in it, whereas if I remove the value parts it works fine. I need the value bits though, any ideas?

    The getString("") is a static method on ResultSet, that means, you can only call once per each record. Any further calls to getString() on the same column will return a null.
    So, the solution is, store the value in a variable and reuse it.
    while(authorNames.next())
    String topic = authorNames.getString("Topic");
    out.println("<option value=\""+ topic +"\">"+topic);
    -Srinath

  • VBA Userforms – Getting errors when item from combo box is not selected

    Hi there
    Thank you in advance for taking the time to check this out.
    Objective:
    I have 2 combo boxes, one is dependent on what has been selected in the first combo box (dynamic named range), they work fine except for an irritating error when the user accidentally clicks in the empty
    Cmbox_IncCategory and it won’t allow the user to go back to the
    cmbx_Category_Type box if the user forgot he had to make a selection from that first before selecting the
    Cmbox_IncCategory.
    The error that pops up is “Invalid property value”.
    I tried having text in there to say “please select from Cmbox_IncCategory first, but that didn’t fix it.
    I tried to ‘If error resume next’ but that didn’t like it either. Now I am stumped.
    Main combo box= cmbx_Category_Type
    2nd combo box (displaying a list dependent on what was selected in Main combo box)= Cmbox_IncCategory
    I know there must be a way to fix it so that if a user clicks on the combo box, but doesn’t make a selection it won’t lock up the form.
    Yes, it is a mandatory field, and I was considering using a message box to advise the user that this must be completed, but I am not sure how to do it (and avoid the errors
    Here’s the current code I have for the combo boxes.
    Me.Cmbox_IncCategory = "" 'Clears the contents of the 2nd combobox when another category is chosen
    On Error Resume Next
    'I can't seem to have the Incident Category combobox to be empty when the form is open _
    I have tried Cmbox_IncCategory.Value = "", but I get an error. I then tried Cmbox_IncCategory.text = "" _
    but also get the error. I don't know how else to get it to work .. I tried both codes in the _
    form_initialize, but get an error ... I'm stumped !
    Select Case Me.cmbx_Category_Type
    Case "Crime"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_CRIME"
    Case "Property Damage - Minor - NS"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_PROPRTY_NS"
    Case "Property Damage - Significant - S"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_Proprty_S"
    Case "Safety"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_SAFETY"
    Case "Security Breach"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_BREACH_S"
    Case "Support"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_SUPPORT"
    Case "Vehicle"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_VEHICLE_S"
    End Select
    End Sub
    I’d be really grateful if someone could help me out, or perhaps direct me to where I might find some coding that will achieve the result I am seeking.
    This links to
    My Sample form
    With much gratitude,
    TheShyButterfly
    Hope you have a terrific day, theShyButterfly

    Hi Peter,
    Thank you for your quick response :) Brave man! :)
    Both combo boxes are blank to start with (because nothing has been selected). If I click on the first combo box (cmbx_Category_Type) which lists the main events/category types, but I don't select any thing, and I click in the secondary box
    (Cmbox_IncCategory) and then click on any other control, I get an “Invalid property value” error. When I click OK on the error (a few times) and I return to the code window, it gives no indication where/what is breaking
    the code/causing the error. I have no choice but to exit the form by stopping in the code window.
    If I click on the first textbox, (cmbx_Category_Type), and then do the right thing and make a selection, then I have no problems with the secondary textbox (Cmbox_IncCategory).
    As I am not that up on VBA I am trying to follow your instructions... I have changed the code as follows, removed and replaced the rowsource name, but I encounter the very same problem.
    When I changed my code from Me.Cmbox_IncCategory="" to yours myCombo.ListIndex = -1  (changing the combo box name to reflect my combo box name) and adding the second line of code ...
    Me.Cmbox_IncCategory.ListIndex = 0 I still got the same behaviour and error.
    I even tried moving each row of the named rows down one row (so that there would be a 'blank' row which could be selected to get out of trouble, but it wasn't very successful either.
    Have you opened my form to see what happens, I included the link so whoever was looking at my problem (and yes, I have many I know), could see for themselves what it is doing/not doing.
    The code now reads as below (is this what you meant?) - the results were as I mentioned above.
    Me.Cmbox_IncCategory.ListIndex = -1 'Clears the contents of the 2nd combobox when another category is chosen
    Me.Cmbox_IncCategory.ListIndex = 0
    ' On Error Resume Next
    'I can't seem to have the Incident Category combobox to be empty when the form is open _
    I have tried Cmbox_IncCategory.Value = "", but I get an error. I then tried Cmbox_IncCategory.text = "" _
    but also get the error. I don't know how else to get it to work .. I tried both codes in the _
    form_initialize, but get an error ... I'm stumped !
    Select Case Me.cmbx_Category_Type
    Case "Crime"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_CRIME"
    Case "Property Damage - Minor - NS"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_PROPRTY_NS"
    Case "Property Damage - Significant - S"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_Proprty_S"
    Case "Safety"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_SAFETY"
    Case "Security Breach"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_BREACH_S"
    Case "Support"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_SUPPORT"
    Case "Vehicle"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_VEHICLE_S"
    End Select
    End Sub
    I appreciate your patience :) I am growing in knowledge, but its a slow process. Please let me know if there is anything else I can help clarify for you :)
    This links to
    My Sample form
    Thanking you again
    TheShyButterfly
    Hope you have a terrific day, theShyButterfly

  • Retrieve all values from project type when project type combo box is null

    Hi,
    We are facing a tight situation here. We have a scenario where we have 2 filter options.
    1) Department ID
    2) Project type
    When department ID is selected all the department IDs should be populated in the combo box and the project type combo box should be empty.
    Similarly, when project type is selected all the project types should be populated in the combo box and the department ID combo box should be empty.
    Then, when more than one value is selected from department ID box and all the values from project type must be retrieved from query level (as per business logic).
    How do we do this? Kindly help us with this situation.

    Basically my situation slightly different.
    I am trying to do a bulk insert on SQL Server table using prepared statement, during that time i am getting the exception. I am using JDBC-ODBC driver. However, if i do individual record insertion, it is working.
    Any idea about this type of problem ?
    Regards
    Ramesh

  • Error reading a combo box in SBO 2004

    Hi
    I am trying to check if someone has selected a value in a combo box on the service call screen (origin field). I can read the value fine if the combo box has a value in it, but if the box is empty I get an error 'object variable or with block variable not set'
    Can anyone suggest anything please ?
    Regards Andy

    Hi John
    Thanks for your idea, I will give that a go
    Regards Andy

  • Error with Combo Box, Executing CBTA Script

    Dear Experts.
    I am Using CBTA in solman 7.1 SP 12 to automate the testing with SAP ERP (SAP GUI) and CRM(CRM UI). We are creating the test script without problem, but at time to execute, it suddenly stop.
    We were checking and found that always is failing with a Combo Box field.
    do you know if exist any note to correct this behavior?
    In CRM UI, the script recording create the following component to fill the combo box
    But in the execution CBTA does not fill the field, just try focus in the field, show the values but does not select any.
    At the end show the following error
    IN SAP ERP
    In ERP, the script recording create the following component to fill the combo box
    But in the execution CBTA does not fill the field, just try focusing in the field show the values but does not select any.
    Then the script execution fail  and show  a error, saying the field is read only.
    Br.
    Juan

    Hi every One.
    Finally i got the solution, the error was that i had set up in SAP GUI the option to view the key in the drop down list and the same happened in CRM UI i had set up the same option.
    After shot down this option we record  the escenario again, then we execute it and run without problem.
    Best regards
    Juan

  • Error with combo box

    hi
    my combo  box  returns me a error
    " return without gosub"
    this also happens it I put another combo box in its place
    the error is says  is number 2950
    any help appreciated
    steve

    When that happens, hit Ctrl+Break, so you will break into the debugger. You probably have an inappropriately used "Return" statement. VBA only uses Return in very specific and unusual situations, NOT to return a value from a function.
    Wrong:
    function f() as integer
      return 5
    end function
    Good:
    function f() as integer
      f = 5
    end function
    -Tom. Microsoft Access MVP

  • Creating a combo box to change graph type

    Hello Gurus,
    I need to create a combo box in a web page to change the graph type used. How would I go about to achieve this?
    Thanks.

    ceate the second combo box , at the palce where i will create the first combo boxAs i see .. u dont require two comboboxes in u r case just have to set the combobox with different ComboBoxModel each time u make a selection.
    in listener event of the combobox change the model with setModel function. You can create new model by
    combo1.setModel(new JComboBox(new Object[]{"opt1","opt2","opt3","opt4"}).getModel());

  • Report error when using combo box and one text field is empty

    I'm building an interactive pdf in adobe pro 9. My problem is the following: I have one text field where you can enter a numeric code and that is used to populate another text field when I choose an option on one combo box.For example: suppose I write the code 123 in the text field "A" and that the combo box has two options ("data" and "-"). When I select "-", another text field "B" is empty, while when I select "data" i populate the text field "B" using the code entered "A" with the text "data_123". In order to do this I use the standard javascript code in the Format>Custom tab of the combo-box.
    My questions are:
    - how can I prevent the pdf to proceed selecting an option in the combo box when the field "A" is empty?
    - how can I update the field "B" every time that I change the text in "A"? I found that the text is "B" is updated only when I press the selection in the combo box.

    You can set the combo box to read-only in the Validate event of the A field:
    // Validate script for text field
    getField("combo1").readonly = !event.value;
    To update the value of B when A changes, you can expand the script above to something like:
    // Validate script for text field
    var f1 = getField("combo1");
    var f2 = getField("B");
    // If there is an entry in the A field...
    if (event.value) {
        f1.readonly = false;  // Make sure the combo box is activated
        f2.value = f1.value === "-" ? "" : "fa.value + event.value;  // Update the value of field B
    } else {
        f1.readonly = true;  // Deactivate the combo box
        f2.value = f2.defaultValue;  // Reset field B
    You might also want to reset the combo box somewhere in there, but it's not clear to me when you would want to do that.

  • Error when populating combo box

    I tried to display my data in combo box from my access table but my combo box is empty. Here's my code:
    <% String temp="";     
         Connection conn = null;
         try
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              conn = DriverManager.getConnection("jdbc:odbc:admin_management");
              Statement stmt = conn.createStatement();
              ResultSet rs = stmt.executeQuery("SELECT Virtual_host_name FROM Server_Info");
    %>
    <select name="Server_available">
    <%
    while (rs.next()) {
    temp= rs.getString("Virtual_host_name"); %>
    <%System.out.println("<OPTION VALUE=" + temp + ">" + temp + "\n");%>
    <%}%>
    </select>
    <!-- HEADER STARTS HERE--->
    <%
         catch(SQLException e)
              //out.println("SQLException: " + e.getMessage() + "<BR>");
              while((e = e.getNextException()) != null)
              out.println(e.getMessage() + "<BR>");
         catch(ClassNotFoundException e)
              out.println("ClassNotFoundException: " + e.getMessage() + "<BR>");
         finally
              if(conn != null)
         try
              conn.close();
         catch (Exception ignored) {}
    %>
    Please help me asap. thanks!!

    Instead of "System.out.println" try using "out.println"

  • Adding an event listener to combo box

    I am working on a mortgage calculator and I cannot figure out how to add an event listener to a combo box.
    I want to get the mortgage term and interest rate to calucate the mortgage using the combo cox. Here is my program.
    Modify the mortgage program to allow the user to input the amount of a mortgage
    and then select from a menu of mortgage loans: 7 year at 5.35%, 15 year at 5.50%, and
    30 year at 5.75%. Use an array for the different loans. Display the mortgage payment
    amount. Then, list the loan balance and interest paid for each payment over the term
    of the loan. Allow the user to loop back and enter a new amount and make a new
    selection, with resulting new values. Allow user to exit if running as an application
    (can't do that for an applet though).
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import java.text.NumberFormat;
    import java.util.Locale;
    //creates class MortgageCalculator
    public class MortgageCalculator extends JFrame implements ActionListener {
    //creates title for calculator
         JPanel row = new JPanel();
         JLabel mortgageCalculator = new JLabel("MORTGAGE CALCULATOR", JLabel.CENTER);
    //creates labels and text fields for amount entered          
         JPanel firstRow = new JPanel(new GridLayout(3,1,1,1));
         JLabel mortgageLabel = new JLabel("Mortgage Payment $", JLabel.LEFT);
         JTextField mortgageAmount = new JTextField(10);
         JPanel secondRow = new JPanel();
         JLabel termLabel = new JLabel("Mortgage Term/Interest Rate", JLabel.LEFT);
         String[] term = {"7", "15", "30"};
         JComboBox mortgageTerm = new JComboBox(term);
         JPanel thirdRow = new JPanel();
         JLabel interestLabel = new JLabel("Interest Rate (%)", JLabel.LEFT);
         String[] interest = {"5.35", "5.50", "5.75"};
         JComboBox interestRate = new JComboBox(interest);
         JPanel fourthRow = new JPanel(new GridLayout(3, 2, 10, 10));
         JLabel paymentLabel = new JLabel("Monthly Payment $", JLabel.LEFT);
         JTextField monthlyPayment = new JTextField(10);
    //create buttons to calculate payment and clear fields
         JPanel fifthRow = new JPanel(new GridLayout(3, 2, 1, 1));
         JButton calculateButton = new JButton("CALCULATE PAYMENT");
         JButton clearButton = new JButton("CLEAR");
         JButton exitButton = new JButton("EXIT");
    //Display area
         JPanel sixthRow = new JPanel(new GridLayout(2, 2, 10, 10));
         JLabel displayArea = new JLabel(" ", JLabel.LEFT);
         JTextArea textarea = new JTextArea(" ", 8, 50);
    public MortgageCalculator() {
         super("Mortgage Calculator");                     //title of frame
         setSize(550, 350);                                             //size of frame
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         Container pane = getContentPane();
         GridLayout grid = new GridLayout(7, 3, 10, 10);
         pane.setLayout(grid);
         pane.add(row);
         pane.add(mortgageCalculator);
         pane.add(firstRow);
         pane.add(mortgageLabel);
         pane.add(mortgageAmount);
         pane.add(secondRow);
         pane.add(termLabel);
         pane.add(mortgageTerm);
         pane.add(thirdRow);
         pane.add(interestLabel);
         pane.add(interestRate);
         pane.add(fourthRow);
         pane.add(paymentLabel);
         pane.add(monthlyPayment);
         monthlyPayment.setEnabled(false);
         pane.add(fifthRow);
         pane.add(calculateButton);
         pane.add(clearButton);
         pane.add(exitButton);
         pane.add(sixthRow);
         pane.add(textarea); //adds texaarea to frame
         pane.add(displayArea);
         setContentPane(pane);
         setVisible(true);
         //Adds Listener to buttons
         calculateButton.addActionListener(this);
         clearButton.addActionListener(this);
         exitButton.addActionListener(this);
         mortgageTerm.addActionListener(this);
         interestRate.addActionListener(this);
    public void actionPerformed(ActionEvent event) { 
         Object command = event.getSource();
         JComboBox mortgageTerm = (JComboBox)event.getSource();
         String termYear = (String)mortgageTerm.getSelectedItem();
    if (command == calculateButton) //calculates mortgage payment
         int year = Integer.parseInt(mortgageTerm.getText());
         double rate = new Double(interestRate.getText()).doubleValue();
         double mortgage = new Double(mortgageAmount.getText()).doubleValue();
         double interest = rate /100.0 / 12.0;
         double monthly = mortgage *(interest/(1-Math.pow(interest+1,-12.0 * year)));
                   NumberFormat myCurrencyFormatter;
                   myCurrencyFormatter = NumberFormat.getCurrencyInstance(Locale.US);
                   monthlyPayment.setText(myCurrencyFormatter.format(monthly));
         if(command == clearButton) //clears all text fields
                   mortgageAmount.setText(null);
                   //mortgageTerm.setText(null);
                   //interestRate.setText(null);
                   monthlyPayment.setText(null);
              if(command == exitButton) //sets exit button
                        System.exit(0);
         public static void main(String[] arguments) {
              MortgageCalculator mor = new MortgageCalculator();

    The OP already did this to both JComboBoxes.
    mochatay, here is a new actionPerformed method for you to use.
    I've improved a few things here and there...
    1) You can't just cast the ActionEvent's source into a JComboBox!
    What if it was a JButton that fired the event? Then you would get ClassCastExceptions (I'm sure you did)
    So check for all options, what the source of the ActionEvent actually was...
    2) You can't assume the user will always type in valid data.
    So enclose the Integer and Double parse methods in try-catch brakcets.
    Then you can do something when you know that the user has entered invalid input
    (like tell him/her what a clumsy idiot they are !)
    3) As soon as user presses an item in any JComboBox, just re-calculate.
    I did this here by programmatically clicking the 'Calculate' button.
    Alternatively, you could have a 'calculate' method, which does everything inside the
    if(command==calculateButton) if-block.
    This will be called when:
    a)calculateButton is pressed
    b)when either of the JComboBoxes are pressed.
    public void actionPerformed (ActionEvent event)
            Object command = event.getSource ();
            if (command == calculateButton) //calculates mortgage payment
                int year = 0;
                double rate = 0;
                double mortgage = 0;
                double interest = 0;
                /* If user has input invalid data, tell him so
                and return (Exit from this method back to where we were before */
                try
                    year = Integer.parseInt (mortgageTerm.getSelectedItem ().toString ());
                    rate = new Double (interestRate.getSelectedItem ().toString ()).doubleValue ();
                    mortgage = new Double (mortgageAmount.getText ()).doubleValue ();
                    interest = rate / 100.0 / 12.0;
                catch (NumberFormatException nfe)
                    /* Display a message Dialogue box with a message */
                    JOptionPane.showMessageDialog (this, "Error! Invalid input!");
                    return;
                double monthly = mortgage * (interest / (1 - Math.pow (interest + 1, -12.0 * year)));
                NumberFormat myCurrencyFormatter;
                myCurrencyFormatter = NumberFormat.getCurrencyInstance (Locale.US);
                monthlyPayment.setText (myCurrencyFormatter.format (monthly));
            else if (command == clearButton) //clears all text fields
                /* Better than setting it to null (I think) */
                mortgageAmount.setText ("");
                //mortgageTerm.setText(null);
                //interestRate.setText(null);
                monthlyPayment.setText ("");
            else if (command == exitButton) //sets exit button
                System.exit (0);
            else if (command == mortgageTerm)
                /* Programmatically 'clicks' the button,
                As is user had clicked it */
                calculateButton.doClick ();
            else if (command == interestRate)
                calculateButton.doClick ();
            //JComboBox mortgageTerm = (JComboBox) event.getSource ();
            //String termYear = (String) mortgageTerm.getSelectedItem ();
        }Hope this solves your problems.
    I also hope you'll be able to learn from what I've indicated, so you can use similar things yourself
    in future!
    Regards,
    lutha

  • Combo box select default value.

    Hi,
    I am using Combo box to display the status of the document.
    my code is
    oForm = SBO_Application.Forms.Item("I8_BGU_")
                            Dim oCombo1 As SAPbouiCOM.ComboBox
                            oForm.DataSources.UserDataSources.Add("ComboSrc5", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1)
                            'oItem = oForm.Items.Item("21")  ''for accessing the combo box item
                            oCombo1 = oForm.Items.Item("21").Specific
                            '' to bind the combo box item to defined user data source
                            oCombo1.DataBind.SetBound(True, "", "ComboSrc5")
                            ''giving some static values to combobox
                            oCombo1.ValidValues.Add("Open", "Open")
                            oCombo1.ValidValues.Add("Closed", "Closed")
                            oCombo1.ValidValues.Add("Extended", "Extended")
                            ' oCombo.Select("Open")
                            oCombo1.Select("Open", SAPbouiCOM.BoSearchKey.psk_ByValue)
                            oForm.Items.Item("21").Specific.DataBInd.SetBound(True, "@I8_BGU", "U_STATUS")
                            oCombo1.Select("Open")
    In this code when it reaches last lineof line it is throwing  error.
    Object refertence not set to any instance..
    some time it is throwing
    error,,
    " Unble to cast COM object sbouiCom.itemeventClas to Interface Type IItemevent. This application Cal is failed.
    The same logic working form for another form..
    Is there any modification needed.
    Please.. get to me..
    mahi.

    Hi Mahendra,
    In case of selecting a default value in a combo, it has 2 parameters to be passed.  Its as below.
    objCombo.Select(0, SAPbouiCOM.BoSearchKey.psk_Index)
    Replace this with proper value (1st parameter).  It will work.
    I find that you have already used that line.  So you can remove your last line.
    Best Regards,
    satish. B.
    Edited by: satish b on Jan 12, 2010 8:35 AM

  • I have to combo box content change based on the selection on the other

    I have huge unsolve problem where by I have to combo box change content of the combo box based on the selection in the first combo box . The problem is The value changes do not have effect on the second combo box. Below is the content of the coding used for both the combo box.
    function setReasonCode(obj){
                         <%String sql_query3 = "SELECT DISTINCT (ir_tran_typ) "+
                                              "  FROM intrcd ";
                               System.out.println("trans type"+sql_query3 );           
                                try{
                                    rset = db.execSQL(sql_query3);
                                catch(SQLException e) {
                                    System.err.println("Error in query - intrcd - transaction_main.jsp " +e +" sql " +sql_query3);
                                while(rset.next()){
                                    tran_cde = rset.getString("ir_tran_typ");
                                            tran_typ.addElement(rset.getString("ir_tran_typ"));
                                            System.out.println("trans type 34 "+tran_typ );%>
                                            <% }%>
                                          alert(obj.value);
                                  <%for(int i=0 ;i<tran_typ.size();i++){
                                     System.out.println("trans type 222  "+ tran_typ.size());
                                       tran_cde =tran_typ.elementAt(index).toString();%>
                                       <%System.out.println("trans type before "+ tran_cde);%> 
                                        eval(document.all.tran_cde.option
                                      if(D == <%=tran_cde%> ){
                                       <%System.out.println("trans type D"+ tran_cde);%>     
                                       <%String sql_query2 = "SELECT ir_rea_cde,ir_rea_desc"+
                                              "  FROM intrcd"+
                                              " WHERE ir_tran_typ = 'D' " +
                                                        " ORDER BY ir_rea_cde ";
                               System.out.println("query"+ sql_query2);           
                                try{
                                    rset = db.execSQL(sql_query2);
                                catch(SQLException e) {
                                    System.err.println("Error in query - emmast2 - transaction_main.jsp " +e +" sql " +sql_query2);
                                        index = 1;
                                while(rset.next()){
                                        rea_cde = rset.getString("ir_rea_cde");
                                        rea_desc =  rset.getString("ir_rea_desc");
                                       tran_typ.removeAllElements();
                                       }%>
                                  if( R == obj.value){
                                       alert(R)
                                      if(R== <%=tran_cde%> ){
                                       <%System.out.println("trans type R"+ tran_cde);%>     
                                       <% sql_query2 = "SELECT ir_rea_cde,ir_rea_desc"+
                                              "  FROM intrcd"+
                                              " WHERE ir_tran_typ = 'R' " +
                                                        " ORDER BY ir_rea_cde ";
                               System.out.println("query 2"+ sql_query2 );           
                                try{
                                    rset = db.execSQL(sql_query2);
                                catch(SQLException e) {
                                    System.err.println("Error in query - intrcd - transaction_main.jsp " +e +" sql " +sql_query2);
                                        index = 1;
                                while(rset.next()){
                                        rea_cde = rset.getString("ir_rea_cde");
                                        rea_desc =  rset.getString("ir_rea_desc");
                                       }%>
              <%}%>
                }

    Not unless you know which file in the app sets the choices. I've been through it pretty thoroughly and can't find the one.

  • Silver Combo Box Display Style Bug

    [LV2011, Windows XP]
    There appears to be a small bug with the Silver-style Combo Box control when you right-click and select Visible Items->Display Style.  For the string control a glyph appears properly, but for the combo box the glyph appears in the wrong place, and the colours are wrong.  In fact, the glyph only appears properly if you click on it, or do something else to force a redraw of the control.
    This combo box is a bit confusing, since it has no "Radix Shadow" part like the string control does, and in fact only the Silver-style combo box lets you display the "Display Type" glyph.  The other styles of combo box have no "Display Type" feature in the "Visible Items" menu, but the "Display Style Visible" checkbox does appear on the "Appearance" tab of the Properties dialog box (though checking it has no effect, and it appears unchecked if you re-launch the dialog box".
    I've attached a new version of the control which is close to fixing the bug, but the glyph region is 1 pixel skinnier than the string version.  Copy this to your "..\vi.lib\silver_ctls\String" folder if you want it to replace the version in the palettes.
    Jaegen
    Solved!
    Go to Solution.
    Attachments:
    Combo Box NI_Silver.ctl ‏6 KB

    Jaegen:
    Good catch, there is now a Corrective Action Request filed for this issue. It is correct that this property is
    not supported by the Combo Box found in the Modern Palette. However, this should at least be documented in the
    "Display Style Visible" property documentation if this is case, which it is not.
    Thanks for alerting us to this error and if you would like to follow the CAR, look for CAR# 312717 listed in
    bug fix reports for later releases of LabVIEW.
    Please let me know if you have any questions or need any more help with this issue.
    Tori W.
    National Instruments

  • Need Help. Data jumps between Combo Boxes in an ADG

    I have an item renderer in an advanced datagrid.
    <mx:AdvancedDataGridColumn
        dataField="USE_TYPE_DESC"
        headerText="Use Type"
        rendererIsEditor="true"
        itemRenderer="renderers.tpUseTypeDropDown"
        editorDataField="getData"/>
    But the data that gets displayed in the combo boxes, appear to jump between CBs when you scroll the ADG up and down. The physical data is fine, its just the displayed data that is wrong.. Any ideas

    Ok, I tried this but still getting an error
    <cfquery datasource="mydb" name="test">
    Select name from mytable
    where
    <cfqueryparam value=#createodbcdate(edate)# cfsqltype="CF_SQL_DATE"> Between '01/01/2011' AND '01/01/2013'
    </cfquery>
    <cfoutput query="test">
    #ename#
    </cfoutput>
    now I get
    An error occurred while evaluating the expression:
    "#createodbcdate(edate)#"
    Error near line 3, column 53.
    Error resolving parameter EDATE

Maybe you are looking for