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
BedrockMission!

Learn More

View all

Sign in to view all badges

Issues with creating dynamic instances

Avatar

Avatar
Validate 1
Level 1
patpai
Level 1

Likes

0 likes

Total Posts

73 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
patpai
Level 1

Likes

0 likes

Total Posts

73 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
patpai
Level 1

06-07-2015


Good morning everyone,

I need your help again this morning on the subject of dynamic instances.

Right now I create a 'Country' instance that I want to duplicate for ever and ever.

Everything works except one little part inside that instance.

I start with a dropdown list of countries and beside that, an 'Add' button.

Inside my instance Country, I have this:

- 1 title filed set as a floating field

- 1 small table underneath that title.

First time that they open the form, by default there's a first instance. So in my 'Add button' I have code that valide if this is my first time press the button and if it is, it simply set's my floating filed equal to what they selected in my 'Country' dropdown list. It adds a '1' in my validation field for next time.

second time I go thru, I want the button to add a new instance and also populate my country label with the new choice that was just made.

This works, I see a second instance, but my code simply overwrites the country label on my first instance.

How do I write the code so that my code for updating the Country label adds the name into the right instance.

Right now, if I have 3 instances, the code will only overwrite the label in the first one. the other 2 remain nameless.

Here is what my code looks like:

var  tmpchoice=choiceCountry.rawValue;

if (tmpchoice==null){

Country1.Sub4.ff_country.rawValue=ChooseCountry.DropDownList1.rawValue;

choiceCountry.rawValue=1;

}else{

form1.MainArea2._Country1.addInstance(true); (my instance)

Country1.Sub4.ff_country.rawValue=ChooseCountry.DropDownList1.rawValue; <== issue here, don't know how to build this to take into consideration that its dynamic now.

}

Hope this is clear

Anyone got an idea how to fix this?

Thank you very much again

Patrick

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 4
jasotastic81
Level 4

Likes

35 likes

Total Posts

329 posts

Correct Reply

43 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
jasotastic81
Level 4

Likes

35 likes

Total Posts

329 posts

Correct Reply

43 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
jasotastic81
Level 4

06-07-2015


xfa.resolveNode("Country1["+(Country1.instancemanager.count-1)+"]").Sub4.ff_country.rawValue = ChooseCountry.DropDownList1.rawValue;