Highlighted

how to create dynamic dependent dropdownlist using ODBC in LiveCycle?

jr87794863

18-03-2017

I'm creating a user form using Livecycle designer.Here i'm not able to implement cascaded dropdownlist using javascript. I'm using ODBC dataconnection for data binding.Able to bind all data in respective dropdowns but don't know how to use cascading.

I followed this link LiveCycle ES2 * Adobe LiveCycle Designer ES2  but is is not working.

Replies

Highlighted

_Bruce_Robertson

MVP

18-03-2017

So what isn't working, the ODBC connection or your code to populate the dependent dropdown controls?  Can we see some of the code you are using or better still can you upload a copy of your form to a file sharing site and post a link to it in this thread.  Is you dependent drop down values populated by the one ODBC call or is there one per value in the first dropdown.

Regards

Bruce

Highlighted

_Bruce_Robertson

MVP

19-03-2017

Hi,

You seem to be populating the presCity drop down list in the change event of the presState drop down list, but you still have the presCity drop down items bound to the data connection.

If this is fairly static information I would suggest storing it in the form at design time.  Would let you avoid the while ODBC thing.

Regards

Bruce

Highlighted

jr87794863

19-03-2017

Hi,

No presCity is not static.It get the data from database. If i'll not bind the presCITY with dataconnection it goes blank.City is coming from same database but different Table.How can i do this dynamically. And please also check the Add instance of Education Table.It is added but not showing up. Please give some solution to both problems.Very urgently needed.Thanks in advance.

Highlighted

_Bruce_Robertson

MVP

19-03-2017

Hi,

We may be having a bit of a language problem, I was wondering how often you will need to add a city value to a state and if you know all the states and all the cities in the states before the user opens the form then there are easier ways to setup the form than an ODBC connection.

Also, not sure why not setting the binding for presCITY makes it go blank, as your code in the presState change event will populate it?

Bruce

Highlighted

jr87794863

19-03-2017

Hi,

How can i do this.could you please do some necessary changes in the form and send back.What i have written in the presSTATE Change is not working.and other than this please check the instance issue also.It will be a great help.Please.

Highlighted

_Bruce_Robertson

MVP

19-03-2017

I wont be able to work on this for some time, but maybe this link will help LiveCycle Blog: Mehrstufige Dropdown-Liste//Multilevel dropdown list  if you want to continue with your current approach maybe this link will help http://forms.stefcameron.com/2006/09/29/selecting-specific-database-records/ 

I might have time later in the week, if you are still stuck, post some of the data from your tables so I can include it directly into your form.

Highlighted

jr87794863

19-03-2017

Hi,

I have used the second link you provided by you http://forms.stefcameron.com/2006/09/29/selecting-specific-database-records/ but it gives error message Error: accessor 'xfa.sourceSet.city.#command.query.commandType' is unknown.

my code in 1st dropdown change

-----------------------------------------------

var sCategoryName = xfa.event.newText

var sCategoryId = $.boundItem(sCategoryName)

xfa.sourceSet.city.#command.query.commandType = "text"

xfa.sourceSet.city.#command.query.select =

  concat("SELECT * FROM Dist_Master WHERE Dist_Code = ",sCategoryId, " ORDER BY Dist_Name;")

 

xfa.sourceSet.city.open()

xfa.sourceSet.city.first()