The drop-down list schema lists (with the name/value pairs)

Hello

I'm looking for more information on creating a schema type definition that LiveCycle Designer ES will fill (fill in the name and value) of drop-down lists. For example, I have something like:

< xsd:simpleType name = "RoleTypeCodeType" >
< xsd:restriction base = "xsd:token" >
< value xsd: Enumeration = 'ABC' >
< xsd: annotation >
< xsd: documentation >
Aboriginal community
< / xsd: documentation >
< / xsd: annotation >
< / xsd: Enumeration >
< value xsd: Enumeration = "ADJ" >
< xsd: annotation >
< xsd: documentation > referee < / xsd: documentation >
< / xsd: annotation >
< / xsd: Enumeration >
...

< xsd:minLength value = "1" > < / xsd:minLength >
< xsd:maxLength value = "3" > < / xsd:maxLength >
< / xsd:restriction >
< / xsd:simpleType >

This creates a list. I can bind this to a list field. However, of course, when I saw the pdf, my drop down list items in this area are just the three-letter code. I would get the descriptions associated with these articles (as shown on the connection tab) to be filled. The end result is that my list see 'Indigenous community', 'referee', etc. and when selected, return 'ABC', 'ADJ' in the XML during export.

If list under the connection tab items are filled manually then this export works correctly. However, the list is generated during execution and dynamic. So nobody knows what the schema definition must be for the field in the list on the LiveCycle form to create the name-value pairs?

Thank you

John

Hi John,.

You will need to incorporate the schema, but you can reference the imported schema as they get integrated as well (there a bug in the designer when they were not integrated, but I think it crept in 8.0).

In any case to refer to the imported schema you will need to loop though all schemas

var

schemas = xfa.resolveNodes('schema[*]');

Will give it refers to all schemas, the fine loop them;

for

