Populating List Boxes

Azadi – Thanks for your HELP on my last problem.
– This is the Old Dog Playing a Young persons game! And
loving It! Using CF8 and MySQL 5
New?? List Boxes, or drop-down Combo list Boxes, could you or
someone direct me in the proper direction for information on how to
Populate a list box or combo box based on the input of the previous
list box?? Example Enter From Selection - Southern Gulf Coastal
States - All the State in the Southern Gulf Coast would populate
the next combo box, and select a State and all the Coastal Cities
would be of choice and next after cities is the Zip.
I know how to do it in MS Access not sure the best way to
attack this in cf8.
Thanks

There are many ways to do this:
1. By submitting your data to cf server first and query only
according to user selection then populate the target fields
according to query.
2. By querying all data and use javascript
variables/arrays/structures to populate your combo box everytime
user change the selected item.
3. By incorporating Ajax to your CF application.
The first one is the easiest one. But everytime you make
changes to your selection, your app submits to cf server which is
kind of slow 'cause you have to submit everytime selection changes.
The second one is by querying all the data, which is slow at
first 'coz even the unnecessary data are returned. That is, I don't
think the user would try to select all the selections one by one,
but rather maybe just select one item. Though, it will be faster
already when the user selects another item. This way, your form
doesn't have to be re-submitted 'coz you let a javascript
variable/arrays/structures store the data at first query.
The third one(kind of a mix of both 1 and 2), which is the
most efficient way among the three to achieve your goal, needs
learning Ajax which is going to take a few of your time. But if you
know it already, you can let it work well with CF8.
Anyway, a simple sample code for the first method is
attached:

