OnSelectedIndexChanged query drop-down list

Hello

I use a Visual of foreground, within my ListView, to allow the user to classify what country they would like to be displayed.

leadingVisual: [
                                Container {
                                    id: dropDownContainer
                                    topPadding: 20
                                    leftPadding: 20
                                    rightPadding: 20
                                    bottomPadding: 20
                                    background: Color.create("#212121")
                                    DropDown {
                                        id: dropDown
                                        title: qsTr("Continent:")
                                        Option {
                                            text: qsTr("All")
                                            selected: true
                                        }
                                        Option {
                                            text: qsTr("Africa")
                                        }
                                        Option {
                                            text: qsTr("Antarctica")
                                        }
                                        Option {
                                            text: qsTr("Asia")
                                        }
                                        Option {
                                            text: qsTr("Australia")
                                        }
                                        Option {
                                            text: qsTr("Europe")
                                        }
                                        Option {
                                            text: qsTr("North America")
                                        }
                                        Option {
                                            text: qsTr("South America")
                                        }
                                        onSelectedIndexChanged: {

                                        }
                                    }
                                }
                            ]

From now on, I'm currently not sure how not to show that the continent selected to the user.

I have a request put in place for when the user performs a search for a country, but I can't reuse the same query to show only one continent when it is selected in the drop-down list.

Container {
                        id: searchContainer
                        visible: false
                        background: Color.create("#212121")
                        layout: StackLayout {
                            orientation: LayoutOrientation.LeftToRight
                        }
                        leftPadding: 10.0
                        rightPadding: 10.0
                        topPadding: 15.0
                        bottomPadding: 15.0
                        TextField {
                            id: urlBar
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 3.0
                            }
                            hintText: "Search..."
                            verticalAlignment: VerticalAlignment.Center
                            textFormat: TextFormat.Plain
                            onFocusedChanged: {
                                if (focused == true) {

                                }
                            }
                            inputMode: TextFieldInputMode.Default
                            input.submitKey: SubmitKey.Search
                            input.onSubmitted: {
                                dataSource.sQuery = urlBar.text
                            }
                            onTextChanging: {
                                dataSource.sQuery = urlBar.text
                            }
                        }
                        Button {
                            text: qsTr("Cancel")
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 1.0
                            }
                            onClicked: {
                                urlBar.text = ""
                                dataSource.sQuery = ""
                                searchContainer.setVisible(false)
                            }
                        }
                    }

            attachedObjects: [
                // Definition of the second Page, used to dynamically create the Page above.
                GroupDataModel {
                    id: dataModel
                    sortingKeys: [ "title" ]
                    grouping: ItemGrouping.ByFullValue
                },
                DataSource {
                    id: dataSource
                    property string sQuery: ""
                    onSQueryChanged: {
                        dataModel.clear()
                        load()
                    }
                    source: "asset:///XML/Countries.xml"
                    type: DataSourceType.Xml
                    remote: false
                    query: "/root/continent"

                    onDataLoaded: {
                        //create a temporary array tohold the data
                        var tempdata = new Array();
                        for (var i = 0; i < data.length; i ++) {

                            tempdata[i] = data[i]

                            //this is where we handle the search query
                            if (sQuery == "") {
                                //if no query is made, we load all the data
                                dataModel.insert(tempdata[i])
                            } else {
                                //if the query matches any part of the country TITLE, we insert that into the list
                                //we use a regExp to compare the search query to the COUNTRY TITLE (case insenstive)
                                if (data[i].listItem.title.search(new RegExp(sQuery, "i")) != -1) {
                                    dataModel.insert(tempdata[i])

                                    //Otherwise, we do nothingand donot insert the item
                                }

                            }

                        }

                        // this if statement below does the same as above,but handles the output if there is only one search result
                        if (tempdata[0] == undefined) {
                            tempdata = data

                            if (sQuery == "") {
                                dataModel.insert(tempdata)
                            } else {
                                if (data.listItem.title.search(new RegExp(sQuery, "i")) != -1) {
                                    dataModel.insert(tempdata)
                                }
                            }
                        }
                    }
                    onError: {
                        console.log(errorMessage)
                    }
                }
            ]

