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);

Tags: BlackBerry Developers

Similar Questions

  • Storage of the client in the SQL data source fails all of a sudden

    After performing several Windows 2008 security updates last night, one of the sites started throwing errors related to access to the client storage database, which is the default value as defined by the CF Administrator:
    coldfusion.runtime.ClientScopeDBException: operation failed on the source of data DATA source NAME.
    Reason of failure java.security.AccessControlException: access denied.


    Most of our sites use this data source for storage of client, and none of them have the problem.
    Editing the file Application.cfm to use clientstorage = "cookie" got the site up.
    I then added a NEW data source to the list of storage Client and set the Application.cfm file to use instead.
    This works. As sson as I remove the Application.cfm file clientstorage attribute, the site breaks.
    Short to reboot the server (which happened last night after the updates), I restarted IIS all related services.
    Any ideas?

    Java security error, huh? You know, I had missed that in your first note. (He says he is, "reason for failure java.security.AccessControlException: access denied".)

    I'm starting to wonder now: what is a CF Enterprise Deployment? It is configured (in the CF Admin) to use what is called "Security Sandbox"? If so, the problem might be that this one app is in a sandbox that has not been configured to access the DSN. Sandboxes are configured for all code running in a given directory (and its subdirectories), which would explain this work for everyone, but this one.

    Purging of customer data is quite drastic, if data are important for your application. I recommend you try this if you have a little more time.

    If you're reading this I would like to learn more about Sandbox security, in addition to the docs, you can read more in some articles that I did for the Dev Center a few years previously, to http://www.adobe.com/devnet/security/articles/sandbox_01.html and http://www.adobe.com/devnet/security/articles/sandbox_02.html. While it was written in the period of CF6, it still applies to the 7 and 8.

  • Populate drop-down list with the results of several drop-down lists

    Hi, I am creating a form where the results of two drop-down lists then would fill another drop-down list. I'm not new to javascript, but I'm new to using it in Acrobat, so while I found some answers to this: Drop-down list fill in multiple fields of text. I don't know where to implement this, if it is still the right thing, I'm looking for pipes for

    Oh and I use Acrobat Pro DC. Any help would be much appreciated!

    OK, you can create a function at the level of the document that is called in the Validate event of each of the two first drop down menus, something like:

    Function in JavaScript to the document level

    function updateDropdown() {}

    Get references to the drop-down menus of entry

    var F1 = getField ("DropdownList1");

    var F2 = getField ("DropdownList2");

    Refer to the output drop-down list

    F3 var = getField ("DropdownList3");

    Get the values of input field, as strings

    var s1 = event.target = f1? Event.value: f1.valueAsString;

    var s2 = event.target = f2? Event.value: f2.valueAsString;

    Fill the drop-down list of output with the elements, or deselect it if either input dropdown is 'empty' (single topic area)

    If (s1 = "" |) s2 === " ") {

    F3.clearItems ();

    } else {}

    F3.setItems (["", s1, s2]);

    }

    }

    In the two first downs Validate event, call this function like this:

    updateDropdown();

    You can of course name the function you want. More information about the properties and the methods used in the code are available in the Acrobat JavaScript documentation.

  • Export the value of the drop-down list of failure

    Hello colleagues!

    I created a simple form using LiveCycle Designer, which consist of two elements of text and drop-down list box:

    The drop-down list is filled with XML data:

    <MyData>
    <country/>
    <countries>
    <item uiname="United States" token="US"/>
    <item uiname="Vietnam" token="SRV"/>
    </countries>
    <state/>
    <US>
    <item>California</item>
    <item>New York</item>
    <item>Texas</item>
    </US>
    <SRV>
    <item>An Giang</item>
    <item>Bac Giang</item>
    <item>Bac Kan</item>
    </SRV>
    </MyData>
    

    Then, I handed the form, received a response and he added in the base file of responses:

    Later, I tried to export the responses, but it freezes. I think that the loop is executed, because I can move the progreess window, I can close the wndow to Adobe Acrobat, but when I try to cancel the export process nothing happens:

    So I discovered that the problem is in the drop-down list populated from XML data and list which is binding against XSD or XML elements.

    I don't know what I should do next.

    Links:

    Simple form. XML data.

    Adobe support confirmed that the problem with dropdown lists bug. Will be fixed in future version.

  • Validation in the drop-down list box

    Hello

    I use JDev 11.1 with fusion ADF

    I have the drop-down list box, this drop-down list box include a description and the value I want to if the user choose value e.g. - 2 and press the button Save appear validation said cannot insert this value, how can I do?

    Note that this drop-down list box to retrieve data from managed bean (not the view object)

    Concerning

    Hello

    You add a validator to your combobox component.

    Select your component in the property inspector-> Behaivour-> Validator-Edit... and create a method, and then you add the validation code it.

    More details on custom validators: http://database.in2p3.fr/doc/oracle/Oracle_Application_Server_10_Release_3/web.1013/b25947/web_val004.htm#CIHFJBDI

    Greetings,
    Bogdan

  • 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

  • Simple javascript for the drop-down list IF, fills two different fields

    I don't write js, but can grasp what it did when I hang a sample edit and re - purpose. I have a form simple fax that already resets to the opening. Here's what I'm doing:

    User selects the sender's name in the drop-down list of about 15 (grow w / hour)

    Fill in the following text field "sender Fax #" with the number of direct fax (xxx-xxx-xxxx in the js) user

    Are also complete this later text field "sender Ph #" with the number of direct ph of the user (xxx-xxx-xxxx in the js)

    Here is an example which I believe works the way you want: https://workspaces.acrobat.com/?d=gZNDS8dQQNqvwocUufXHNQ

    You have to watch the fields to see how they are implemented and to study different scripts to see how it works. If you have any questions, post again.

  • Drop-down list to fill in the slide empty quiz

    Hello

    I'm using the drop down list for my fill in the blank slide, but when the user chooses one of them, they are not displayed correctly. I think the widget is too small and that is why, but how can I increase its size?

    adobeFillin.png

    Thank you

    Here's a crazy solution: add multiple spaces after each word... After all, I'm the Queen of the workaround

    Lilybiri

  • How the auto fill a field based on the drop-down list unless the specific item is selected

    Hi all

    My apologies if I posted this in in the wrong place, but I am new to these forums, JavaScript and Adobe LiveCycle.

    I am trying to build a form using LiveCycle Acrobat but have problems with the drop-down lists.

    Inititaly I just wanted to fill in the fields in a table based on a matching menu selection dropdown in another table.

    I used the following code and it worked fine:

    Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)

    fFrom var = xfa.resolveNodes ("Workbook.Content.Table1.Row3.AppropriationDetails [*]. Row4.cell1');

    OTF var = xfa.resolveNodes ("Workbook.Content.Table2.Row3.AppropriationDetails [*]. Row4.cell1");

    for (var i = 0; i < = fFrom.length - 1; i ++) {}

    fTo.item (i) .rawValue = fFrom.item (i) .boundItem (xfa.event.newText);

    }

    The problem is that now I want the code above works UNLESS one of the items in the drop-down list is enabled specifically in this case, I want the text box in the other table to display a message such as "Details of the entry in the field below.

    I tried to create an If Else statement using the following code:

    Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)

    fFrom var = xfa.resolveNodes ("Workbook.Content.Table1.Row3.AppropriationDetails [*]. Row4.cell1');

    OTF var = xfa.resolveNodes ("Workbook.Content.Table2.Row3.AppropriationDetails [*]. Row4.cell1");

    for (var i = 0; i < = fFrom.length - 1; i ++) {}

    If (fFrom.item (i) .rawvalue = "Option 3") {}

    fTo.item (i) .rawValue = "enter the details in the field below.

    }

    else {}

    fTo.item (i) .rawValue = fFrom.item (i) .boundItem (xfa.event.newText);

    }

    }

    The code now filled the field with "Enter the details in the field below" any item I select in the drop-down list.

    Your help is greatly appreciated.

    See you soon,.

    ozzy_q

    Hello

    You use .rawValue in the change event. This will cause problems because the selection of the users has not received .rawValue from the drop-down list at the time when the change event is triggered.

    Move your script as it should to the output of the dropdown event.

    Hope that helps,

    Niall

  • How to use the drop-down list box to fill in a text box

    I'm a beginner when it comes to Java Script.  I have seen a lot of different discussions, look at a lot of articles "helping" Acrobat 9 and Java Script, but only to be left confused and dazed.  I hope someone can tell me how to write a script that fills a text box that sits on my form with the value of exports of the selection in the combo box...

    Thank you

    If you want that the read-only text box, simply set with the following custom calculate script:

    Set this field to the value of the drop-down list box

    Event.Value = getField("combo1").value;

    but replace "combo1' with the actual name of the combo box field.

    If you want something else, post again with more information.

  • Fill a textfield with the drop-down list selection

    Day of goo,

    I have a menu drop down and a textfield in a table with one line and an Add button.

    The line is repeatable, now, when I select a value in the drop-down list, say "23" and it fills the textfield say with "Jordan".

    Then I click the addButton to add a new line, now I select '7' in the new drop-down list and its supposed to fill the new textfield with "David Villa,"

    Instead, he replaces what was on the original textfield("Jordan") with David Villa, leaving the new empty textfield.

    Can someone help me please.

    Another thing, I have to select two times for the drop-down list to the fire, why is this?

    Hello

    First thing: I suspect that you have the script to the change event, but use .rawValue for the test. With the drop-down menus, I tend to use the exit and .rawValue event.

    With respect to the textfield, you probably use a too full reference, like "Row1.usersName". If you just use "usersName, for example the name of your textfield, then Acrobat/Reader uses the particular instance of the textfield in the same line as the drop-down list.

    Hope that helps,

    Niall

  • Change the style of the drop-down list for the fill-in-the-white questions

    As the title says, I just want to know how to change the style, or at least font size in the drop-down lists to fill-in-the-blank questions. By default have a tiny font that is difficult to read, and a blocky interface. I can do to fix that?

    Hello

    I'm sorry, but this is not possible at the moment. If you fill a feature request (as I already did) to find out a better way to format these drop-down lists?

    Lilybiri

  • fill a list based on a value from the drop-down list box

    Well, I know a way around it but its quite long with what I know. I worked on a better solution for a day now. So maybe (or likely) someone knows better. I'm trying to fill a drop drop down based on a user selection figure in a list of check boxes. I know I could create several drop-down lists and hide away them until the user changes the value of binding. But the dropdowns would consume a lot of space in my form design in liveCycle. So is there another way or I'm stuck he made a long journey. I also need to assign values to these elements, since they change because the values are used as item numbers later that fill a text/number field later in form as a list of materials.

    Tell me if I'm wrong, please (I'm new to all this)

    in the box in the click event

    If (this.) RawValue == 1)

    {

    dropDownList1.addItem ("item # 1", "value1111");

    dropDownList1.addItem ("item # 2", "value2222");

    }

    on the other

    {

    dropDownList1.rawValue = "null";

    }

    I'm sure that null is not good and I don't know that I have to set the drop-down menu to clear items on preOpen. Or maybe not. And there is a way to add items without the addition of a new right of the line? I'm on the right track?

    Hello

    Rather than having the script in each of the boxes, you can have the script in the event preOpen the drop-down list that leans on the boxes.

    I downloaded an example here: https://acrobat.com/#d=VwREjsMgvqXpVqPu54kSNw

    Take a look at the preOpen the dropdown event.

    // clear the dropdown displayed value and items
    this.rawValue = null;
    this.clearItems(); 
    
    // repopulate the items based on the checkboxes
    if(fruit.rawValue == 1)
    {
         this.addItem("Apples", "fruit_001");
         this.addItem("Pears", "fruit_002");
         this.addItem("Oranges", "fruit_003");
         this.addItem("Bananas", "fruit_004");
         this.addItem("Grapes", "fruit_005");
    }
    
    if(cars.rawValue == 1)
    {
         this.addItem("Volvo", "car_001");
         this.addItem("Ford", "car_002");
         this.addItem("Opel", "car_003");
         this.addItem("Toyota", "car_004");
         this.addItem("Nissan", "car_005");
    }
    
    if(counties.rawValue == 1)
    {
         this.addItem("Co. Tipperary", "county_001");
         this.addItem("Co. Cork", "county_002");
         this.addItem("Co. Dublin", "county_003");
         this.addItem("Co. Clare", "county_004");
         this.addItem("Co. Kerry", "county_005");
    }
    

    Hope that helps,

    Niall

  • still problems with drop-down list fill the Script

    Well, I used the information I got this forum to fill a drop in a repeatable subform with javascript (and it even works with FormCalc) problem solved. But now when I test the script in format acrobat (with calculations) the last item on my list does not seem to be working properly. They are scripted like that on the preOpen event.

    DropDownListName.additem ("item 1", "1.00");

    DropDownListName.additem ("item 2", "2.00");

    etc.,

    etc.

    They are all the same, and they all show during the test. But when I click on the last item, it automatically entered the first element on the form and for some reason that I don't know, when I click on the arrow to the bottom of the drop-down list once again, will be my listed items 1-6 and 1-6 new (Double listing the items). If I click it a third time he triple will list the elements... Weird! Maybe I'm just tired, but more probably think I do something wrong (again!) Anyone have any ideas?

    One more thing so I don't have to add another post and I hope you people leave him alone. How do the total field sum of script so we round to the nearest cent (1.856 = 1.86) or which is not easy

    Hello

    The second issue of additional items in the drop-down list is easily sorted by including a line in the preOpen to clear the list first.

    DropDownListName.clearItems ();

    This should go before the addItem script.

    This erases the existing list, before be filled again. You would tend to use addItems, where list items will change according to the previous intervention of the user with the form.

    Regarding the round total, you can do this with script (check "Round" in the help file), but it is not necessary.

    When you have the total selected object, just go to the object/field tab and click models. On the display tab, you can select a model of currency with the currency symbol, the 2 decimal and thousands separator (IF your item is a numeric field).

    Good luck

    Niall

  • JavaScript to fill the text based on the drop-down list field

    Hello

    I'm trying to write a javascript script to fill a "Textfield" based on what I select in 'Dropdownlist control' this has on a relationship between them. I tried to integrate the script on the category of 'Change' and the script was the following, but it didn't work. I would be grateful if someone can help me with the correct procedure.

    Thank you

    Vijay

    Form1. #subform [0]. DropDownList2 [0]: change - (JavaScript, both)

    function populateDescription() {}

    if (document.subform [0].) {DropDownList2 [0] .value == "BIH")}

    document.subform [0]. TextField83 [0] .value = "Burn in and PBI history."

            }

    }

    I solved this problem by using a script to switch.

    Please see my previous thread in this regard and Paul example will provide you with the right script for a script to switch.

    http://forums.Adobe.com/thread/479021

    script on the drop-down list as follows

    Switch (this.rawValue) {}

    case "dropchoice1".

    FieldName1.RawValue = 'choice of text here ';

    FieldName2. RawValue = "choice of text here ';

    break;

    case "dropchoice2".

    FieldName1.RawValue = 'choice of text here ';

    FieldName2. RawValue = "choice of text here ';

    break;

    }

    Good luck.

Maybe you are looking for