Similar Messages

  • Dynamically populating List box

    Hello Everyone:
    I need to create a JSP with two combo boxes and submit button.
    Where the first combo box will be updated from database - which is simple.
    but depending on the selection of the first box the second box should be populated and should be able to make multiple selections in it.
    and in the same jsp page should be able to display the results, of what I added by submiting the previous form.
    Please can somebody help me witha sample.
    Thanks
    ASB

    Dear user,
    If you get any response for the asked question on Dynamically populating List box from anybody please forward the reply to the following e-mail id.
    [email protected]
    --SUBIR                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Removing Items from Populated List-Box

    I have a drop down box populate a list box. (change: ListBox1.addItem(xfa.event.newText)) But I can add more then one of the same selection so how do I remove them from the ListBox. Upon click? somehow? I don't konw the lingo.

    There is a selectedIndex property that will give you back the index of the 1st item that is selected.
    Paul

  • [b] Populating List Box from MySQL Database[/b]

    Hi all,
    I'm trying to populate a JComboBox from MySQL database, I Have an applet which send's the query to a server through sockets on the localhost, but when i try to retrieve the result set from the MySQL database, i get an index out of bounds exception, It's probably something simple, any help regarding the above problem!! I've included the code below!!
    Cheers
    Dave
    java.lang.ArrayIndexOutOfBoundsException: 1
    at dbWrapper1.Select(dbWrapper1.java:97)
    at TestUpdateDB.main(TestUpdateDB.java:29)
    Applet Code:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import java.util.*;
    import java.io.*;
    import java.net.*;
    *     @version  04/18/05
    *     @author David Lawless
    public class cust extends JApplet implements ActionListener
    //Declare Labels for Form
    private JLabel titleLabel;
    private JLabel firstNameLabel;
    private JLabel lastNameLabel;
    private JLabel addressLabel;
    private JLabel countyLabel;
    private JLabel countryLabel;
    //Declare Input fields for user
    private JTextField firstNameText;
    private JTextField lastNameText;
    private JTextField addressLineOneText;
    private JTextField addressLineTwoText;
    private JTextField addressLineThreeText;
    //Declare list for title box
    private JComboBox titleList;
    private String[] title = {"Mr.","Mrs.","Miss","Ms","Dr."};
    //Declare list for county box
    private JComboBox countyList;
    //Called when this applet is loaded into the browser.
    public void init()
    lookAndFeel();
    //Initialise Labels
    firstNameLabel = new JLabel("First Name * ");
    lastNameLabel = new JLabel("Last Name * ");
    titleLabel = new JLabel("Title * ");
    addressLabel = new JLabel("Address *");
    countyLabel = new JLabel("County *");
    countryLabel = new JLabel("Country *");
    //Initialise title List
    titleList = new JComboBox( title );
    titleList.setActionCommand("Title");
    //Set up Text fields
    firstNameText = new JTextField(30);
    firstNameText.setToolTipText("Please enter your first name here");
    lastNameText = new JTextField(30);
    lastNameText.setToolTipText("Please enter your surname here");
    addressLineOneText = new JTextField(30);
    addressLineTwoText = new JTextField(30);
    addressLineThreeText = new JTextField(30);
    //Retrieve County List From Database
    //countyList = new JComboBox( counties );
    try
         try
              Socket mySocket = new Socket ("127.0.0.1", 1983 );
              ObjectOutputStream out = new ObjectOutputStream(mySocket.getOutputStream());
              String entry1 ="SELECT county FROM data";
              out.writeObject(new String(entry1));
              ObjectInputStream in = new ObjectInputStream(mySocket.getInputStream());
              int size = in.readInt();
              Object [] results = new Object[size];
              for (int i=0; i < size  ; i++ )
                   results[i] = in.readObject();
              countyList = new JComboBox( results );
              countyList.setActionCommand("County");
              mySocket.close ();
         catch (Exception exp)
              exp.printStackTrace();
    // detect problems interacting with the database
    catch ( Exception sqlException )
         System.exit( 1 );
    //set up command buttons
    submitButton = new JButton("Submit");
    submitButton.setToolTipText("Click here to submit your details ");
    submitButton.addActionListener(this);
    cancelButton = new JButton("Cancel");
    cancelButton.setToolTipText("Click here to cancel order");
    cancelButton.addActionListener(this);
    Container topLevelContainer = getContentPane();
    getContentPane().setBackground(Color.blue);
    //Create Layout
    JPanel contentPane = new JPanel();
    //Set transparent background instead of blue
    contentPane.setBackground(Color.white);
    contentPane.setLayout(null);
    contentPane.setOpaque(true);
    titleLabel.setBounds(37,10,75,20);
    contentPane.add(titleLabel);
    firstNameLabel.setBounds(93,10,100,20);
    contentPane.add(firstNameLabel);
    lastNameLabel.setBounds(198,10,100,20);
    contentPane.add(lastNameLabel);
    titleList.setBounds(37,35,50,20);
    contentPane.add(titleList);
    firstNameText.setBounds(93,35,100,20);
    contentPane.add(firstNameText);
    lastNameText.setBounds(198,35,100,20);
    contentPane.add(lastNameText);
    addressLabel.setBounds(37,65,100,20);
    contentPane.add(addressLabel);
    addressLineOneText.setBounds(37,90,125,20);
    contentPane.add(addressLineOneText);
    addressLineTwoText.setBounds(37,115,125,20);
    contentPane.add(addressLineTwoText);
    addressLineThreeText.setBounds(37,140,125,20);
    contentPane.add(addressLineThreeText);
    countyLabel.setBounds(37,165,100,20);
    contentPane.add(countyLabel);
    countyList.setBounds(37,190,100,20);
    contentPane.add(countyList);
    submitButton.setBounds(60,250,100,20);
    contentPane.add(submitButton);     
    cancelButton.setBounds(180,250,100,20);
    contentPane.add(cancelButton);
    topLevelContainer.add(contentPane);
    }//End init()
    static void lookAndFeel()
         try
              UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
         catch(Exception e)
    }//End look and feel method
    public synchronized void actionPerformed(ActionEvent e)
    String actionCommand = e.getActionCommand();
    if (e.getSource() instanceof JButton)
         if (actionCommand.equals("Cancel"))
                   int returnVal = JOptionPane.showConfirmDialog(null,
                        "Are you sure you want cancel and discard your order?",
                        "Cancel Order", JOptionPane.YES_NO_OPTION);
                   if(returnVal == JOptionPane.YES_OPTION)
                        System.exit(0);
         if (actionCommand.equals("Submit"))
              firstName = firstNameText.getText();
              Surname = lastNameText.getText();
         }//end action command for submit button
    }//end method actionperformed
    }//End class customerDatabase Connection Code:
    import java.sql.*;
    import java.util.*;
    class dbWrapper1
        private Statement statement;
        private Connection connection;
        private String strUserName;
        private String strPassword;
         Object [] results = null;
         static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
         static final String DATABASE_URL = "jdbc:mysql://localhost:3306/ecommerce";
        public dbWrapper1()
            // the DSN for the Db connection
            strUserName = "root";
            strPassword = "password";
        public void Open()
            try
                // Load the jdbc-odbc bridge driver
                Class.forName ( JDBC_DRIVER );
                   //                    ***** TESTING PURPOSES *****
                   //Check currently loaded drivers
                   System.out.println("Currently loaded drivers...");   
                   for
                        Enumeration enum1 = DriverManager.getDrivers() ;
                        enum1.hasMoreElements();
                   System.out.println(enum1.nextElement().getClass().getName());
                // Attempt to connect to a driver.
                connection = DriverManager.getConnection ( DATABASE_URL, strUserName, strPassword );
                // Create a Statement object so we can submit
                // SQL statements to the driver
                statement = connection.createStatement();
            catch (SQLException ex)
                while (ex != null)
                    System.out.println ("SQL Exception:  " + ex.getMessage () );
                    ex = ex.getNextException ();
            catch (java.lang.Exception ex)
                ex.printStackTrace ();
        public void Update( String strUpdate )
            try
                // Submit an update or create
                statement.executeUpdate( strUpdate );
              catch (SQLException ex)
                while (ex != null)
                    System.out.println ("SQL Exception:  " + ex.getMessage () );
                    ex = ex.getNextException ();
        public Object[] Select( String strQuery )
            try
                // Submit a query, creating a ResultSet object
                ResultSet resultSet = statement.executeQuery( strQuery );
                // process query results
                   ResultSetMetaData metaData = resultSet.getMetaData();
                   int numberOfColumns = metaData.getColumnCount();
                   results = new Object[numberOfColumns];
                   while ( resultSet.next() )
                        for ( int i = 1; i <= numberOfColumns; i++ )
                             results[i] = resultSet.getObject(i);
                             System.out.print(resultSet.getString(i) + " | " );
                        System.out.println();
                   resultSet.close();
            catch (SQLException ex)
                while (ex != null)
                    System.out.println ("SQL Exception:  " + ex.getMessage () );
                    ex = ex.getNextException ();
              for (int i=0;i<results.length ;i++ )
                   System.out.println(results);
              return results;
    public void Close()
    try
    statement.close();
    connection.close();
    catch (SQLException ex)
    while (ex != null)
    System.out.println ("SQL Exception: " + ex.getMessage () );
    ex = ex.getNextException ();
    Server Code:
    import java.io.*;
    import java.net.*;
    public class TestUpdateDB
         public static void main(String[] args)
              System.out.println ( "Server is active" );
              try {
              ServerSocket sock = new ServerSocket ( 1983 );
              while ( true )
                   try
                        Socket mySock = sock.accept();
                        ObjectInputStream iStream = new ObjectInputStream(mySock.getInputStream());
                        ObjectOutputStream oStream = new ObjectOutputStream(mySock.getOutputStream());
                        Object temp = iStream.readObject();
                        String entry = (String)temp;
                        System.out.println ( entry );
                        dbWrapper1 myDB = new dbWrapper1();
                        myDB.Open();
                        Object [] query = myDB.Select(entry);
                        int size = query.length;
                        oStream.writeInt(size);
                        for (int i=1 ; i <= query.length ; i++)
                             oStream.writeObject( query );
                        myDB.Close();
                   catch ( Exception exp )
                        exp.printStackTrace ();
              catch ( Exception exp ) {
                exp.printStackTrace();

    Sir,
    The exception is probably in here.
    for ( int i = 1; i <= numberOfColumns; i++ ){
      results[i] = resultSet.getObject(i);
      System.out.print(resultSet.getString(i) + " | " );
    }ResultSet counting begins with 1 but array indexing begins with 0 your code should look more like.
    for ( int i = 0; i <= numberOfColumns; i++ ){
      results[i] = resultSet.getObject(i+1);
      System.out.print(resultSet.getString(i+1) + " | " );
    }Sincerely,
    Slappy

  • Is this a Bug? List Box do not scrollbar: Magic number 2461

    In my case I am populating list box from database using script. I noticed strange behavior with List Box being populated more than 2461 list items. At run time List box do not display scrollbar if the list items are more than 2461. Looks like 2461 is the Magic number. I wonder if some one already noticed this behavior. I want to see the scrollbar irrespective of number of list items. In my case I need to load approximately 5000 list items. Any one has suggestions? Is it designed to behave like this or is this a Bug?
    Thanks in Advance.
    SekharN.

    Hi,
    I noticed it too !
    I have several lists, some oh theme have more than 2460 items and don't have the scroll bar.
    An other problem relative to scrollBar in listBox appeared : with Reader 8, i can't use the scroll bar (even if i have less than 2460 items); it appears but i can't scroll.
    I see tthe french adobe team about these 2 problems next week. If we find something new, i'll tell you.
    Pierre.

  • Warning using DWR to populate list box

    hi all,
    iam trying to use DWR for populating list box wen a check box is checked.iam using Tomcat 4.1 & j2sdk 1.4.2
    but iam getting an alert: illegal access to default constructor Aug 20, 2006 6:30:43 PM uk.ltd.getahead.dwr.util.CommonsLoggingOutput warn
    WARNING: Method execution failed:
    java.lang.InstantiationException: Illegal Access to default constructor
            at uk.ltd.getahead.dwr.create.NewCreator.getInstance(NewCreator.java:62)
            at uk.ltd.getahead.dwr.impl.ExecuteQuery.execute(ExecuteQuery.java:172)
            at uk.ltd.getahead.dwr.impl.DefaultExecProcessor.handle(DefaultExecProce
    ssor.java:48)
            at uk.ltd.getahead.dwr.impl.DefaultProcessor.handle(DefaultProcessor.jav
    a:81)
            at uk.ltd.getahead.dwr.AbstractDWRServlet.doPost(AbstractDWRServlet.java
    :162)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:247)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:193)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:256)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:191)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
    2415)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:180)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
            at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
    rValve.java:171)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:641)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:172)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:641)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
    ve.java:174)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:22
    3)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
    :594)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
    ssConnection(Http11Protocol.java:392)
            at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
    :565)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
    ool.java:619)
            at java.lang.Thread.run(Thread.java:534)
    Aug 20, 2006 6:30:43 PM uk.ltd.getahead.dwr.util.CommonsLoggingOutput warn
    WARNING: Erroring: id[53_1156078843109] message[uk.ltd.getahead.dwr.OutboundVari
    able@497904]my code goes here,
    package db;
    import java.util.*;
    class ArrayL 
         public ArrayL()
              System.out.println("In constructor");
         public ArrayList getA(String x)
              ArrayList al=new ArrayList();
              al.add("1");
              al.add("6");
              al.add("42");
              al.add("16");
              al.add("3");
              System.out.println("al-------"+al);
              return al;
         public int[] getNumbers(boolean big)
            if (big)
                return new int[]
                    1000, 2000, 3000, 4000
            else
                return new int[]
                    1, 2, 3, 4, 5, 6, 7, 8, 9, 10
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
        "http://www.getahead.ltd.uk/dwr/dwr10.dtd">
    <dwr>
      <allow>
        <create creator="new" javascript="Demo" scope="session">
          <param name="class" value="uk.ltd.getahead.dwr.Demo"/>
        </create>
         <create creator="new" javascript="ArrayL" scope="session">
          <param name="class" value="db.ArrayL"/>
        </create>
      </allow>
    </dwr>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <script type='text/javascript'
        src='/ajax1/dwr/engine.js'></script>
    <script type='text/javascript'
        src='/ajax1/dwr/interface/ArrayL.js'></script>
    <script type='text/javascript'
        src='/ajax1/dwr/util.js'></script>
         <SCRIPT type='text/javascript'>
         <!--
                   function continentSelected()
                        var searchexp = $("continent").value;
                        ArrayL.getNumbers(searchexp, displayItems);
                        return false;
                   function displayItems(items)
                        DWRUtil.removeAllOptions("country");
                      DWRUtil.addOptions("country", data);          
                        if (items.length == 0)
                             alert("No matching products found");
                             $("country").style.visibility = "hidden";
         //-->
         </SCRIPT>
    </HEAD>
    <BODY>
      <FORM NAME="countryform" ID="countryform" ACTION="doCountry" METHOD="POST">
        <SELECT name="continent" id="continent" onChange="continentSelected();">
          <OPTION VALUE="Africa">Africa</OPTION>
          <OPTION VALUE="America">America</OPTION>
          <OPTION VALUE="Asia">Asia</OPTION>
          <OPTION VALUE="Australia">Australia</OPTION>
          <OPTION VALUE="Europe">Europe</OPTION>
        </SELECT>
        <SELECT name="country" id="country">
        </SELECT>
    </BODY>
    </HTML>can any one help with this problem
    Thank u in advance

    I'm not sure if the code you display is 'Exactly' how it is written.
    If it is:
    1) The class needs to be public (i.e. public class ArrayL {.....})
    2) In the code below, the value of searchexp is a string
               var searchexp = $("continent").value;
              ArrayL.getNumbers(searchexp, displayItems); but the function
    public int[] getNumbers(boolean big) takes a boolean.
    3) In the call DWRUtil.addOptions("country", data); 'data' isn't defined did you mean 'items'?
    Finally in the statement that you have if (items.length == 0) I have found that does not work with Collections (at least Maps) returned from a method to DWR (as of 1.1.3).
    Good luck

  • List boxes as filter

    Hi,
    I’m developing an asp page containing a form with two
    dynamically populated list boxes and a submit button. The submit
    button should open up another asp page with results filtered by
    criteria determined by the contents of the 2 list boxes. I can
    populate the list boxes OK but I am not sure about how to use the
    selected values as the filter. Can anyone point me in the right
    direction?
    Thanks,
    Chris

    Select * WHERE IDFieldName <> Variable1 && / OR
    IDFieldName <> Variable2
    You can set your variables in the advanced section of your
    recordset box.
    Check your SQL as the above is just 'pseudo' (I alway shave
    to check SQL,
    for some reaons can never remember it quite right). The
    recordset box will
    help you to find the right way to access your variables -
    URL/Form/Session,
    etc.
    HTH,
    Jon
    "Chris_HSL" <[email protected]> wrote in
    message
    news:e9o4r0$bbi$[email protected]..
    > Hi,
    >
    > I?m developing an asp page containing a form with two
    dynamically
    > populated
    > list boxes and a submit button. The submit button should
    open up another
    > asp
    > page with results filtered by criteria determined by the
    contents of the 2
    > list
    > boxes. I can populate the list boxes OK but I am not
    sure about how to use
    > the
    > selected values as the filter. Can anyone point me in
    the right direction?
    >
    > Thanks,
    >
    > Chris
    >

  • Flash Lite 2 component:XML List Box Lite for Dynamic Flash Lite 2 application

    XML ListBox Lite is the Flash Lite UI component lets you
    create XML driven dynamic lists for your Flash Lite 2 mobile
    applications!
    XML ListBox Lite is a Flash component for Flash Lite 2.0
    application development for mobile phones. Creating a lightweight
    dynamic list box for Flash Lite application becomes as easy as a
    snap using this component. Now no more the Flash Lite application
    developers need to be worried about creating dynamically populated
    list box that will work on nearly every symbian series 60 models
    which support Flash Lite 2.0.
    XML ListBox Lite comes handy when you plan to create a
    dynamic list which is populated with the data sourced from a simple
    XML file , such creating a play list for your Flash Lite MP3 Player
    application, creating a list for a shopping catalogue etc.
    XML ListBoxLite is a complete solutions for creating
    customized xml driven dynamic lists in Flash Lite 2 mobile
    application development.
    The basic features of the component are:
    Create Unlimited Number of Tabs: XML ListBoxLite can populate
    any number of tabs and provides proper visualization and navigation
    of these tabs.
    Fully Functional Scrollbars: The scrollbars position ratio is
    auto adjusted by the number of tabs that appear in the list, which
    gives the users whether any tabs are left in the list to scroll.
    Display Tabs as per needs: This list component allows you to
    display any number of tabs from the range of 8, 4, 2 and 1, at any
    instance. This serves the need for example when you have more text
    to display you can choose 4 or 2 tabs so that you need not
    compromise on the content side.
    Customize the Look and Feel: You can set any color as
    parameters for different elements of this list component so that it
    will fit your application seamlessly.
    Virtually zero time to implement: This component does not
    require any extra programming in FlashLite 2.0 Action script to
    display your contents. Just update the xml list and it is ready for
    use.
    Lightweight and User friendly: XMLListBoxLite offers you
    great glossy look and advanced features within just 17 KB . The
    user experience is also magnetic.
    More details at:
    http://esspl.com/flashcomponents/xmllistboxlitehome.asp

    Hello there,
    I am have a similar kind of problem. I am trying to run a video on Pocket PC (WM5) using video.play() method on FlashLite 2.1. It works fine in Device Central and my Nokia mobile (symbian OS with default FlashLite 2.1). Video is obviously embedded in FlashLite 2.1 and was originally in *.3gp format.
    Can you please help me where I am going wrong or what am I missing ?
    As ever,
    Vinayak Kadam

  • Populating fields based on list box values

    I have created an application based off of a table and so the 1st page is the actual report and the 2nd page is the data entry form. I have changed the form elements (like text box to select list) etc.
    I need to have (2) text box fields populated based on the value from the 2nd select list box. I created a pl/sql page process that will check the value of the select list and assign values to the text boxes. This is triggered when a POPULATE button is pressed.
    When I select a truck number in the select list - nothing happens and the original select list values get reset back to original. There is another button used in order to insert the data so that's why I figured I needed to add another button to trigger the population of the text boxes from a table. Here is my pl/sql page process used to populate:
    BEGIN
    SELECT dr1_name, dr2_name
    INTO
    :P2_DRIVER_1, :P2_DRIVER_2
    FROM
    active_drivers a
    WHERE
    :P2_DRIVER_CODE = a.code;
    END;
    It is set to fire on submit - before computations and validations.
    Regards,
    Jeff

    Not sure if this is the best way but it works for me……
    Make P2_DRIVER_CODE be a form element of Select List with Submit
    Create 2 items, P2_DRVR1 and P2_DRVR2, of form element Hidden
    Edit the P2_DRIVER_1 item. In the source region enter :P2_DRVR1 in Post Calculation Computation.
    Edit the P2_DRIVER_2 item. In the source region enter :P2_DRVR2 in Post Calculation Computation.
    Create a page rendering computation for item: P2_DRVR1.
    Type: SQL Query
    Computation Point: Before Header
    Computation: SELECT dr1_name FROM active_drivers a WHERE a.code = :P2_DRIVER_CODE
    Create a page rendering computation for item: P2_DRVR2.
    Type: SQL Query
    Computation Point: Before Header
    Computation: SELECT dr2_name FROM active_drivers a WHERE a.code = :P2_DRIVER_CODE
    When an item is selected in P2_DRIVER_CODE the page will submit/refresh, causing the computations to be fired. P2_DRIVER_1 and P2_DRIVER_2 will be populated by the return of the queries in the computations respectively.
    P2_DRIVER_1 and P2_DRIVER_2 are still editable by the user (unless you define them as read only) but if you have another select list with submit on the form, if used, the page will refresh and the computation will run again overwriting what the user has entered.
    Suppose I want the user to be able to change the defaults and keep from losing them (changed back to default) in case another item submits/refreshes the page.
    Create a hidden item P2_DRIVER_CODE_CHANGE with the source of: Static Text. For the Default Value enter &P2_DRIVER_CODE. (include the period after &P2_DRIVER_CODE)
    Edit the P2_DRVR1 and P2_DRVR2 computations and in the Conditional Computations region set:
    Condition Type: Text in Expression 1 != Expression 2 (include &ITEM substitutions)
    Expression1: &P2_DRIVER_CODE.
    Expression2: &P2_DRIVER_CODE_CHANGE.
    Hope this works for you,
    Jeff

  • Remaining Information after populating data in a list box

    Hi Guys,
    I have a small problem. Actually  I thought everything works perfect but as i saved or sent the form and opened it again the populated information was gone. I was shocked.
    I give you short function of my form.
    I type in texfield "Type" "a" or "b" a dropdown list with A, B, C appears. If I select A ,B or C or all of them then this information appears in a list box. that's perfect so far, but when I save this pdf file or send it to someone and open it, then the selected information is gone. this is horrible!
    Does anyone know what's going on wrong??
    I think the information should remain otherwise the function doesnt make sense.
    I appreciate it a lot if someone can help me to solve this problem!
    Thanks in advance!
    Diana

    You can assign the xfa.event.newText to a variable then you can reuse the var as required and you can set each of the listboxes according. The code would look something like this:
    var ListBoxSelection = xfa.event.newText;
    Com.addItem(ListBoxSelection);
    Com1.addItem(ListBoxSelection);
    Or I have completly misunderstood why you cannot set both ListBoxes.
    paul

  • Values not populating in list box in dialog programing.

    hi,
    i am facing a problem i.e. i am having a listbox on screen , in pbo i am filling that listbox with some values in an internal table.
    But i am not able to populate the values i.e. while i am debugging the pai ......the list box is containing nothing.
    So needed some help in this issue.
    regards,
    somesh

    Hi,
    Try to read these links. It will give you some pointers regarding on your problem.
    <link-farm removed>
    Revert if you have still any concern.
    Thanks,
    iostreamax
    Edited by: Suhas Saha on Feb 21, 2012 8:50 AM

  • Populating the List Box

    HI EVERY BODY ,
    I HAVE TWO VALUES WITH ME AND I HAVE TO POPULATE IT IN TO THE LIST BOX AS SELECTED AND SHOW THE OTHER AS UNSELECTED .
    VALUES LIKE MON,TUE .
    <SELECT MULITPLE>
    <OPTION VALUE="MON">MONDAY</OPTION>
    <SELECT MULITPLE>
    <OPTION VALUE="TUE">TUESDAY</OPTION>
    <SELECT MULITPLE>
    <OPTION VALUE="WED">WEDNESDAY</OPTION>
    <SELECT MULITPLE>
    <OPTION VALUE="THUS">THURDAYDAY</OPTION>
    </SELECT>

    ya sorry thats rite. But the thing is i have two values in a String tokenizer like (mon,Tue) for example .
    if you have a for loop to that select multiple
    like
    <select multiple>
    <%
    if(token.hasMoreElement())
    String val=token.nextElement();
    %>
    <option value="mon" <%if(val.equalIgnoreCase("Mon")}{%> selected="selected" <%}%> ></option>
    <option value="tue" <%if(val.equalIgnoreCase("tue")}{%> selected="selected" <%}%> ></option>
    <option value="wed" <%if(val.equalIgnoreCase("wed")}{%> selected="selected" <%}%> ></option>
    <option <%if(val.equalIgnoreCase("Mon")}{%> selected="selected" <%}%> ></option>
    <%}%>
    </select>
    Here if the value that i have get selected is two in the list then the loop will go twice and so the list viewed twice with each selected value .
    Thats the problem i am facing here .

  • Populating a Dynamic List Box in CRM Survey

    Hi All,
    I am currently creating a CRM Survey and am trying to use the 'Dynamic List Box with Single/Multiple Selection' options, but cannot see how i can populate these lists. I get the following error message when selecting the 'Insert Answer Option:
    'Dynamic list boxes' cannot contain statistical answer options'
    I have tried this through both Survey Suite and UI, but cannot go any further. Can anyone point me to where i can populate this list? Sounds like possible a backend table, but i cannot find which one.
    Many Thanks
    Indi

    Would anyone be able to help please?
    Thanks
    Indi

  • Getting values from list box

    i am populating a list box with Id's and names from a database and im trying to get the values from the list box depending what the user chooses, i.e if they choose the first choice in the list box the value i want to put in a variable is 1, etc
    here is the code for the list box, please help
    <select name="lstFilm" size="1">
              <%while (result4.next())
                   {%>
    <option value="<%result4.getInt(1);%>">
    <%out.println(result4.getString(2));%>
    </option>
                   <%}%>
    </select>

    String[] lstFilm = request.getParameterValues("lstFilm");
    Of course, it'll only return selected values. It'll be whatever the option values are.

  • How do you add a multiple entries at once to a drop-down list box?

    I'm making a form for students to fill out and I want them to be able to pick from about 200 different courses. In the Field/List Items place, it would appear that you can only enter one item one at a time. I did this for 56 faculty,which took too much time, but for over 200 course titles, it would be much more convenient just to copy/paste them from an Excel spreadsheet, which is what I've tried doing. Any help or tips would be appreciated. I've attached a PDF of what I'm working on. The drop-down box is the one next to "Course." Thanks.

    Hi,
    The next version of LiveCycle Designer ES2 will allow user to copy and paste a long list of items into a dropdown or list box at design time. But until then your choices are limited.
    Paste them one at a time;
    You could set up a global variable in the (File/Form Properties) with the 200 items in the one variable. Then it would depend if your users have Acrobat/Reader v9 or earlier versions of Acrobat/Reader. John Brinkman has (several) blogs on this topic: http://blogs.adobe.com/formfeed/2009/01/populating_list_boxes.html
    If you are going with v9 then you can use the setItem script. However if you want your form to be compatible with earlier versions then you will need the addItem script.
    Also check out a sample by Steve Walker. http://forums.adobe.com/message/1939873#1939873 and  http://forums.adobe.com/message/2038932#2038932  The first one dealt with adding user entered data onto a dropdown, which is not exactly what you are after, but it will give you direction in populating a dropdown from an array.
    You would place the script in the docReady event of the dropdown, which would populate the dropdown every time the form is opened.
    Good luck,
    Niall

