Problem of Index of List Box

I am running 8.2 and I'm having a problem, returning the index value of the selected items in a list box on my form in the designer.

I have a list box that is populated by the webservice and everything works well.  I am able to view s name (s) selected for the items selected in the list box, but I can't seem to get the index value.  Here's my Javascript code.

var a = xfa.resolveNode("lbAccountGroup.value").nodes;

xfa.host.messageBox (a.item (0) .value); Selection of the screen for verification.

Does anyone have any advice on how to do that?  I tried selectedIndex and index instead of the value, and nothing has worked.

Thank you in advance.

John

What event your code runs on... I would recommend the exit event. I would use ListBox1.selectIndex. Note that the index is 0-based and it is undefined until the output (by default). There is a small check box (in the object palette where you set the values) which allows you to set whether you want the validation to occur. You can change to select if you need that the user makes changes to the list box. I would not use the technique that you use when you query the DOM.

Paul

Tags: Adobe LiveCycle

Similar Questions

  • Problem in the scrolling list box

    Hello

    In my application, I need a list field that contains ten records. The screen is similar to below:

    To do this, I wrote the code. But after adding a few lines in the list field, the entire screen goes up. My code is:

    m_vfmScreen = new VerticalFieldManager(Manager.VERTICAL_SCROLL) {
                int nHight;
                int hight = 0;
                int width = 0;
    
                protected void sublayout(int nMaxWidth, int nMaxHeight) {
                    int orientation = Display.getOrientation();
                    width = Display.getWidth();
    
    if (orientation == Display.DIRECTION_PORTRAIT)
                    {
                        hight = BOTTOMBAR_BITMAP.getHeight() * 2;
                    }
                    else
                    {
                        hight = 0;
                    }
    
                    super.sublayout(nMaxWidth, nMaxHeight);
                    Field field;
                    field = getField(0);
                    setPositionChild(field, 10, 10);
                    layoutChild(field, field.getWidth(), field.getHeight());
    
                    field = getField(1);
                    setPositionChild(field, 10, 50);
                    layoutChild(field, Display.getWidth() - 20, nMaxHeight - 10);
    
                    Logger.out("MyTransaction", "Inside sublayout method and before setpositionchild method in the vfmscreen-----");
    
                    setExtent(nMaxWidth, nMaxHeight);
                }
    
        protected void paint(Graphics g)
                {
    
                    int hight2 = Display.getHeight() - hight;
    
                    if (hight == 0)
                    {
                        int n = this.getFieldCount();
                        hight2 = this.getField(n - 1).getTop() + this.getField(n - 1).getHeight();
                    }
                    Logger.out("WelcomeScreen", "Paint method widht :" + width + " nhight2 :" + hight2 + " hight :" + hight);
                    g.setColor(0x949CAD);
                    g.fillRect(0, 0, width, hight2);
                    g.setColor(Color.WHITE);
                    g.fillRoundRect(10, 10, width - 20, hight2 - 20, 10, 10);
                    g.setColor(Color.BLACK);
                    super.paint(g);
                }
            };
    
    /**
             * creating HorizontalFieldManager object to place the labels properly
             * when Orientation changed.
             *
             */
            HorizontalFieldManager hfmHeading = new HorizontalFieldManager(Manager.NO_HORIZONTAL_SCROLL) {
    
                protected void sublayout(int nMaxWidth, int nMaxHeight) {
                    if (Display.getOrientation() == Display.DIRECTION_PORTRAIT) {
                        m_bmpHeader = Bitmap.getBitmapResource("my_transactions_heading.png");
                        Logger.out("MYTransactionScreen", "inside sublayout mehtod;;;;;;;;;");
    
                    } else if (Display.getOrientation() == Display.DIRECTION_LANDSCAPE) {
                        m_bmpHeader = Bitmap.getBitmapResource("ls_my_transactions_heading.png");
                    }
                    super.sublayout(nMaxWidth, nMaxHeight);
                    setExtent(getPreferredWidth(), getPreferredHeight());
                    Logger.out("MyTransaction", "after setExtent()-----");
                }
    
                public int getPreferredWidth() {
                    return (Display.getWidth() - 20);
                }
    
                public int getPreferredHeight() {
                    return m_bmpHeader.getHeight();
                }
    
                protected void paint(Graphics g) {
                    g.drawBitmap(0, 0, (Display.getWidth() - 20), m_bmpHeader.getHeight(), m_bmpHeader, 0, 0);
                    super.paint(g);
                }
            };
    
            hfmHeading.setMargin(new XYEdges(0, 0, 0, 10));
            /**
             * Date Field
             */
            LabelFieldCustom m_lfcDateField = new LabelFieldCustom("Date", Color.GRAY, NON_FOCUSABLE);
            m_lfcDateField.setMargin(new XYEdges(5, 0, 0, 55));
            hfmHeading.add(m_lfcDateField);
    
            /**
             * Detail Field
             */
            LabelFieldCustom m_lfcDetailField = new LabelFieldCustom("Details", Color.GRAY, NON_FOCUSABLE);
            m_lfcDetailField.setMargin(new XYEdges(5, 0, 0, 65));
            hfmHeading.add(m_lfcDetailField);
    
            /**
             * ListField Object creation
             */
            TaskListField listField = new TaskListField(tran);
    
            /**
             * VerticalField Manager for the list
             */
            VerticalFieldManager vfmList = new VerticalFieldManager(Manager.VERTICAL_SCROLL);
            vfmList.add(listField);
    
    
     
    

    Here the field of task list is the class that adds lines in the field in the list and it works fine. But when I add the field in the list on the screen to create the problem. I use jre 5.0 and 9550 Simulator. Please help me and if you doubt ask me.

    Peter sorry for your inconvenience. However, I correct this problem. So thank you for your advice. I'll take care of him in the future.

  • get the index of a selected item in a drop-down list box

    Hello

    If I have a list of strings in a drop-down list box and the user selects one in the drop-down menu, how can I get the index?  I was able to explore the table for the selected channel, but it seems like duplication of effort to create a list and then go back and research it.

    Thank you

    Brendon

    It's easier to change control of the ring or Enum which gives the index as a default value, a drop-down list box gives a string that must be converted. But if you like really graphic and you want to use the drop-down list you can uncheck the "use strings as values" option and enter the index as numbers and then make a string to Decimal conversion.

    /Y

  • problem with index on a list of variants

    Hi, im working with a variant property list and index property int for the passage of the current 5 days and back temperature seems to work, but it has some problems, first of all, instead of the current temperature, I got 0 and then when I get to the day 4 me sends to the current day, and when I am right now (jsonweather.temp in the list) I spend twice for him , I increase the index on the shot upwards and taper sliding down like that

    Page {
    
    property variant list
    property int index: 0
    
    list: [ jsonweather.temp,
            jsonweather.tempMax1,
            jsonweather.tempMax2,
            jsonweather.tempMax3,
            jsonweather.tempMax4,
            jsonweather.tempMax5 ]
    
    function setIndex(_index){
            index = _index
        }
    function temperatureChanges(index){
            if(_WeatherNow.useFarenheit == true){
                weatherDataTemperature.text = Math.round((list[index])*1.8+32);
           } else{
                  weatherDataTemperature.text = Math.round(list[index]);
                }
        }
    
    Container {
            id:swipeContainer
    
            property int swipeThreshold: 100
            property double swipeStartPosX: -1
            property double swipeStartPosY: -1
            property double swipeLastKnownPosX: -1
            property double swipeLastKnownPosY: -1
            property bool swipeStart: false
            property bool swipeMove: false
    
    attachedObjects: [
    PositionSource {
                id: positionSource
                //! Desired interval between updates in milliseconds
                updateInterval: 10000
                //! When position changed, update the location strings
                onPositionChanged: {
                    currentCoord = positionSource.position.coordinate;
                    latitude = Math.round(currentCoord.latitude*1000)/1000;
                    longitude = Math.round(currentCoord.longitude*1000)/1000;
                    console.debug("Latitude: " + latitude, "Longitude: " + longitude);
                    positionSource.stop();
                    // start loading weather data for location
                    jsonweather.getWeatherdata(latitude, longitude);
                    jsonweather.onGetReply(loading.stop())
                }
            },
            ExternalIP {
                id : jsonweather
                onNameChanged: {
                    weatherDataCity.text = name;
                }
                onDescriptionChanged: {
                    weatherDataCondition.text = list2[index2];
                }
                onHumidityChanged: {
    
                }
                onTempChanged: {
                if(_WeatherNow.useFarenheit == true){
                weatherDataTemperature.text = Math.round((list[index])*1.8+32);
                } else{
                weatherDataTemperature.text = Math.round(list[index]);
                }
    }
            ]
            function processSwipe() {
                var horz = swipeContainer.swipeLastKnownPosX - swipeContainer.swipeStartPosX;
                var vert = swipeContainer.swipeLastKnownPosY - swipeContainer.swipeStartPosY;
    
                if (Math.abs(vert) > swipeThreshold) {
                    if (vert > 0) {
    
                        if(index > 0) temperatureChanges(index--)
                        else index = list.length - 1
    
                    }
                    else if (vert < 0) {
                        //swipe up
                        if (index < list.length - 1) temperatureChanges(index++)
                        else index = 0
                }
    }
                if (Math.abs(horz) > Math.abs(vert)) {
                // Moving horizontally: refresh information
                if (Math.abs(horz) > swipeThreshold) {
                    if (horz < 0) {
    
                             loading.start()
                             positionSource.start()
                             temperatureChanges(index)
    
                    } else if (horz > 0) {
                        temperatureChanges(index)
                    }
    
    }
            }
            }
            onTouch: {
                if (event.isDown()) {
                    swipeContainer.swipeStartPosX = event.windowX;
                    swipeContainer.swipeStartPosY = event.windowY;
                    swipeContainer.swipeStart = true;
                } else if (event.isMove() && swipeStart) {
                    swipeContainer.swipeMove = true;
                    swipeContainer.swipeLastKnownPosX = event.windowX;
                    swipeContainer.swipeLastKnownPosY = event.windowY;
                } else if ((event.isUp() || event.isCancel()) && swipeContainer.swipeMove) {
                    swipeContainer.swipeStart = false;
                    swipeContainer.swipeMove = false;
                    processSwipe();
                }
            }
    onCreationCompleted: {setIndex(0)}
    }
    

    This code seems very strange to me...

    if(index > 0) temperatureChanges(index--)
    else index = list.length - 1
    

    If it should not change anything...

    if(index > 0) index--
    else index = list.length - 1
    temperatureChanges(index)
    

    Ditto for increase the index in the code a little later, the.

    I do not say that it is something to do with your problem, that there should be further analysis, but this code seemed to me odd right now.

  • AS3 - making an index for each item in list box

    Hi guys,.

    I'm puzzled. It could be something simple that I'm doing wrong.


    I have a table populated by XML based on the following inside the function:

    first_special.addItem({label: xmlMenuFile.item.headers[i],data: 
    xmlMenuFile.item.descriptions[i],data2: xmlMenuFile.item.hints[i]});
    

    The problem I have is trying to find a way for the "data2" will fill the text field 'hint_txt' on ROLL_OVER of the same name of items in the list.

    I tried to place an event listener in the function that populates the drop-down list box, but does not

    // this populates the combo box label and data with the Loaded XML File. This works
    function changeHandler(ev:Event):void
    {
         menuText_mc.heading1_txt.text = ev.currentTarget.selectedItem.label;
         menuText_mc.description1_txt.text = ev.currentTarget.selectedItem.data;
         heading1 = ev.currentTarget.selectedItem.label;
         includePrice1_mc.visible=true;
    
    
    // trying to figure out how to activate the 'hinting' function when you ROLL_OVER EACH ITEM in the 'first_special" combo box
    // and when rolling over it trace 'hello'. This DOES NOT WORK.
    first_special.addEventListener(MouseEvent.ROLL_OVER, hinting);
    }
    
    
    function hinting(e:MouseEvent):void{
    // Should trace "hello" everytime I Roll_OVER an item in the Combo Box.     
         trace("hello");
    }
    
    // calls the changeHandler function and works correctly
          first_special.addEventListener(Event.CHANGE, changeHandler);
    
    
    Any help with this would be great.
    
    Thanks
    

    For the features of indicators, I think you want to define...

    Import fl.events.ListEvent;

    function hinting(e:ListEvent):void {}
    var rowIdx:uint = e.rowIndex as uint;
    hint_txt. Text = .data2 first_special.getItemAt (IdxLigne);
    }

    first_special.addEventListener (ListEvent.ITEM_ROLL_OVER, hinting);

    What you react only to roll on the main component, not the elements, and this reversal starts to happen until you have selected an item since you buried the listener inside the change function.  Keep the headset out in the open.

  • Set point problem selected in the drop-down list box that is the XML data provider

    HI - new to Flex, experienced Java dev., hoping someone can help me see the light of what should be easy but...

    I have a Flex 3 MXML application form that contains a ComboBox as follows:
    < mx:ComboBox id = "physRegion" editable = dataProvider = "{regionRequest.lastResult.region 'false'}" / > "

    The combo box is filled by the provider of data like:
    MX:HTTPService id = "regionRequest" url = "flexDAOServlet" resultFormat = "e4x" method = "POST" >
    < / mx:HTTPService >

    and the underlying XML code looks like this:
    <>region
    Northland < label > < / label >
    < value > 1 < / value >
    < / region >
    <>region
    Auckland < label > < / label >
    < value > 2 < / value >
    < / region >
    ...

    Drop-down list box loads the XML code very well. the user can select an item and the appropriate value is submitted to the server without problem. My problem is when I want to "recharge" the form with previous values.
    I can reload the text without problem fields.

    But I can't work in my ActionScript function, how to set the combo box so that it displays "Auckland" for example, the element with the value = 2. I'll be back this server id, even if I could get the XML code or label if that would help me solve this problem.

    I tried physRegion.selectedItem = "Auckland" - nope. "
    I tried physRegion.selectedItem = 2 - nope.
    I tried
    var XML = myXML:XML ("< region > < label > Auckland < /label > < value_2 > < value > < / region >");
    physRegion.selectedItem = myXML;
    and - nope.

    I know that I'm a new style user here error (and thank you for reading this far! your patience is appreciated) but I can't for the life of me see what it is. Can anyone help?

    Many thanks in advance for clues. Apart from that, I'm loving Flex.
    Kind regards
    Adrian

    Two things to note. The only problem with the function that has provided ChiefRocka00 is that it is based on the identifier of the data, which means your always limited to have that be the identifier of your value. Personally, I'll be back queries a lot of times where the labelFIeld and dataField aren't labels / data pairs a suggestion would be to add a third parameter and have it checked for this identifier instead of the data. The other thing to note is that it is more common to use selectedIndex instead of selectedItem. If you do not want to do something more like physRegion.selectedIndex = selectCboIndexByData ("physRegion, ' Auckland", label) by using the update function of

    public void selectCboIndexByData(theCbo,_theDataValue,_identifier:String):Number {}
    for (var i: Number = 0; i< thecbo.dataprovider.length;="">
    If (theCbo.DataProvider.getItemAt (i) [ID] == theDataValue) {}
    Return i;
    }
    }
    return 0;
    }

  • Web site works not-selection drop-down list box does not correctly

    Http://mobile.free.fr/moncompte -commerce site
    A drop-down list box shows that the user can choice phone numbers.
    The result is always a warning message 'phoe number still used '.
    FireFox version: 29.0.1
    plugin: WOT, ADBLOCK +.
    Best regards

    Many issues of the site can be caused by corrupted cookies or cache.

    • Clear the Cache

    Press < Alt > or < F10 > to display the toolbar. Then;
    Tools > Options > advanced > network > content caching Web: clear now

    and

    • Delete Cookies

    Press < Alt > or < F10 > to display the toolbar. Then Tools > Options > privacy.

    Under historical, select Firefox will use the custom settings.
    There is a button on the right side, called View the Cookies.

    If there is still a problem,
    Start Firefox in Safe Mode {web link}
    While you are in safe mode;
    Press the < Alt > or < F10 > key to bring up the toolbar... Then
    Tools > Options > advanced > general.
    Find and stop using hardware acceleration.

    Dig safe web sites and see if there is still a problem. Then restart

  • How do I change the list box within a cluster

    I have a cluster with multiple controls in it. One of them is a combo box on which I need to occasionally change the items to the breast. If the drop-down list box out of the bunch, I could easily access 'Strings []' property of the combo box. However, when inside of the bunch, I don't seem to not be able to get this property. In the excerpt below, the drop-down list box is the control at index 1. I get out of the reference to this control, connect it to a 'property node' and the 'Strings []' property is not found.

    Does anyone know how to fix this?

    Hello

    Take this simple way, create a node prperty for the cluster that you have, right-click on the prperty node and select link to, browse lists void until the drop-down list box. See attachment.

  • How to customize the scroll and symbols bars in a multi column list box

    Hello

    I have recently been design FP and have gotten to a scroll bar in a multi column list box.

    How can I change the decals and colors of the scroll bar as I can't seem to change or select all components of it within the control editor.

    I would change the arrow buttons and arrow the cursor with a custom sticker and have a solid track. In adition to that, I would like to change some of the symbols or add my own custom in the existing list.

    Is this possible to do?

    carbon32 wrote:

    Hello

    I have recently been design FP and have gotten to a scroll bar in a multi column list box.

    How can I change the decals and colors of the scroll bar as I can't seem to change or select all components of it within the control editor.

    I would change the arrow buttons and arrow the cursor with a custom sticker and have a solid track. In adition to that, I would like to change some of the symbols or add my own custom in the existing list.

    Is this possible to do?

    I don't think that you can customize parts of the scollbars.

    Here how to add symbols to a listbox control. The new index of symbols must last for 41 as the indices of standard symbols are included between 1 and 40. The size of your custom symbol must be 16 x 16.

    Ben64

  • Modification of the properties-type def drop-down list box

    I have a group of 32 cases of a def type. The def type contains several different types of control. What I have to do is to change the properties of the list box for each of the type defs. Normally, I would create an array of references to change the properties for each of the type defs, but when I try this I can not access the properties of string [] for combo box selections. The only way I found to fix it is to create a reference for each individual drop-down list box item. It is labour, since I'll have 32 elements. Is there a way to beeter to do this? The first screenshot shows the issui I'll have, not being able to change the properties of specific elements within each of the def type at runtime through a control [] array. The second screenshot shows the only solution I've found so far, which is not very practical.

    You will need to set up (for a more specific class) control to a type of combo box for the particular control [] index that has the combobox control if you want to access the drop-down list.

    You can also access the combobox in a cluster based directly, rigth click on the control reference and a link to the element cluster directly.

    The last option is to make the strictt of typdef will fill all instances with the channel list [] given that it is a strict property.

    the approach is based on the weather, you plan on changing the list during execution.

  • Update of list box strings [] programmatically in a table

    Hello

    I have an application that has several sites on the front where the user can select variables shared by using a shared variable control. I would like to replace these controls, which are heavy for the operator to select from variables published, to drop-down list boxes that list only the names of variables in a current published library. I have no problem cela providing you a shared list of variables and update the strings [] property in a drop-down list box. Then I can easily convert data types to use as shared variables elsewhere in my program.

    However, I have a few questions. First, in some cases, the shared variable controls are inside a table, and I do not know how to fill the combo box selections in the table. Perhaps there is an easy way that I'm missing...?

    Second, there are a lot of controls of shared variable that I will need to update the areas drop-down list, and in each case, I have to fill out of th drop-down list boxes programmatically. Is there an easier way to do it with the custom controls or type defs or something, so that I can just bring a control on the front panel that will always fill up with variables shared in my library?

    Thanks in advance for the help.

    Michael Hampson

    XL Automation, Inc.

    I rarely disagree with Ben, but a driving force seems to be overkill for a job you want to do it once when the application starts.  Simply create a first reference your comboboxes (shouldn't be too much work unless you have a large number of them), then loop through the array, as shown:

  • List box served selection range of excel cells

    I used the llb file found on this link to enter data from an excel spreadsheet.

    http://zone.NI.com/DevZone/CDA/EPD/p/ID/3409

    My problem is I want the ranges of cells to be hard-coded according to what the user selected in a drop-down list box.

    My starting point in the worksheet excel always being cell (3, 2), I managed to get rid of the control 'start' and hard-coded entry departure (3: 2).  This method works.

    However, depending on what the user selects from the drop-down list box, my arrival point is different.

    Tell if it takes 'Apples' from the drop-down list box, the final cell can be (15: 10), if it takes 'Oranges', it'll be (9, 9).

    I just started to use labview one last week, still getting used to all the buttons.

    Thank you!

    You must use a box structure.  Each case represents one of the items in the ComboBox and sets some constants are required to represent each Excel range that you are interested in.

  • Channels I "sliding and dropped ' in a list box cannot be" sliding and dropped "listbox origin. How can I fix?

    I currently have 4 list boxes that are allowed to have their values of string slipped and fell another 4 listboxes (in any installation: first listbox to the fourth, the second to the third, etc.).

    However, as part of my intentions, I want to be able to take the strings I have initially D & D and bring them back to their original, respective list box.

    I tried the following and it did not work (not to my surprise):

    I have a case of processing event in 3 parts with the following parts: [1] Final listboxes (target) - 1,2,3,4: Drag from?

    [2] initial listboxes (source) - 1,2,3,4: drag validate

    [3] initial listboxes (source) - 1,2,3,4: Drop

    Thanks to the one who answers... very appreciated.

    Sincerely,

    IHopeThisIsAValidAlias

    By following the instructions described in the fromm8 article I don't see any problems.

    My feeling is that you turn off the natural drag & drop behavior of your drop-down lists: "the drop [s] event management overrides the typical capacity of a listbox.

    Knowing this, your event should add functionality that you took (or stay away from the events that you can not imitate).

    You mentioned using drag from?, enter Drag and Drop but without explanation a lot better the way you use the or example code it is impossible to determine if you really need to use these events or not.

    My recommendation would be to stay away from these events and, as the article points out, the Drag ended event works while preserving the D & D of the ListBox.

  • List box width of path not taken into account

    What's new in Ultiboard 10.1:

    I noticed that you cannot select a width value in the Trace Properties dialog box using only the drop-down list box. For example, I have a net that was set manually to 1 mm. If I want to choose 'Use Net settings' instead, the action is not executed. It only works if I type something in the box.

    I checked and this bug wasn't there in version 10.0.

    Thank you

    Alex

    Hi Alex,

    The problem is the button apply only become active and if you click OK at the bottom the dialog box closes the setting does not change, my work around is to click the radio fixed track and then Trace can be move down again, this should activate the application.  This is a known bug, and it is in our system.

  • I checked the updates, but the updates list box would stop now.

    * Original Title: Windows Update

    I am running windows 7 64 bit sp1. I formatted my computer yesterday morning after installation of windows and office, I checked for updates, and the updates list box would stop now. He ran for 24 hours until 11:00 and still the same, to research. Everything is enabled for the update services and. Any help?

    Just did this yesterday and today...

    Windows Update does not work

    This is a very common problem lately.  The tool the more importantly you need right now is a lot of patience.  Resources Windows Microsoft Update are prioritize the updates of Windows 7 to a very low service level and have been since the beginning of summer 2015.  It is not uncommon that the update of Windows to take one night.

    In many cases, the following rather simple and fast process works.

    http://answers.Microsoft.com/en-us/Windows/Forum/windows8_1-update/Windows-Update-problem-error-code-80080008/de8114b5-1487-4B31-9b28-f11974718df1?auth=1  This thread has essentially lists a series of commands that I found generally fixed WU.

    Start, all programs, accessories, right-click on command prompt, select run as administrator, OK.  Type the following in the black box:

    1. net stop wuauserv
    2. net stop cryptSvc
    3. net stop bits
    4. net stop msiserver
    5. Ren SoftwareDistribution.old C:\Windows\SoftwareDistribution
    6. Ren C:\Windows\System32\catroot2 catroot2.old
    7. net start wuauserv
    8. net start cryptSvc
    9. net start bits
    10. net start msiserver
    11. pause
    12. Output

    Services of type in the text box above the start planet.  Find each of the following items and make sure they are set to automatic: Intelligent Transfer in the background, cryptographic, Windows Installer, Windows Update services.  Double-click on each item and choose automatic.

    If you still have a problem, try this.  It will take a long time, but in almost all gets case Windows Update back on the right track.

    1. Download and run the appropriate version for your system KB947821 update readiness tool system.  https://support.Microsoft.com/en-CA/KB/947821 32-bit systems X 86.  X 64 64-bit systems.  This is likely to take some time (may be several hours) because it makes all kinds of resets.
    2. Download KB3102810 directly from the Microsoft web site and install it.  https://support.Microsoft.com/en-us/KB/3102810

    Now restart Windows Update.  Do NOT restart Windows.   Be very, very sick, it will probably take a while.

Maybe you are looking for