Combo box question - can a store extra values?

my data is
car# id
CAR1 111111
CAR2 222222
CAR5 555555
i want to be able to select CAR1 in the combo and
retrieve the id field.
what is the best way to do this? in foxpro one can
have hidden fields and some ocxs of cargo objects.
thanks for any help
owen brandon

Hi,
I haven't used JComboBox for a while but I think you just need to make a class with an id (eg. 11111) and a name (eg. CAR1), and specify a toString method that returns the name. I fyou catch the object you then can cast it and call its getID() method.
Greets
Puce

Similar Messages

  • 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>

  • HTML Combo Box Question

    I generate an HTML page with a Servlet and I have a combo box that lists numbers 1-20. Depending on a parameter that is passed to the servlet I want to set the Combo box to be initalized to (display) a certain number.
    Does anybody know how I can do that? (I would prefer to have the Combo Box entries remain in order)
    Thanks,
    Andrew

    You can always put something in there like
    int foo = Integer.parseInt(request.getParameter("foo"));
    for(int i=1; i <= 20; i++)
      out.println("<option value=\""+i+"\" "+(foo==i)?"SELECTED":"" +" >"+i+"</OPTION>");
    }

  • JSP Combo box question

    How can I make a combo box have the ability to add new items in its list? I have an existing combo box that gets its value from an SQL query. How can I let users have the ability to add to that list? If this is not possible with JSP combo boxes, any suggestions as to what field I may use? Thanks

    Hello Russ9754!
    Might be abit late, but I just read this thread.
    Anyway...I think I have what you are looking for.
    This code creates a dropdown box with the alternatives of your choice. If none of the options is good enough for the user, he/she can choose "other" and enter a more suitable choice in a pop-up javascriptprompt.
    <FORM NAME="formName">
    <SELECT NAME="country" onChange="countryOnChange();">
    <OPTION VALUE="Albania" selected>- = Albania = -</OPTION>
    <OPTION VALUE="Finland">- = Finland = -</OPTION>
    <OPTION VALUE="USA">- = USA = -</OPTION>
    <OPTION VALUE="Other"> Other... </
    OPTION>
    </SELECT>
    </FORM>
    <SCRIPT>
    function countryOnChange(){
    sel = document.formName.country.selectedIndex;
    val = document.formName.country.options[sel].
    value;
    len = document.formName.country.length;
    if (val == "Other"){
    var newcountry = prompt("Enter your country.", "");
    if (newcountry == null) { return; }
    document.formName.country.options[sel].text = newcountry;
    document.formName.country.options[sel].value = newcountry;
    document.formName.country.length = len +1;
    document.formName.country.options[len].text = "Other...";
    document.formName.country.options[len].value = "Other";
    </SCRIPT>

  • Combo box ( i can't solved. help me)

    hi, i have doubt in combo box
    <select name="branch">
    <option>chennai</option>
    <option>bangalore</option>
    <option>delhi</option>
    <option>mumbai</option>
    </select>
    In the above code i didn't use <option value> but i give the values between the <option>xxxx</option>tags.
    Now i want to retreive the values between the <option></option> tags.
    is it possible?.if yes how?. please send me code. it would be very helpful to me.

    linta mam..try this..
    I hope u know how to write js functions..
    write a function for onChange event of ur select ..
    inside the function u can give
    var index=document.getElementById("branch").selectedIndex;
    alert(document.getElementById("branch").options[index].text)

  • Combo Box question on JSP

    I have two combo boxes. Box 2 is populated dependant on the value of box 1.
    The data wil be coming out of a JavaBean with a connection to a database.
    What would be the best way to acheive this?
    TIA
    Owen Thomas

    Hello Russ9754!
    Might be abit late, but I just read this thread.
    Anyway...I think I have what you are looking for.
    This code creates a dropdown box with the alternatives of your choice. If none of the options is good enough for the user, he/she can choose "other" and enter a more suitable choice in a pop-up javascriptprompt.
    <FORM NAME="formName">
    <SELECT NAME="country" onChange="countryOnChange();">
    <OPTION VALUE="Albania" selected>- = Albania = -</OPTION>
    <OPTION VALUE="Finland">- = Finland = -</OPTION>
    <OPTION VALUE="USA">- = USA = -</OPTION>
    <OPTION VALUE="Other"> Other... </
    OPTION>
    </SELECT>
    </FORM>
    <SCRIPT>
    function countryOnChange(){
    sel = document.formName.country.selectedIndex;
    val = document.formName.country.options[sel].
    value;
    len = document.formName.country.length;
    if (val == "Other"){
    var newcountry = prompt("Enter your country.", "");
    if (newcountry == null) { return; }
    document.formName.country.options[sel].text = newcountry;
    document.formName.country.options[sel].value = newcountry;
    document.formName.country.length = len +1;
    document.formName.country.options[len].text = "Other...";
    document.formName.country.options[len].value = "Other";
    </SCRIPT>

  • Can I store a value into a given row and channel?

    Hi all-
    My question is basic, but I can't seem to find the answer in any of the forums or help windows.
    Is there a way to store a variable into a particular row and cell number?For example, if i have a channel named [1]/ChannelB and the following:
    Dim A
    A= 12
    I want to store the value of 12 into row 7 of [1]/ChannelB... Is there a method for doing this?

    Hello,
    You can access individual cells in DIAdem with the ChDX variable.
    For instance, to store the value of A in row 7 of [1]/ChannelB you'd do this:
    Dim A
    A = 12
    chnval(7,"/ChannelB") = A
    Hope this helps,
         Otmar
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."

  • How Do I Get Item In Combo Box and Not It's Export Value?

    I created a Combo Box in Adobe pdf listing Company Names in the Item field. As well, I added an abbreviation for each Company Name in the Export Value field. When I try to display the Company Name from the Item field, it displays the Export Value.
    The Combo Box is named "Company-Name".
    In it, I have a company called "MacKenzie" within the Item Field. It's Export Value is "MFC".
    app.alert(this.getField("Company-Name").value); will display "MFC". How do I display or get the value from the Item field?

    You can use the getItemAt field method, like:
    // Get a reference to the combo box
    var f = getField("Company-Name");
    // Get the index of the selected item
    var a = f.currentValueIndices;
    // Show the item value of the selected item
    app.alert(f.getItemAt(a, false));

  • Simple combo box question

    I have Flash MX 2004 Pro. I want to create a
    movie/graphic/button ( not sure which one yet) of a county
    (obviously from a state map) and I want to have all of the counties
    (over 40) listed in a Combo Box. I would like the Combo box to
    automatically be updated/populated every time I create a
    movie/graphic/button of a county. I would like to be able to click
    on a county name in the combo box and have the county highlighted.
    While the graphic part is doable, I am asking for help with the
    scripts.
    One more thing: I have a text box that I want to have data
    displayed only for the specific county. So I am thinking of
    creating a text box that is invisible in the State swf but will be
    viewable when the county is selected (mouse over or thru the combo
    box). Do I have to use the scripts to make it viewable when the
    movie is selected?
    Is this even possible with my version of Flash and if so,
    does anyone have some codes I can look at?
    Thanks.

    As far as the text goes, there are several ways to do that.
    Simplest way is to make the text visible when rolled over and
    invisible when rolled out. That way you get the text positioned and
    formated the way you want. It isn't the best method in terms of
    maintenance. A better method is have one text clip that you can
    position in relation to the (x,y) coordinates of the highlighted
    county and pull the text for the county from an array. The latter
    requires more script but is easier to go back and change since all
    you do is update an array.
    I just noticed a line in the onRollOut
    this[this._parent._name + "menu"].selectedIndex = 0;
    that will serve you no purpose whatsoever. I missed deleting
    that from the script I modified to post to you. It doesn't hurt
    anything since it targets nothing you have

  • How can i store a value in a register, to be called up later in the program. I must be able to read and write to it.

    Im looking at a bearing reading and i only want it to do a case loop if the data has changed on the bearing, so i need a value of what it was a cycle ago to compare it with, how do i do this?

    Hi,
    I'm not sure I,ve understood you clearly but it looks like you need to use "shift registers" in the loop.
    Shift registers allow you to pass data from one iteration of the loop to another. For example in the situation when you need to know the value of some variable on previous iteration or on pre-previous etc.
    To create shift registers on the loop you have to right click on the border of the loop and select "Add shift register" from pop up menu. Two arrows will appear on the left and right sides of the loop. To write data to the shift register you have to wire them to the right arrow, and to read data you have to read it from the left arrow. When you read data from shift register you read the value from the previous iteration. When you write data - you wri
    te the curent value there. If you want to read preprevious data you have to click on the left side of shift register and select "Add Element". The new element (arrow) will appear which corresponds to preprevious value. And so on. To initialize shift registers before execution of the loop you have to wire the some data from the outside.
    Another solution of your problem is using of local variables. You can create them from pop up menu of each control or indicator on the diagram. You can set them as read or write local.
    Good luck.
    Read help.
    Oleg Chutko.
    Attachments:
    shift.vi ‏16 KB

  • Combo box question

    Hi! I'm new to Adobe Acrobat pro, so forgive me if I ask dumm questions!
    So I wanted to make a form with multiple comboboxes which are referring to each other, so that if you choose something from the first one, you can only choose from the subtypes of the chosen type......
    Is it even possible?
    I attached an exaple in Openoffice. It works  with the database fields and hlookup function, but it would be the best to have it in pdf......
    Thanks in advance

    It's possible in Acrobat as well, but you will need to have some custom
    scripts to do it.

  • The Prompt on combo box is not disappearing after a value is selected.

    Hi guys,
    I am putting in the prompt "Course Category" which starts off black and when a value is selected it turns grey but doesn't disappear, obscuring the selected value.
    I have tried putting in the line course_step1.prompt = ""; in the post selection part of the code but this has no effect.
    Interestingly when I test just this scene and not the whole movie this problem dosen't occure.
    This is a quote from my code I hope it gives you the idea...
    Thanks in advance,
    var course_step1:ComboBox = new ComboBox;
                    sophia_page2.addChild (course_step1);
                    course_step1.x = 245;
                    course_step1.y = 12;
                    course_step1.width = 200;
                    course_step1.dropdownWidth = 300;
                    course_step1.prompt = "Course Category";
                    course_step1.dataProvider = new DataProvider(cat_array);
                    course_step1.addEventListener(Event.CHANGE,select_cat);
                    function select_cat(event:Event):void
                                    var cat_select:String =(course_step1.selectedItem.data);
                                    course_inst1.textColor = 0x999999;
                                    course_inst2.textColor = 0x000000;  
                                    course_inst3.textColor = 0xCBDEF5;
                                    course_step1.prompt = "";
                                    //trace ("http://onedev/one/Sophia/CourseQuery2.asp?Cat=" + cat_select);
                                    var cat_selecturl:String =("http://onedev/one/Sophia/CourseQuery2.asp?Cat=" + cat_select);
                                    var xmlq2:XML = new XML ();
                                    var q2theURL_ur:URLRequest = new URLRequest("xmlq2.xml");
                                                           //replace with cat_selecturl ---- test with "xmlq2.xml"
                                    var q2loader_ul:URLLoader = new URLLoader(q2theURL_ur);
                                   q2loader_ul.addEventListener("complete", q2fileLoaded);
                                    function q2fileLoaded(e:Event):void
                                                    xmlq2 = XML(q2loader_ul.data);
                                                    //trace (unescape (xmlq2));
                                                   course_step1.prompt = "";

    Check the HTML source. Is any code after the initial option present (ie the </select></td>)? If not then you are getting an error that is masked by the fact that you already committed the response. Look into your logs.
    If the HTML source looks fine I fall back to my previous answer and you need to re-check the messages closer to where the work is being done. Though it never hurts to check the log files.

  • Drop Box Question: Can you preserve the Creation/Mod Date when dropping?

    I transfer files across a 3-computer network and would like to preserve the dates, rather than having them reset to the current date and time when dropped. Is there a way to preserve this info?

    I transfer files across a 3-computer network and would like to preserve the dates, rather than having them reset to the current date and time when dropped. Is there a way to preserve this info?

  • Edit combo box array

    Hello,
    I am trying to add a value to a specific combo box in a 2d array.
    lets say i have a 2d array of combo boxes, how can i add a value to the combo box in row 3 and colomn 4?
    Thank.

    Hey,
    I have an ini file with diffrent tests and every test has a diffrent settings, for example:
    [HO type_Intra ASN Handover]
    Type=INI VI
    Delay between H.O=5,2
    Trafic type=Smartbits,Ping
    Number of Handover=xxx
    [HO type_Inter ASN Handover]
    Type=INI VI
    Deleay between H.O=5,2
    Trafic type=Smartbits,Ping
    Number of Handover=xxx
    The idea is that for example delay between handovers is a combo box parameter with values of 5,2 and trafic type is also a combo box parameter but with values smartbit or ping and the number of handovers is a regular string how can i diplay those parameter for the user ? there can be more then 3 parameter...is there a solution ?

  • Adds entity value with which report was saved to all Combo Box in th report

    Hi All,
    We have 5 combo box related to Entity dimension in one of the WA 11.1.2 reports which we migrated from 7. The different combo boxes had different entity member selection and lists their children.
    The issue here is when we change the entity to one particular value in one of the combo boxes and save the report in studio, close and re-open, the report opens with the entity value with which it was saved in that combo box, also additionally it puts this entity value in other combo boxes also along with their existing values.
    We want the other combo boxes to retain only their value which was existing. Can anybody help with this.
    Thanks,
    Unni

    Hi,
    I believe- This happens because- You might be re-using the same DataSource, ReportDataSrc1* that you created for the very first object +(Spreadsheet/combo/...whatever)+ on the Web Analysis report that you're referring to.
    I'm surprised why you've 5 different combo boxes for the same dimension on a single report. If they're analyzed compartmentally, creating multiple DataSources is a way out.
    Let us know incase you've any questions.
    - Natesh

Maybe you are looking for

  • General Airport Extreme questions

    I have some general questions regarding the dual band technology and how it relates to my specific setup. A bit of background: I have 20Mbps cable internet and I am running the new Airport Extreme on a pc running XP to broadcast my wireless signal. I

  • Can I add a second login account to my ipad?

    I would like to have 2 passwords and 2 login accounts for my ipad--one for my business content and one for my kids names.  They love to play game with my ipad but I prefer not to give them free rein of my content including my email.  Can I do this so

  • Windows shuts Skype down

    Hi! I have a huge problem and have tried every solution I found here, but it still doesn't work for me. When I plug in my Creative Live CAM Chat HD and connect Skype everything goes fine. I can send and receive text messages, no problem. When I try t

  • Game controller for macbook gaming?

    I want to play the GTA games on my macbook..... and i want to use a handheld controller rather than my keyboard and mouse so, how can i hook a PS2 controller to my macbook? i came across an adapter but there are mixed reveiws on it http://www.amazon.

  • I have no airport utility on my desktop (gateway) to be able to open it up and figure out why light is flasing amber

    i have no airport utility anywhere on my computer to be able to open and fix my airport express....any ideas? I have a gateway computer and when I go to menu theres nothing