How yo fill combo box by javascript

hi all,
i am new to acrobat. working on Acrobat 9.
i m tryin to add elements to a combo box by javascript....i tried using "setItem()" bt this didnt help

finally i was able to populate the combo with numbers in a loop....actually wht i m tryin is to populate the combo with name of meshes in a 3D model using 3D tool added on the pdf, on the click of button....bt i cldnt establish connection between the 3d object and the form elements on the pdf

Similar Messages

  • How to fill combo box with list of all SQL server

    Ok, I know how to find all SQL servers that I need, I have code for that task, and I have Array of all servers.
    My problem is ...
    I made setup project and do a huge work, and in the end this task appear!
    I used ORCA tool to change TextBox (A) template in visual studio (2008 by the way), and I transform first TextBox to ComboBox.
    Now, the little part that I'am missing is how to fill this combo box with a result of my function for listin SQL servers?
    Can I somehow send combobox object to myMethod:
    private void FillCombo(ComboBox cmb)
          // do the job
    or
    instanceOfThisCombo.Items.Add(listOfSQLServers);
    please help me to solve this... thanksc#

    Hi Valerij,
    The ComboBox control in an MSI dialog uses the ComboBox table to populate the items in it. To get what you want, you need to update the ComboBox table in the MSI package with your application and run the MSI package. The following KB article describes how to dynamically populate a ListBox control in Windows Installer:
    http://support.microsoft.com/kb/291329
    This method introduced in the above KB article also applies to populating a ComboBox control in Windows Installer.
    I don't think it's possible to run the application as a Custom Action from within the MSI package because the application will modify the content of the MSI package which is currently running. So you need to launch the MSI package from within your application after updating the ComboBox table. In short, when installing, just run your application which updates the ComboBox table and install the MSI package.
    Hope this helps.
    If you have any question, please feel free to let me know.
    Sincerely,
    Linda Liu

  • How validate a combo box generated for a selectOne on javascript

    Hi!!
    I have a question!
    i need how validate a combo box on javascript if this is generated by selectOne
    for example:
    <tr>
    <td width="150px"><b>Cantidad a elegir:</b></td>
    <td><f:selectOne att='idisponibilidad.cantidadElegir' type='combo'/></td>
    </tr>
    this is an form and this generates in the name of the select:
    <select name="$FO$idisponibilidad.cantidadElegir">
    <option value="0">..</option>
    <option value="4">..</option>
    </select>
    but now I try to do this:
    document.form.$FO$idisponibilidad.cantidadElegir.value
    and obviously does not work!!!
    someone knows how to validate
    Thanks!!!

    Taking Mark's Code .. add an id
    <select id="personGender" <f:fieldName att="person.gender"/>>
    <c:forEach var="gender" begin="0" items="${genders}" varStatus="status">
    <c:choose>
    <c:when test="${person.gender == gender}">
    <option value="<c:out value="${gender}"/>" selected="true"><c:out value="${gender}"/></option>
    </c:when>
    <c:otherwise>
    <option value="<c:out value="${gender}"/>"><c:out value="${gender}"/></option>
    </c:otherwise>
    </c:choose>
    </c:forEach>
    </select>
    Add an id to above code. In your submit button write a function on onclick event .. like onclick="submitForm()"
    Write the functions as :
    function submitForm(){
         if(validateFileds()){
    document.<your form id>.submit();
    function validateFields(){
    if (isEmptyCombo ('personGender')) {
                   alert ( "'Selecting a gender is mandatory" );
                   focus('personGender');
                   return false;
    function isEmptyCombo (id) {
         var combo = document.getElementById(id);
         return combo != null && combo.options[combo.selectedIndex].value == "";
    function focus (id) {
         if (document.getElementById(id)) document.getElementById(id).focus();
    Thanks,
    Karmaresh
    Edited by: user856811 on Mar 15, 2010 9:22 PM
    Edited by: user856811 on Mar 15, 2010 9:22 PM

  • Combo box in JavaScript and store the combo box values into database

    i am a developer, i have a task ie.. i have combo box in JavaScript and i have to store the combo box values into database through JavaServerPage..
    i please every one to have a look on this and please reply soon....

    dear sir,
    your suggestions are really greater the god.............
    i have applied as you said , now i am the page as updated and also i nform you that its multi select ....
    i will show the codings , then u will get a clear identification
    <script language= "JavaScript">
    <!--
    function one2two() {
        m1len = m1.length ;
        for ( i=0; i<m1len ; i++){
            if (m1.options.selected == true ) {
    m2len = m2.length;
    m2.options[m2len]= new Option(m1.options[i].text);
    for ( i = (m1len -1); i>=0; i--){
    if (m1.options[i].selected == true ) {
    m1.options[i] = null;
    function two2one() {
    m2len = m2.length ;
    for ( i=0; i<m2len ; i++){
    if (m2.options[i].selected == true ) {
    m1len = m1.length;
    m1.options[m1len]= new Option(m2.options[i].text);
    for ( i=(m2len-1); i>=0; i--) {
    if (m2.options[i].selected == true ) {
    m2.options[i] = null;
    //-->
    </script>
    <form method="POST" name="theForm" action="update.jsp">
    <table bgcolor="white" border="1" cellpadding="5" cellspacing="2" align="center">
    <tr><td align="center">
    <select id=menu1 size=10 multiple>
    <option>javascript</option>
    <option>php</option>
    <option>Zeo</option>
    <option>asp</option>
    <option>jsp</option>
    <option>ajax</option>
    <option>struts</option>
    </select>
    <p align="center"><input type="button" onClick="one2two()" value=" >> "></p>
    </td><td align="center">
    Languages you know:<BR>
    <SELECT NAME="language" multiple>
    <OPTION VALUE="c">C
    <OPTION VALUE="c++">C++
    </SELECT>
    <p align="center"><input type="button" onClick="two2one()" value=" << " ></p>
    </td></tr></table>
    <center><input type="submit" value="update"></center>
    </form>
    <h4><u>Back<h4>
    <script language= "JavaScript">
    var m1 = document.theForm.menu1;
    var m2 = document.theForm.language;
    </script>
    </body>
    </html>

  • Combo box in javascript

    I have a combo box (combo1), and on changing the value selected in it, a second combo box (combo 2) is displayed on the screen.
    I need to be able to add some java script code for Combo2, as depending on the value selected in it, some further action has to be done.
    All the code i've tried searching for so far, uses the HTML version of combo box, and accesses the value in java script using the line "document.formname.OPTION.[selectedindex].value".
    How would i do the same for a JSF combo box, in java script?
    Thanks in advance :)

    hi.. thanks for the response.. i did as u suggested but i got the following error : "document.all.menu8 is null or not an object "
    The code for my combo box is as follows:
    <h:selectOneMenu styleClass="selectOneMenu" id="menu8" onchange="display()">
    <f:selectItem itemLabel="select" itemValue="select" />
    <f:selectItem itemLabel="option 2" itemValue="op2" />
    <f:selectItem itemLabel="option 3" itemValue="itemValue3" /></h:selectOneMenu>
    <div id="op2" style="DISPLAY: none">The following is the java script snippet:
    <script language="javascript">
         function display()
              document.all.op2.style.display='none';
              document.all.itemValue3.style.display='none';
              var d=document.all.menu8.getElementById(menu8);
              var name=d.options[d.selectedIndex].value;
              if(name!='select')
               eval("document.all."+name+".style.display='' ");
              </script>Is it that the 'div' tag is incompatible in this case?

  • How to use COMBO box in prc application

    am using KVM -kjava to create a graphical user interface application.First i want to put combo box in my prc appliction,i have found a class implementing combo box but i could not understand if an item is selected from combo box then the screen below the combo box is painted ,so how to restore(repaint) the screen below the combo box ...can any body send me the code..

    What combo box ? Did you create it ?
    As to re-painting: Determine what components were covered by the combo, and repaint them.

  • Fill combo box  fro database using jsf

    dear all,
    i am new to JSF and i want to fill a JSF combo box from a database
    can anyone help me ??
    thanks in advance for help

    use this tag inside  <h:selectCombobox>
    <f:selectItems value="#{myBean.valueArrayFromDB}"/>

  • How to fill selection box with clientside data?

    i want to make a html form that reads option values from the client.
    Because there are too many data, it's not reasonable for me to design a page which connects to server each time to fill the selection boxes.Instead i want to check if data resides at the clientside, if so fill selection boxes with that data, if not download it for the first time and store it on the client for later local retrieval.In addition i must be able to update that data residing on the client when i want.

    Hi,
    I can tell you some hints. Use cookies to store the information on to the client-side. You can read data from cookies using JavaScript. If you want to store huge amount of data on to the client-side, perhaps this would not be a better idea. In J2EE architecture we often use sessions to store values. You need to design your implementation in such a way that for the first time you fetch all the values from the database and put it in a session, and the next time onwards you can get the values from the session itself and thereby you can avoid going to database each and everytime. Write a Java class which has all the necessary get and set methods and store the object in the session. Using that object reference you can set and get the values from it. I hope this will help you.
    Thanks

  • How to fill html control from javascript

    I am trying to create a panel with html in it and I am not able to fill dropdown control from javascript.

    Tim,
    In order to consume a SOAP API I recommend you use something other than JavaScript.
    Any platform can offer you a good SOAP client should be OK. (.Net, Java, php, Ruby, python).
    I didn't see anyone successfully used javascript and consume the Eloqua SOAP API.
    I know you can create a SOAP client in Java script but it will be too much work to handle the Eloqua response in some cases.
    Regards,
    Daniel

  • How to Use Combo Boxes

    Hi, i download the code of this tutorial
    and i want to insert this in a Jdialog, i create a new JComboBox() with the name of the class that i download, i Set the path , i extend the class to JComboBox , i made the class super(); but throw me an Exception: "cannot be cast to Integer" at the
    public Component getListCellRendererComponent(
    JList list,
    Object value,
    int index,
    boolean isSelected,
    boolean cellHasFocus) {
    //Get the selected index. (The index param isn't
    //always valid, so just use the value.)
    int selectedIndex = ((Integer)value).intValue(); // here throw me the exception cannot be cast to Integer.//
    if (isSelected) {
    setBackground(list.getSelectionBackground());
    setForeground(list.getSelectionForeground());
    } else {
    setBackground(list.getBackground());
    setForeground(list.getForeground());
    //Set the icon and text. If icon was null, say so.
    ImageIcon icon = images[selectedIndex];
    String pet = petStrings[selectedIndex];
    setIcon(icon);
    if (icon != null) {
    setText(pet);
    setFont(list.getFont());
    } else {
    setUhOhText(pet + " (no image available)",
    list.getFont());
    return this;
    what should i do??
    Sorry for my English...Thanks.

    I set it manualy
    int selectedIndex = 3; it works but shows me only one selection, actually the thirt selection....i must call this method anywhere to fill the selectedIndex ?

  • How do iuse combo query

    pls i am using a jdeveloper in design a database code and i do not know the query to use for picking information from the combobox from the database to display in an interface.

    1) Read the tutorial on [url http://java.sun.com/docs/books/tutorial/]JDBC Database Access to learn how to read data from a database.
    2) Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html]How to Use Combo Boxes to learn how to add data to a combo box.
    Put the two solutions together and you have your answer.

  • Newb deserving assistance with Adobe Javascript (check boxes and combo boxes)

    Hi, I'm a newb when it comes to javascript (using adobe acrobat pro 6.0).
    I am working on a form that will allow me to autofill checkboxes based off of information chosen. Ideally, I would like to have a selection from a combo box autofill/auto checkmark check boxes. Alternatively, I would be willing to just have different selections presented with check boxes that when filled, would auto checkmark other check boxes (I know how to do this one, but I am not sure how to clear the check boxes if the initial one is unchecked).
    I have the action button tied to the mouse up function. This just errors out.
    var Citrix = this.getField("Citrix")
    var Appro = this.getField("Appro")
    var SAS = this.getField("SAS")
    if (event.target.value=="Yes") {
    Citrix.checkThisBox = true
    Appro.checkThisBox = true
    SAS.checkThisBox = true
    else {
    Citrix.checkThisBox = false
    Appro.checkThisBox = false
    SAS.checkThisBox = false
    I have this that works, but I don't know how to clear the buttons when "Associate" is unchecked.
    if(this.getField("Associate").isBoxChecked(0));
    this.getField("Citrix").checkThisBox(0, true);
    this.getField("Appro").checkThisBox(0, true);
    this.getField("SAS").checkThisBox(0, true);
    The other way I was working on it, was to use a combo box to autofill/checkmark check boxes. But this code doesn't work either.
    function calculateTextField()
    // get the value of the combo box
    var comboValue = this.getField("Select").value;
    // get the state of the checkbox
    var isChecked = (this.getField("Citrix").value == "Yes");
    var textFieldValue = "";
    console.println(comboValue);
    if (isChecked)
    if (comboValue == 0)
    textFieldValue = "";
    if (comboValue == "Associate")
    (this.getField("Citrix").value == "Yes");
    else if (comboValue == "Specialist")
    (this.getField("Citrix").value == "Yes");
    else if (comboValue == "Team Leader")
    (this.getField("Citrix").value == "No");
    else
    (this.getField("Citrix").value == "No");
    else
    textFieldValue = "";
    this.getField("Select").value = textFieldValue;
    Can anyone please assist me with this?
    Thanks,
    Chris

    Hi Gene,
    Thank you for the response. Are you saying that my initial formula should look more like this; ?
    var Citrix = this.getField("Citrix")
    var Appro = this.getField("Appro")
    var SAS = this.getField("SAS")
    if (event.target.value=="Yes") {
    Citrix.checkThisBox = true
    Appro.checkThisBox = true
    SAS.checkThisBox = true
    else {
    if (event.target.value=="Off")
    Citrix.checkThisBox = true
    Appro.checkThisBox = true
    SAS.checkThisBox = true
    Thanks,
    Chris

  • How can I make the combo box turn to the value of black.

    When the show button is pressed (and not before), a filled black square should be
    displayed in the display area. The combo box (or drop down list) that enables the user to choose the colour of
    the displayed shape and the altering should take effect immediately.When the show button is pressed,
    the image should immediately revert to the black square, the combo box should show the value that
    correspond to the black.
    Now ,the problem is: after I pressed show button, the image is reverted to the black square,but I don't know
    how can I make the combo box turn to the value of black.
    Any help or hint?Thanks a lot!
    coding 1.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class test extends JFrame {
         private JPanel buttonPanel;
         private DrawPanel myPanel;
         private JButton showButton;
         private JComboBox colorComboBox;
    private boolean isShow;
         private int shape;
         private boolean isFill=true;
    private String colorNames[] = {"black", "blue", "cyan", "darkGray", "gray",
    "green", "lightgray", "magenta", "orange",
    "pink", "red", "white", "yellow"}; // color names list in ComboBox
    private Color colors[] = {Color.black, Color.blue, Color.cyan, Color.darkGray,
                              Color.gray, Color.green, Color.lightGray, Color.magenta,
                              Color.orange, Color.pink, Color.red, Color.white, Color.yellow};
         public test() {
         super("Draw Shapes");
         // creat custom drawing panel
    myPanel = new DrawPanel(); // instantiate a DrawPanel object
    myPanel.setBackground(Color.white);
         // set up showButton
    // register an event handler for showButton's ActionEvent
    showButton = new JButton ("show");
         showButton.addActionListener(
              // anonymous inner class to handle showButton events
         new ActionListener() {
                   // draw a black filled square shape after clicking showButton
         public void actionPerformed (ActionEvent event) {
                             // call DrawPanel method setShowStatus and pass an parameter
              // to decide if show the shape
         myPanel.setShowStatus(true);
                   isShow = myPanel.getShowStatus();
                                            shape = DrawPanel.SQUARE;
                        // call DrawPanel method setShape to indicate shape to draw
                                            myPanel.setShape(shape);
                        // call DrawPanel method setFill to indicate to draw a filled shape
                                            myPanel.setFill(true);
                        // call DrawPanel method draw
                                            myPanel.draw();
                             myPanel.setFill(true);
                             myPanel.setForeground(Color.black);
                   }// end anonymous inner class
         );// end call to addActionListener
    // set up colorComboBox
    // register event handlers for colorComboBox's ItemEvent
    colorComboBox = new JComboBox(colorNames);
    colorComboBox.setMaximumRowCount(5);
    colorComboBox.addItemListener(
         // anonymous inner class to handle colorComboBox events
         new ItemListener() {
         // select shape's color
         public void itemStateChanged(ItemEvent event) {
         if(event.getStateChange() == ItemEvent.SELECTED)
         // call DrawPanel method setForeground
         // and pass an element value of colors array
         myPanel.setForeground(colors[colorComboBox.getSelectedIndex()]);
    myPanel.draw();
    }// end anonymous inner class
    ); // end call to addItemListener
    // set up panel containing buttons
         buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout(4, 1, 0, 50));
         buttonPanel.add(showButton);
    buttonPanel.add(colorComboBox);
    JPanel radioButtonPanel = new JPanel();
    radioButtonPanel.setLayout(new GridLayout(2, 1, 0, 20));
    Container container = getContentPane();
    container.setLayout(new BorderLayout(10,10));
    container.add(myPanel, BorderLayout.CENTER);
         container.add(buttonPanel, BorderLayout.EAST);
    setSize(500, 400);
         setVisible(true);
         public static void main(String args[]) {
         test application = new test();
         application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    coding 2
    import java.awt.*;
    import javax.swing.*;
    public class DrawPanel extends JPanel {
         public final static int CIRCLE = 1, SQUARE = 2;
         private int shape;
         private boolean fill;
         private boolean showStatus;
    private int shapeSize = 100;
    private Color foreground;
         // draw a specified shape
    public void paintComponent (Graphics g){
              super.paintComponent(g);
              // find center
    int x=(getSize().width-shapeSize)/2;
              int y=(getSize().height-shapeSize)/2;
              if (shape == CIRCLE) {
         if (fill == true){
         g.setColor(foreground);
              g.fillOval(x, y, shapeSize, shapeSize);
    else{
                   g.setColor(foreground);
    g.drawOval(x, y, shapeSize, shapeSize);
              else if (shape == SQUARE){
         if (fill == true){
         g.setColor(foreground);
                        g.fillRect(x, y, shapeSize, shapeSize);
    else{
                        g.setColor(foreground);
    g.drawRect(x, y, shapeSize, shapeSize);
    // set showStatus value
    public void setShowStatus (boolean s) {
              showStatus = s;
         // return showstatus value
    public boolean getShowStatus () {
              return showStatus;
         // set fill value
    public void setFill(boolean isFill) {
              fill = isFill;
         // set shape value
    public void setShape(int shapeToDraw) {
              shape = shapeToDraw;
    // set shapeSize value
    public void setShapeSize(int newShapeSize) {
              shapeSize = newShapeSize;
    // set foreground value
    public void setForeground(Color newColor) {
              foreground = newColor;
         // repaint DrawPanel
    public void draw (){
              if(showStatus == true)
              repaint();

    Hello,
    does setSelectedIndex(int anIndex)
    do what you need?
    See Java Doc for JComboBox.

  • How to change screen combo box value from a method?

    Hi,
    I have a screen that has a combo box and an ALV.
    the combo box has the line numbers of the data in the ALV.
    you can select the line item and then the ALV changes...
    I fill the combo with function VRM_SET_VALUE.
    all is good once the user changes the combo box.
    I want to enable the user to click (hotspot) on ALV and then to ... and to change the value of the combo box to the line number he clicked on.
    I couldn't change the value inside that box.
    The combo box is declared as global parameter.
    when I assign a value to it inside the method, it is good. but once back to PAI, it is the old value.
    Do you have any idea how to set up that value?
    Thanks.

    Itay,
    When you load the combo box, you should be setting a "key" for each entry in the combo box.
    See below:
      move '2010FY' to Value-Key.
      move '2010 - Full Year' to Value-Text.
      append value to list.
      move '2010Q1' to Value-Key.
      move '2010 - Q1' to Value-Text.
      append value to list.
      move '2010Q2' to Value-Key.
      move '2010 - Q2' to Value-Text.
      append value to list.
      move '2010Q3' to Value-Key.
      move '2010 - Q3' to Value-Text.
      append value to list.
      move '2010Q4' to Value-Key.
      move '2010 - Q4' to Value-Text.
      append value to list.
      move 'COMBO1' to name.  "name of Combo box in the screen
      call function 'VRM_SET_VALUES'
        exporting
          id = name
          values = list.
    So add these "keys" to a hidden column in the ALV grid.  Then .... when the user presses a hotspot, pass the value of the hidden column (for the selected row) into the COMBO1 box.
      move '2010'FY' into Combo1.  " if they selected Full Year of 2010

  • How to use the Combo Box In MAtrix Colums

    HI Experts,
    Good Mornong.How to use the Combo Box In MAtrix Colums?
    Regards And Thanks,
    M.Thippa Reddy

    hi,
    loading data in to the combobox on form load.but, it should be done when atleast one row is active.
    the values what ever you are inserting in to combo should  be less than or eqhal to 100 or 150.if it exceeds beyond that performance issue arises.it takes more time to load all the data.so, it is better to have 100 or less.
    oMatrix.AddRow()
    RS = Nothing
    RS = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
    RS.DoQuery("select ItemCode,ItemName from oitm")
    oCombo = oMatrix.Columns.Item("ColumnUID").Cells.Item(oMatrix.RowCount).Specific
    For i = 1 To RS.RecordCount
          If RS.EoF = False Then
                oCombo.ValidValues.Add(RS.Fields.Item("ItemCode").Value,RS.Fields.Item("ItemName").Value)
                RS.MoveNext()
          End If
    Next
    the above code is inserting data from database to column combobox.
    you can fill combo directly also as shown below.
    oCombo.ValidValues.Add("x","1")
    oCombo.ValidValues.Add("y","2")
    oCombo.ValidValues.Add("z","3")
    oCombo.ValidValues.Add("","")
    and what ever the values you are filling into combo should be unique.other wise it shows valid value exists.
    regards,
    varma

Maybe you are looking for

  • I just bought a new iPad and I want to bring over all my apps from my first iPad but I don't have a computer, do I just use the cloud?

    I just bought a new iPad and I want to bring over all my apps from my first iPad but I don't have a computer, do I just set up an icloud account and upload all the things from my first iPad and then connect the new iPad to the icloud using the same a

  • IMac Intel & Clarisworks

    Why can't I open Clarisworks documents created on my prior iMac G4 ? I have hundreds of lessons (I'm a teacher) that I need access to, and I can't believe that my replacement computer (the Intel model) will not open these documents, yet it will open

  • Problem with AV DWH refresh and purge process

    We are working on a POC for a client and our env is Oracle Linux, Oracle 11g as Source with SYS.AUD$ auditing, Audit vault 10.2.3.1 and Agent all configured in a single server as of now. The problem I am facing is 1) The load process is really weard

  • Extra picture folders after a restore in PSE-O v11

    I have an HP laptop with all of my pics and back ups on an EHD.  The EHD recently died but I have additional copies of all my pics on other EHD and my laptop.  I have a backup of the organizer from March 2014 on another EHD.  I just tried to restore

  • Updating to IOS5 on the iPod

    Hi guys Its me again this time its to do with IOS5 for ipod as you may know if youve tried to update it says that there is some apps that are on your ipod and not o your Pc so i transfered them all and I got to the next step and that was it says it b