Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Dependent Drop-down lists

Avatar

Level 6

Hello,

I've created page with two depend drop down lists, if data from one of lists selected, second list filling with dependent data.

Script example:

prodata.#subform[0].DropDownList2::exit - (JavaScript, client)

DropDownList1.clearItems()

var

fgid = DropDownList2.rawValue

var

len1 =xfa.resolveNodes("$record.projects.project_data.[fg_id=="+fgid+"]").length

var

userid= xfa.resolveNodes("$record.projects.project_data.[fg_id=="+fgid+"].empl_id");

var

usertxt= xfa.resolveNodes("$record.projects.project_data.[fg_id=="+fgid+"].empl_code");

for

(var i=0 ; i<=len1; i++) {

DropDownList1.addItem(usertxt.item(i).value

, userid.item(i).value);

}

Main problem is that i have big amount of data in lists, for example DropDownList1 could contain 200+ records.

Because of this filling data takes too much time, is there way to improve perfomance of adding data?

Thank you in advance,

Paul

3 Replies

Avatar

Level 10

Hi Paul

You could try using an expression in the List Item data binding for DropDownList1, which depending on the somExpression for DropDownList2 would be something like, .

$record.projects.project_data.[fg_id==$form.form1.DropDownList2]

The only code you would then need would be a call to xfa.form.remerge() everytime DropDownList2 changes.

If you want to post some xml data I could setup a simple sample.

Bruce

Avatar

Level 6

Hi,

     I faced on problem, maybe you can help me with it.

When i tried to take data with:

$record.projects.project_data.[fg_id==fg_code]  and fg_code = 12345 is Number everything fine,

but, when fg_code = unkn is String I got error:

1.JPG

Do you know how to take data by strin parameter?

Thanks in advance.

Avatar

Level 6

Qustion closed.

Solution is

xfa.resolveNodes("$record.combos.combo.(fg_code.value=='unkn').fg_name") - this is javascript style.

Blog about data binding with predicates really helped:

http://blogs.adobe.com/formfeed/2008/10/data_binding_with_predicates.html

BR