Maybe you are looking for

  • Fire is loaded, it opens but it will not max. Can not access.

    I've spent my day trying to get Fire Fox to start working again. I've deleted and reinstalled several times and have tried to work through web answers. At this point, the computer window7 Task Manager indicates that Firefox is open. The icon on the t

  • Query a column of data through IFS?

    We need to know how to query a column of data through iFS (if this is even possible). For instance, in our database, there is a table ODM_TEST with a column RELEVANT_LOCATION. To get the unique values, we'd just query in SQL: SELECT DISTINCT(relevant

  • Information to user who creates PR for spare parts & service PR from order.

    Hi experts, Is there any standard workflow available by which the maintenance user will get message in his SAP inbox , whether material has been recieved for the Purchase requisition created through maintenance order as well as manual PR by t-code ME

  • Slow Firefox tried everything including reinstall. Slow in Safari too.

    For 24 hours Firefox has been really slow to load. This is on my computer only - browsing on my ipad is fast and good. I tried the same on my computer with another browser and it is equally slow. I have tried all the suggestions including reinstallin

  • HOW CAN I REGISTER MY MAC WITHOUT GIFT RECEIPT

    my brother gave me his macbook when his job got him a new airbook, but i don't know the purchase date.  it is a 2011 model...how do i go about  trying to purchase applecare before warranty expires?