Any help in creating a query on how to display only the selected option in the listview, would be great.

Thanks in advance

I'm not sure what goes wrong.

leadingVisual: [
                                Container {
                                    id: dropDownContainer
                                    topPadding: 20
                                    leftPadding: 20
                                    rightPadding: 20
                                    bottomPadding: 20
                                    background: Color.create("#212121")
                                    DropDown {
                                        id: dropDown
                                        title: qsTr("Continent:")
                                        Option {
                                            text: qsTr("Africa")
                                            value: "Africa"
                                        }
                                        Option {
                                            text: qsTr("Antarctica")
                                            value: "Antarctica"
                                        }
                                        Option {
                                            text: qsTr("Asia")
                                            value: "Asia"
                                        }
                                        Option {
                                            text: qsTr("Australia")
                                            value: "Australia"
                                        }
                                        Option {
                                            text: qsTr("Europe")
                                            value: "Europe"
                                        }
                                        Option {
                                            text: qsTr("North America")
                                            value: "North America"
                                        }
                                        Option {
                                            text: qsTr("South America")
                                            value: "South America"
                                        }
                                        onSelectedIndexChanged: {
                                            dataSource.sQuery = dropDown.at(dropDown.selectedIndex).value;
                                        }
                                    }
                                }
                            ]

When I choose an option, no data appears at all

Tags: BlackBerry Developers