(var schemaIndex = 0; schemaIndex< schemas.length;="">

So if these patterns have an id attribute (I don't think that you can refer to namespace attributes) test the value of the id;

If

(schema.@id is "whateveryourschemaidis")

If there is no attribute ID and you cannot add a you might have to search for the type in each scheme, something like;

var roleTypeCodeType is schema.xsd::simpleType. (@name is "roleTypeCodeType");

If (roleTypeCodeType! == undefined)

{

... load the values of the annotation.

}

Hope that helps but if you if you can post your schema (and it's imports), I could understand exactly the problem.

Bruce

Tags: Adobe LiveCycle

Similar Questions

  • 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();
        }
    }
    
  • I have a drop down list with categories, how to close the categories?

    Hello

    I created the drop-down list categories and in each line, I'll choose a category in the menu dropdown.  How to add each category?

    It's the number 3.6.1 (2566), El Capitan

    That is to say.

    gas

    meal

    Rental

    I want to make the sum of all the lines that are "gas"?

    Use a drop-down menu the right way to do it?

    Thank you

    Edwin

    Hi Edwin,.

    Take a look at the personal Budget template in the template chooser > personal finance.

    SUMIF formulas are in the Budget sheet > summary by the table of categories > column C.

    The drop-down Menus (called context Menus in numbers) are in the leaf of Transactions > column C.

    Make sure spelling is accurate, or numbers will not find a match.

    Please call with questions.

    Kind regards

    Ian.

  • How to make the menu drop-down list with a scroll bar

    Hello

    I have a drop-down list that is filled with different table sizes.

    I have a size of 30-element array.  Some of the last items just go off the screen at the bottom of the Simulator PB.

    Is it possible for me to add a drop-down scroll bar?

    DP = new DropDown();
    dp.rowHeight = 24;
    DP.prompt = "stuff";
    DP. Height = 34;
    DP.width = 230;
    DP.x = TitleTB.x + 170;
    DP.y = Title.y-3;
    addChild (dp);

    Some of the tables look like this-

    case 'List 1':
    dp.rowCount = 2;
    for (var i: int = 0; i<2;>
    {
    if(i==0)
    {
    DPP.splice (0);
    DPP.unshift({label:"blahblah"});)
    }
    else if (i == 1) {}
    DPP.unshift({label:"foofoo"});)
    }
    }
    dp.dataProvider = new DataProvider (dpp);
    addChild (dp);
    break;

    case "List2":
    dp.rowCount = 30;
    for (var n: int = 0; n<30;>
    {
    if(n==0)
    {
    DPP.splice (0);
    DPP.unshift({label:"lalalala"});)
    }
    Else if (n == 1) {}

    **********

    Delete the existing table using splice (0);

    then I add the new array of labels.

    Before, when I didn't have the splice (0), I only had the .unshift () and sometimes got bays combined together and a scroll bar appears automatically in the Simulator.  But then the berries were mixed.

    Thanks for the help!

    Hey mlin13,

    from the looks of it, your property rowCount is set too high. the rowCount property represents the number of lines displayed on the screen when the drop down menu is open. so if the number of rows is less than the amount of items on the list, it will create a scroll bar with a drop-down list for you. try to set the number of lines to a default value of 10 and and keep it manipulate your list from there. and see if you get the desired results. Good luck!

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

  • Populating a drop-down list with the entities

    I do screens, and I would like the user to choose one of the various entity instances 'establishment' as their institution in a zone drop-down list.

    I know I could do this statically simply adding values in the list in the screen of the issue, or by putting values into a file .xml and power OPA the name of the .xml file.

    I want to do, however, is to have this drop drop-down filled running with features created by the user running (collected on a previous screen). I think there is no way to do so; am I missing something?

    This can be done quite easily using a plugin from list provider. More information in the developer help in Web Extensions determinations | Provider from the list

  • Prepopulate the drop-down lists with xml file

    Hello world

    I'm trying to prepopulate a dropdown list using an xml file. There are many tutorials on the internet that allows me to do from the overview of the Designer tab. However, when I did it worked well, but I am not able to 'embed' the xml file so that the values appear in the workspace when the user starts a process.

    I tried to load the xml file with the contents of resource reading in the action profile of the first task and put the result in the "xmlPrepareData" but the problem is that I can't put all the values of the xmlPrepareData after because the xml model is not exactly the one used by LiveCycle.

    Any thoughts? Someone is already managed to prepopulate a dropdown list with an XML within the process?

    Kind regards

    Thomas

    OK gr8...

    Assuming you're able to get the XML process LC to your XDP/PDF form field.

    You can fix the XML from the drop-down under-

    clear the drop-down list box
    * DROPDOWN_Field.clearItems ();

    choiceList = XMLData.parse (* XML_Field.rawValue, false);

    divide the choiceList in an array of values

    choice = choiceList.resolveNodes("root.element[*].*NODENAME");

    var numchoices = choices.length;

    Adds an array of values in drop-down list
    for (var i = 0; i)< numchoices;="">

    {
    * DROPDOWN_Field.addItem (choices.item (i) .value);
    }

    * DROPDOWN_Field - is your field drop-down list.

    * XML_Field - is your XML data stored in a TextField.

    * NODENAME - is the name of the node in your XML to solve.

    I hope that Hepls...

    Regards-

    Chalukya.

  • connect two Drop Down list with the code name.

    Hello guys,.

    I have ' starting my LiveCiycle, I have trouble linking two fields in the drop-down list. How can I connect two fields drop-down list? For example, a user selector, the name of the professional and the other menu drop-down is updated with the code of work based on the choice of the name.

    Thank you.

    Take a look at the attachment. It's a way to achieve this. The result like this...

    Steve

  • Several drop-down lists with the same content

    Hello my friends, I have several drop-down lists that are the same in content, I've added them all to each list drop-down I (30 PC), but now the size of the file becomes too large, so I was wondering is it possible to make only 1 from the list and use it in all my dropdowns?

    Specify: the list is only-text strings, nothing more. And the list should also be inside the shape (no external database)

    Help much appreciated, thanks: =)

    Alrighty then. The forum let me download files right now, so here's what to do using your example:

    1. In the hierarchy of the shape, right-click on the object 'form1' and select 'insert a Script object"in the menu.
    2. Rename the new object of script to 'Scripts '.
    3. Paste the following code in the Scripts object (it will not be an event to select):

    var ProductArray = new Array)

    "Product1 | 0127481 | 4 pcs | 1. 27,10 ",

    "Leader2 | 0127482 | 5 parts | 2. 28,20 ",

    "Product3 | 0127483 | 6 pcs | 3. 29,30 "

    );

    function PopulateProductDropdown (ddlList)

    {

    var numProducts = ProductArray.length;

    for (cnt var = 0; cnt)< numproducts;="" cnt++="">

    {

    ddlList.addItem (ProductArray [cnt]);

    }

    }

    4. in each of the drop-down list object Initialize event, paste the following code:

    Form1.variables.scripts.PopulateProductDropdown this);

    That's all.  You won't need to add list items to each of the drop-down list object, and you can remove those who came to see the first drop-down list.  Add all new products at ProductArray, by following the syntax of those here.  Make sure that you don't have a comma after the last one in the table.

  • How to disable the field in the drop-down list to enter a value

    I got a box dropdownlist field and previously a few numerical values on her list:

    say a list of page numbers,

    11

    22

    33

    41

    42

    43

    52

    ..

    I put codes on the change event so that once the user clicks on an element, it is directed to the specific page immediately.

    But the case is that some users would like to enter the field and type a number rather than clicking.

    If he tries to type 42, change event will get him on page 41 instead (as the 1 '4' tank is put in correspondence),

    and then accidentally edit a field then put the tank rest '2' on it.

    so, how can I disable tapping on a drop down field?

    Rgds.

    Hello

    If you select the drop-down list and go to object > field palette. Here you can uncheck "allow customized entry. This will prevent the user to type in the drop-down list.

    With the drop-down menus, I prefer script to the exit event.

    Good luck

    Niall

    Ensure the dynamics

  • Drop-down list with values outside field

    I tried to find how to feed external values to a field of ASD form drop-down list. It is not clear how we can link/partner an external source to the field.

    There is an article on how to regularly fill with external values, but I'm after a search in real time (for example find meeting locations available)

    Is this the values supported real-time search? If so, how can it be done?

    Check this post where his clearly explained how to create action and associate it with the presentation.

    Re: Decision tree for user input

  • Some way to make a drop-down list with dressing

    I is it possible to make a drop-down list contains a long sentence and when you select the sentence, he trained actually phrase to encapsulate in a multi-line text box?  I seem to be able to enter a fairly long series of words in the drop-down list, but when you make a selection of the text encapsulates not and the right edge of the field cost overruns.  If this can be done is a way of pre-existing reference somewhere else comments hidden in the shape and align them on the field with the selection list?

    I think that this is a limitation in the LC Designer. However, you get the sentence on mouse hover.

  • Several drop-down lists with Switch statement

    I use multiple drop-down list to help a user find that associate their correct sales based on the model and the part they use. However my "switch" statement will always be the case "default". Where am I evil scripts?

    https://workspaces.Acrobat.com/?d=X2MirIocbNfyojw6QezAbA

    the variable "part' requires a value." Add the script:

    part = this.rawValue

    SOnineThreenine.fxnineThreenine (part);

    to the output of dropDownlist2 event. Otherwise, the variable "share" gives you an error message [object XFAObject] console

  • How can I use two drop-down lists for a time value?

    I want to enter the length of time someone did something in hours and minutes using two drop-down lists, then enter it as a time value only (├a) in Mysql.

    I used the dropdown database lists and a few different variations of what follows without success (seconds is a hidden field with a value of "00"):

    GetSQLValueString (strftime ("% H: % i: %s", strtotime ($_POST ["sleeptimemin"].))) " «. $_POST ['sleeptimehr']. » «. (_POST ["seconds"])) $, 'date').

    This comes back to 00:00:16, regardless of what is selected in the drop-down list.

    Any help would be appreciated.

    MySQL stores time in human-understandable format, using the 24-hour clock.

    GetSQLValueString($_POST['sleeptimehr'] . ':' . $_POST['sleeptimemin'] . ':00', "date"),
    
  • How do you define a table of drop-down list to a specific value boxes?

    I have a table of drop-down list boxes that I want to put a specific value. When I say my program to put them to affect only the drop-down list box which just recently I changed and none of the others.

    I have attached a small vi presents the problem.

    Thank you

    -Ben

    It would be the value - property

Maybe you are looking for