Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

get cascaded lists with different combination in Custom dialog boxes

$
0
0

Adobe LiveCycle Designer Cookbooks by BR001: Using app.execDialog() in an Adobe Designer Form

1.PNG

I'm following the above post and trying to do this:

1.

When I select "Aland Islands", it need to show the cities of this island in a new list box that's appended to the first one. When I select any city listed, it shows the district accordingly in a third list box, like this:

Capture.jpg

(The above dialog box is created with excel visual basic.)

The above selection combination is random. When you select item 110--> item 1103, it may or may not show 11031, depending on the data given by the requirement document.

 

I've studied the code in the sample PDF. Now I can only achieve this stage: select item 110 --> item 1103, it shows 11031.

But I cannot think of  a better way to add some extra selection flow(eg. It can also browse through 120-->1204-->12043).

 

My code

function customDialogBox() {

    var dialogDescriptor = {

        "LST1": function(dialog) { // the first list

            var lst1 = dialog.store()["LST1"];

            for (var item in lst1) {

                if (lst1[item] > 0) {

                    var selectedValue1 = item;

                    break;

                }

            }

            if (dialogObject.selectedItem(lst1) == "110") { //when "110" in the first list is selected, it enables the display of list2

                dialog.visible({

                    LST2: true

                });

            } else {

                dialog.visible({

                    LST2: false

                });

                dialog.load({

                    "txt1": selectedValue1

                });

            }

        },

        "LST2": function(dialog) { // the second list

          //when "1103" in the second list is selected, it envisibles list3

        },

        "LST3": function(dialog) { // the third list

          //  concatenate and return the string selected in List1, List2, List3

        }

    };

    var dialogObject = {

        LST1: data.list1, //a map, storing the data in the first level

        LST2: data.list110,//a map, storing the data in the second level, when the parent code is 110

        LST3: data.list1103 //a map, storing the data in the third level, when the parent code is 1103

    }

}

 

Basically it's hardcoding the selection flow. I wish to dynamically generate the lists.

I'm thinking of storing all the lists and identify them by ID, perhaps in this way:

 

Header 1

 

      var dialogObject = {

              LST1: data.list1,

              LST110: data.list110,

              LST1103: data.list1103,

              LST120: data.list120,

              ......

          }

 

But how can I correctly identify them, in order to show/hide the lists, and finally output the concatenated string in function customDialogBox()?

Or perhaps there's a better solution to retrieve the list at runtime, please do enlighten me!

 

2. By the way, is it possible to do the search (search the code and highlight the result item) as shown in the picture above? Can you give me some  keyword I need to google with?

 

Big thanks!!!!


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>