Similar Questions

  • Direct query of database - add drop-down list

    Hello

    I created a direct request to the database and would like to represent the output in a table format. How can I add a drop-down page filter, I would like to move two columns as a page drop-down lists, and also be able to display the columns in the table.

    I know how with a PivotTable, but is this also possible with a table layout?

    Thank you

    Here's the answer to your question: no, you can't do "drop trailers", in a table view. You can use the pivot table as described in the previous posts.

    You will need to use the prompts of dashboard for your choice. You say probably, "but the guests of dashboard must be based on a column in the subject area and I can't select it because I use a live database as my source. So, how to create ask her? »

    Good question. My question is, on the columns you need as the "drop down filters,' are these columns in any existing domain? I know that your application is built on-line database, but if the specific column you need for your prompt dashboard is in a domain, you can use this area to build your guest dashboard.

    You can add a WHERE condition in your live database to receive presentation variables. Read below to learn how:

    http://108obiee.blogspot.com/2009/11/variables-in-direct-database-requests.html

  • using a drop-down list to power a listview

    I try to get a drop-down list selection (newOption) to fuel a sql query to get more information in a listview. The drop down menu works ok, but the list is empty. My dosent sql query recognize newOption and therefore does not feed listview.

    Please could you help me with the query syntax. Thank you.

    My code is below.  If I replace '+' "' + newOption +" ' with a sql table entry, IE 'the cradle', then the listview works very well.

    import bb.cascades 1.2
    import bb.data 1.0
    import com.apiary.data 1.0

    {Page}
    ID: infoPage

    {Of container
    {Label
    text: "Info Page".
    verticalAlignment: VerticalAlignment.Center
    horizontalAlignment: P
    }

    {Drop-down list
    ID: dropdown
    }

    {To ListView
    ID: apiaryList
    dataModel: dataModel

    listItemComponents:]
    {ListItemComponent}
    type: 'point '.
    {StandardListItem}
    ID: apiaryItem

    Title: ListItemData.apiary_name
    Description: ListItemData.apiary_location
    status: ListItemData.apiary_id
    }
    } / / end of ListItemComponent
    ]

    onTriggered: {}

    }
    }
    attachedObjects:]

    {GroupDataModel}
    ID: dataModel2
    },
    {ComponentDefinition}
    ID: optionFactory
    Option {}
    }
    },
    DataSource {}
    ID: dataSource2
    Source: "sql/hood_apiary.db.

    query: "SELECT * FROM Apiary ORDER BY apiary_name".

    onDataLoaded: {}
    dataModel2.insertList (data);

    Now, this is going to populate the drop-down list while reiterating each
    the query data and adding one by one to the drop-down list
    using the optionFactory component to dynamically add definition
    New Options for the drop-down list
    for (var i = 0; i)< data.length;="">
    {
    Create new Option
    var newOption = optionFactory.createObject)

    Set the text of the Option categoryfield (title of the drop-down list)
    newOption.text = data .apiary_name [i]
    Console.log ("newoption.text =" + newOption.text);

    Add the Option in the drop-down list
    DropDown.Add (newOption);
    }
    }
    },

    {GroupDataModel}
    ID: dataModel
    },
    DataSource {}
    ID: dataSource
    Source: "sql/hood_apiary.db.

    string newOption property
    query: "SELECT * FROM Apiary, hive where apiaries.» [apiary_name] = ' "+ newOption +" ' AND Apiary. [apiary_id] = hive. [apiary_id] AND the hive. [apiary_id] is not null ORDER BY hive_id DESC'
    onDataLoaded: {}
    dataModel.insertList (data);
    }
    }
    ]

    onCreationCompleted: {}
    When the display of the list has been created, load the data into the listview
    and the drop-down list.
    dataSource.load ();
    dataSource2.load ();
    }
    }

    }

    Hello Simon

    Thank you very much for your help, you have solved a problem I had for centuries.

    {Drop-down list
    ID: apiarydropdown
    Title: 'select the Apiary.
    onSelectedIndexChanged: {}
    var dropvalue = apiarydropdown.at ("apiarydropdown.selectedIndex") .text;
    Console.log ("dropvalue has been changed to" + dropvalue);
    Console.log ("selectedIndex was changed to" + selectedIndex);
    dataSource.query = "SELECT * FROM Apiary, hive where apiaries.» [apiary_name] = ' "+ dropvalue +" ' AND Apiary. [apiary_id] = hive. [apiary_id] AND the hive. [apiary_id] is not null ORDER BY hive_id DESC'
    dataModel.clear () / / clears all previous listview view
    dataSource.load () / / load listview
    }
    }

  • Populating drop-down list with SQL

    I have a database and I want to fill the drop-down list with a 'Group By' request to show the various categories without showing many of the same.  Here's the code I'm having difficult with:

    DropDown {
                    id: filterSelect
                    visible: true
                    enabled: {if (purchaseValue != false){false}}
                    bottomPadding: 20
                    title: qsTr("Category:") + Retranslate.onLanguageChanged
                    horizontalAlignment: HorizontalAlignment.Center
                    options: Option {
                        id: allOption
                        text: qsTr("All") + Retranslate.onLanguageChanged
                        selected: true
                    }
                    onSelectedOptionChanged: {
                        if(filterSelect.selectedOption == allOption){
                        _app.refreshObjects()
                        }
                        else{
                        dataSource.query = "select * from items where categoryfield LIKE '%"+ filterSelect.selectedOption.text+"%'"}
                    }
                    attachedObjects: [
                        ComponentDefinition {
                            id: optionFactory
                            Option {
    
                            }
                        }
                    ]
                    onCreationCompleted: {
    //                    "select categoryfield from items group by categoryfield"
                        var newOption = optionFactory.createObject()
                        newOption.text = 'Text to add' // or a variable fetched from data source
                        //newOption.otherfields = ...
                        filterSelect.add(newOption);
                    }
                }
    

    I have a data source that fills the listview, I want to use the same database to populate the drop-down list.  How should I go about this?  I tried to configure a different DataSource {} just for the dropdown menu, but I couldn't make it work.  In bold text, I am not clear as where I incorporate my SQL query against the newOption.text =

    TL; DR I try to use a SQL query to fill my menu drop-down using the same PB that is used for the listview.

    Any help will be appreciated and thanked!

    A friend by the name of Roger Leblanc http://appworld.blackberry.com/webstore/vendor/70290/?lang=en&countrycode=CA helped me and created a small code example to explain how it works.

    import bb.cascades 1.2
    import bb.data 1.0
    
    Page {
        Container {
            DropDown {
                id: dropdown
            }
            ListView {
                id: myListView
                dataModel: dataModel
                listItemComponents: [
                    ListItemComponent {
                        type: "item"
                        StandardListItem {
                            title: ListItemData.categoryfield
                        }
                    } // end of ListItemComponent
                ]
            } // end of ListView
        }
    
        attachedObjects: [
            GroupDataModel {
                id: dataModel
            },
            DataSource {
                id: dataSource
    
                // Load the data from an SQL database, based on a specific query
                source: "asset:///pinguin.db"
                query: "select categoryfield from items group by categoryfield"
    
                onDataLoaded: {
                    // After the data is loaded, insert it into the data model
                    // This will populate the ListView. You don't want to show
                    // categoryfield in ListView, I just wanted to show the difference
                    // between populating a ListView and a DropDown
                    dataModel.insertList(data);
    
                    // Now, this will populate the DropDown by iterating through every
                    // data from the query and adding it one by one to the DropDown
                    // using the optionFactory Component Definition to add dynamically
                    // new Options to the DropDown
                    for (var i = 0; i < data.length; ++i)
                    {
                        // Create new Option
                        var newOption = optionFactory.createObject()
    
                        // Set the Option text to categoryfield
                        newOption.text = data[i].categoryfield
    
                        // Add the Option to DropDown
                        dropdown.add(newOption);
                    }
                }
            },
            ComponentDefinition {
                id: optionFactory
                Option {}
            }
    // end of DataSource
        ]
    
        onCreationCompleted: {
            // After the root Page is created, direct the data source to start
            // loading data
            dataSource.load();
        }
    }
    
  • Fill the drop-down list in the SQL data source

    I have a data source that retrieves data from an sqlite database. How do I pass two areas of this query to a drop-down list on the page. I want to create a drop down list with the value and the text of this data source

    Hello

    To extract the values you need to wait for onDataLoaded. "data" parameter is a list of cards.

    An example of code for data access :

    http://supportforums.BlackBerry.com/T5/Cascades-development/SQLite-count-query/m-p/2477699#M27180

    http://supportforums.BlackBerry.com/T5/Cascades-development/DataSource-data-in-JavaScript/m-p/244171...

    To add an option to the menu drop-down:

    attachedObjects: [
      ComponentDefinition {
        id: optionFactory
        Option {
        }
      }
    ]
    
    ... to add an option:
    
    var newOption = optionFactory.createObject()
    newOption.text = 'Text to add' // or a variable fetched from data source//newOption.otherfields = ...
    dropdownId.add(newOption);
    
  • How to fill out a drop-down list on the selection of items in another drop-down list using adf 12.1.3

    Hello

    I have a page that has the load drop-down lists and a "submit" button. The first drop down menu got filled using query based VO (IE read only VO) for LOV. The requirement is as below

    -on the selection of an element any in the first drop-down list, the user must fill the second dropdown.

    -Once the second dropdown is completed, the user can select element in the second drop-down list.

    -capture the second drop down menu items value selected in the method of action of the click on the submit button.

    Any help in this scenario will be useful.

    ---

    Rabindranath

    Sameh salvation,

    Thanks for the reply. Your code

    1. DCIteratorBinding iter is BindingContext.getCurrent () .getCurrentBindingsEntry () .get ("iteratorNameInPageDef") (DCIteratorBinding);.
    2. Object secondDropdownValue = iter.getCurrentRow () .getAttribute ("AttributeName");  has been really helpful to get the selected value.

    Thank you very much.

    ---

    Rabindranath

  • How to pass data in the drop-down list to two separate outputs

    Hi all

    currently I have a drop-down list named chg with this value:
    ValeurRet += "< option >" + bean.getCode () + "-" + bean.getDescr () + "< / option >";
    Therefore, the value of my combo would be sth like this: 00000 - something

    the problem is that when I recover data return selected in the list, the value will be a string as above and not two separate the value.

    I need to pass the value here in order for me to compare the string containing the data in my database:
    nim.setCode (RutString.getParameterToString (request, "chg"));
    nim.setDescr (RutString.getParameterToString (request, "chg"));

    Now the data in my database is the following:
    Code: 00000
    DESC: something

    given that the above value is contained in the chg rather than the reverse, I couldn't use AS for my select statement.

    So is it possible for me this problem? Thnks in advance for your help!

    You can do two things:
    (1) pass the selection string from the sql query and use the sql functions (or pl/sql) to cut the chain and use only the part you are looking for (SQL has a SUBSTR function and others that allow you to do this)
    (2) you want to at any time in your workflow in a java class, you can do this with the String methods and the parts of the query string.

    Timo

  • selecting a value in the drop-down list but page must not get recharged again.

    Hello
    I created a drop-down list. After you have selected a value from him, I can get a value in the box of text below according to updon one sql query. but the problem is that I HAV to select Page Action when the changed value parameter to the set value and redirect. Thanks to her whenever I have to select a value from the drop-down list, page get updated. Is there a way that will satisfy the requirement but page does not get new dependants.
    I use apex 4.2.
    Thank you

    You can create A dynamic Action to set the value while changing the value in the Select list (drop-down list).

    Event: change
    Selection type: item (s)
    Article (s): choose your selection list item
    Action: Execute the PL/SQL Code
    PL/SQL code:

    begin
    select colum_name into :Px_text_item_name from table where column_name=:px_select_list_name;
    end;
    

    Page elements to send: px_select_list_name
    Page referred to return: Px_text_item_name

    Its work for me without refreshing the page. Assume that, if you want to pass this value to the element in another page, then use the branch for redirection and assign the value to the element on the page of another.

    Thank you
    Lacombe

  • Hide the fields to add fields drop-down list in the advanced search mode.

    On the drop-down list to add fields in the field of the advanced search displayed by an af:query, is there a way to hide some of the attributes? He seems to show all the attributes of the default VO.

    The fields must be visible on other pages that use the VO. Table Panel and search queries will only to display a subset of the fields in the VO.

    Assigning to the attribute Display tip to hide will not do; at least this seems to be the case, because if I do that, then, the field is not available on the data control to be placed on other pages.

    I guess I could create a separate VO just to the search page; but I try to avoid this, it invites excessive maintenance as the system grows. If no indication on how to hide a field VO on add fields while leaving the field to be displayed on other pages would be appreciated.

    Versions: JDeveloper 11.1.1.4, ADF business 11.1.1.59.23 components.

    Thank you.

    I wrote a blog post on this subject and a sample of http://tompeez.wordpress.com/2012/01/06/jdev-afquery-hide-some-attributes-from-query-panel-but-show-them-in-the-result-table/ here

    Timo

  • Drop-down lists specific row in table

    Hello

    I use jdev 11.1.13 and created a Fusion project.

    In the application, I have a table with two columns editable. 1st outputtext and 2nd column selectonechoice column.
    The drop-down list values come from a query of lookup table where the value of outputtext 1st column would be the binding variable.

    My requirement is to show the line of the specific list values which means function 1st column value.

    Any help would be appreciated.

    ~ Abhijit

    Hello

    Set the variable of relevant link in the data source list (vo that acts as the source for the values in the list, employeelist)
    In the Basic object view, in the users section see VO list and after the have attached, click the pencil icon
    You should see a connection variable and set the value as DeptNo which is another name for the attribute
    It should work?

  • Select the point in combobox/drop-down list, fields to update

    Hello

    I have a drop-down list. When a user makes a selection, I would like to query a database and return the results to be displayed in a form. Note, I don't want users to have to press a button, it should happen when an element is pressed. It sounds simple enough, but because I'm new, I'm fighting.

    I understand that I need to create a 'change' and then Manager in this handler, I need to run my t service get the data, but then when I try to access these data, nothing happens. I have to Bind something to the combobox? Here is my code.

    "" < s:ComboBox id = "lcidComboBox"change = "lcidComboBox_changeHandler (event)" labelField = "name" selectedItem ="bills.locn{}'> "

    " < s:AsyncListView list =" getLocationsResult.lastResult{}"/ > "

    < / s:ComboBox >

    protected function lcidComboBox_changeHandler(event:IndexChangeEvent):void

    {

    getLocationsResult.token = locationService.getLocations ();

    trace (locations.snam); <-this is not anything!

    }

    See you soon,.

    Brian

    OK, think about it. I needed to include a tag Binding then call my answering machine, the object is able to be called and I can view its properties.

    protected function lcidComboBox_changeHandler(event:IndexChangeEvent):void

    {

    getLocationsResult.token = locationService.getLocations ();

    snamTextInput.text = locations.snam;

    cuidTextInput.text = locations.cuid;

    }

  • Drop-down list refreshes tabular

    Hello

    I use Apex 4.0 and I want to do something simple. I have the page with the two regions, one with a drop-down list. I have another section that includes a tabular presentation. I want to be able to use the element of the box in the query: PXX_MY_OPTION in the query in the form of tables, but the page is not updated. What is the easiest way to get that update and allow me to always validate changes in the region in a table.

    Thank you

    Mark

    Dynamic action to trigger a refreshment table when the menu item editing drop-down.
    Inorder to ensure that changes if it is made in the form of tables is saved, you can invite a message until the area is updated

    (1) event: change
    triggered by: point PXX_MY_OPTION
    -> Real Action 1: set new session value using a dummy process of PLSQL

    BEGIN
       NULL
    END;
    

    items to submit page: PXX_MY_OPTION
    Real Action 2: Code to Javascript, which prompts the user before the update, asking the user if he wants to save the form in a table

    if (confirm('DO you want to save the changes made') )
    { return false; }
    else {return true}
    

    Action 3: Refresh region : select region in a table

    You can also improve step 2, to detect if the user has actually made some changes to the form of tables and then just ask confirmation.
    Search only this forum for this, you should find son who talks to whom.

  • Select from the drop-down list point based on text box is not empty not

    Hello. I have a javascript code to click a button and it will insert the date in a text box named "Controller_PDF_Creation_Doc_Control_Date" in my form. I also have a drop-down list called 'Release_Approval_Initials '. Everything I'm doing is when there is a date of entry in the text box, I want that the 'Release_Approval_Initials' of the menu drop-down default by selecting the option "TM". The drop-down list is filled dynamically too. How can I do this? Here is the code I have.

    < SCRIPT LANGUAGE = "JavaScript" >

    verify() {} function

    var partNumber = ";

    var ecoNumber = ";

    var pdfDate;

    var queue;

    var queueValue = ";

    var allArray = document.getElementById('listofids').value.split (",");

    var error = false;

    for (var i = 0; i < allArray.length; i ++) {}

    pdfDate = document.getElementById('Controller_PDF_Creation_Doc_Control_Date'+allArray[i]).value;

    <!-document.getElementById ('Controller_PDF_Creation_Doc_Control_Date1') .value =' 19 / 08/11 '; ->

    queue = document.getElementById ('Release_Approval_Initials' + allArray [i]);

    queueValue = tail [queue.selectedIndex] .value;

    If ((pdfDate! = '' & & queueValue == '') |) (pdfDate == '' & & queueValue! = '')) {

    error = true;

    ecoNumber = document.getElementById('ECID'+allArray[i]).value;

    partNumber = document.getElementById('Part_Number'+allArray[i]).value;

    Alert ("You must enter a date of authorization to create PDF or Doc Control files and the queue to release for ECO" + ecoNumber + "part number:" + partNumber);

    }

    }

    {if (Error)}

    Returns false;

    }

    else {}

    Returns true;

    }

    }

    < /script >

    "< cfinput type ="Text"name =" "Controller_PDF_Creation_Doc_Control_Date #ItemID #" id = "Controller_PDF_Creation_Doc_Control_Date #ItemID #" value = "#DateFormat(Controller_PDF_Creation_Doc_Control_Date,"M/D/YY")" # "size ="12"maxlength ="8"validate ="date"required ="no"message ="you must enter a valid date in the format m/d/YY in the creation of PDF files or Doc control Date">"

    < cfinput type = "hidden" name = "today_date" id = "today_date" value = "#DateFormat (now ()," D/M/YY")" # "/ >"

    < input type = "button" value = "today's Date" onclick = "document.getElementById('Controller_PDF_Creation_Doc_Control_Date#ItemID#').valu e = document.getElementById ('today_date') .value" >

    < select name = "" Release_Approval_Initials #ItemID # "id =" Release_Approval_Initials #ItemID #">"

    < option value = "" > < / option >

    < cfloop query = "ShowDataEntryInitials" >

    < option value = "" #Initials # ""

    < cfif initial EQ ReleaseInitials > selected

    < / cfif > > #Initials # < / option >

    < / cfloop >

    < / select >

    Any help would be greatly appreciated. Thank you.

    Andy

    I figured out how to make it work. I just had to add parentheses in the right places to make it work. Here's what I did:

  • In the drop-down list to pull in file access

    HI -.

    I'm a beginner to this bear so please with me.  I know that have been discussed a hundred times but I can't seem to find someone else who is having this specific problem.

    I have v8.2.

    Given that my script was not working, I downloaded the document "Adobe LiveCycle Designer 7.0, providing research of the interactive database of forms" to try to see if I can understand what is happening.

    I built exactly as in the document except for the addition of 'clone (1)' as needed based on what I found in other messages on v8.2 and errors before.

    Drop-down list:

    / * This object listbox will fill two columns with data from a data connection.

    sDataConnectionName

    -the name of the data connection to get the data.

    -Note that the data connection appears in the data view.

    sColHiddenValue

    -It is the hidden value of listbox column.

    -Specify the name of the table column used for the fill.

    sColDisplayText

    -It is the column of the ListBox display text.

    -Specify the name of the table column used for the fill.

    These variables must be assigned for this script runs correctly.

    */

    var sDataConnectionName = "DataConnection;

    var sColHiddenValue = "ID";

    var sColDisplayText = "PART_NO."

    Search for sourceSet node that match the name of DataConnection

    var nIndex = 0;

    While (xfa.sourceSet.nodes.item (nIndex) .name! = sDataConnectionName)

    {

    nIndex ++;

    }

    oDB = xfa.sourceSet.nodes.item (nIndex) .racing var (1);

    oDB.open ();

    oDB.first ();

    Search with the command 'class name' node

    nIndex = 0;

    While (oDB.nodes.item (nIndex) .className! = 'command')

    {

    nIndex ++;

    }

    Define BOF and EOF to stay

    .query.recordSet.setAttribute ("stayBOF", "bofAction"), oDB.nodes.item (nIndex);

    .query.recordSet.setAttribute ("stayEOF", "eofAction"), oDB.nodes.item (nIndex);

    Find the record with the corresponding data connection name

    nIndex = 0;

    While (xfa.record.nodes.item (nIndex) .name! = sDataConnectionName)

    {

    nIndex ++;

    }

    var oRecord = xfa.record.nodes.item (nIndex);

    Find the value

    var oValueNode = null;

    var oTextNode = null;

    for (var nColIndex = 0; nColIndex < oRecord.nodes.length; nColIndex ++)

    {

    If (oRecord.nodes.item (nColIndex) .name is sColHiddenValue)

    {

    o

    ValueNode = oRecord.nodes.item (nColIndex);

    }

    ElseIf (oRecord.nodes.item (nColIndex) .name == sColDisplayText)

    {

    o

    Node = oRecord.nodes.item (nColIndex);

    }

    }

    While (!) ODB. IsEOF())

    {

    this.addItem (oValueNode.value, oValueNode.value);

    IDList.addItem (oValueNode.value, oTextNode.value);

    oDB.next ();

    }

    Close connection

    oDB.close ();

    Button:

    If (Len (Ltrim (Rtrim (SelectField.rawValue))) > 0) then

    $sourceSet.DataConnection.clone (1). #command.query.commandType = "text".

    $sourceSet.DataConnection.clone (1). #command.query.select.nodes.item (0) .value = Concat ("Select * from OfficeSupplies where ID =", Ltrim (Rtrim (SelectField.rawValue)), "")

    Reopen the Dataconnection

    $sourceSet.DataConnection.clone (1) .open)

    endif

    Preview PDF and it connects OK, menu drop down fills properly, but when I click the button, it ALWAYS fills the data from the first record (no matter what is selected in the drop-down list).  It's the same problem I had with my own build.

    Anyone have any ideas of what I have wrong?

    Thank you!

    Misty

    The other thing, that I just noticed is that I usually clone the entire connection and not each node in the link that you have. Try changing your code for this:

    var nIndex = 0;
    While (xfa.sourceSet.nodes.item (nIndex) .name! = "DataConnection2")

    nIndex = nIndex + 1
    endwhile

    oDB = xfa.sourceSet.nodes.item (nIndex) .racing var (1); pertaining to the specified data connection node
    Configure sql call DB to get the details about MNR

    If (HasValue (SelectID)) then

    oDB.nodes.item (1).query.setAttribute ("text", "commandType");

    sqlString var = Concat ("SELECT * FROM drugs WHERE MRN = '", Ltrim (Rtrim (SelectID.rawValue)), "'")

    oDB.nodes.item (1).query.select.nodes.item (0) .value = sqlString.

    now connect to the DB and get a recording
    oDB.open)
    oDB.close ();

    endif

    Also if you copy and paste code quotes always get screwed up... .you will have to type.

    Paul

  • How to view the separate date in a drop-down list

    I know I've done this before. For the life of me I don't see what I'm doing wrong. I have an outputing to query date/time formats from a database Access in a drop-down list box select. I can't go out on double dates. I wonder if it is because the time in the database is different for each line? I want to just display an 08/09/2006, even if there are 40 of them. Here is my code:

    < cfquery name = "qdate" datasource = "mydb" >
    Entereddate SELECT DISTINCT from archivedletters ORDER BY entereddate
    < / cfquery >


    <! - exit - >


    < do action = "queryarchived.cfm" name = "StartDate" method = "post" > "
    < strong > sample numbers by date range search: facilities > < br >
    Beginner: < br >
    < select name = "StartDate" >
    < cfoutput query = "qdate" >
    < option value = "#entereddate #" > #DateFormat(entereddate, 'mm/dd/yy') # < / option >
    < / cfoutput >
    < / select >

    < br >
    End: < br >
    < select name = "EndDate" >
    < cfoutput query = "qdate" >
    < option value = "#entereddate #" > #DateFormat(entereddate, 'mm/dd/yy') # < / option >
    < / cfoutput >
    < / select >

    < input type = "submit" value = "Go" >
    < / make >

    Thanks for all the help. I tried the method classified by MikerRoo and that seems to fix the problem.

Maybe you are looking for

  • How to pass a number any parameter in a call sequence

    Hello I have a sequence that is intended to do the same job for one or more of the same items typed. for example: ______________ subsequenceA: (all table elements) ForEach element do the work ENDFOR ______________ now in my caller, I want to call sub

  • 8500 A909N

    I have a PRO 8500 first; A909N inkjet. The printing options are: "print in grayscaleff; "High quality";"." Black ink only. As a graduate of mechanical engineering with 40 years of experience in the aerospace industry not equip me to understand comput

  • More HP psc 1200 series (all-in-one)

    MI more HP psc 1200 series all in a no prints porque el sistema reported that no tiene papel. He puesto cantidades of papel, pero continua respond that no papel tiene distintas. MI PC desktop are HP y tiene Windows 7 Ultimate. Gracias.

  • Packed SLM2008 fall

    Hello I recently looket in the following thread: http://homecommunity.cisco.com/t5/Switches/Linksys-SRW2008-Load-balance-setup/td-p/217487 I recently posted this on the QNAP forum: http://forum.qnap.com/viewtopic.php?f=50&t=56416 I don't know where t

  • Question of notification icon

    Hi guys, can someone tell me what means "unauthorized" icon (next to the icon of my awakening) upwards in the notification bar? I've noticed since yesterday. I did not something new with the exception of mobile data for 1 day (I normally use Wifi)