Hiding multipe instances of a subform

Avatar

18-02-2009

Hi there,



Scenario: The user clicks 'Another Address' button to create previous address subforms of which there can be up to ten. When the user navigates to another part of the form the previous address subforms should hide. As I expected, the following script only hides one of the instances:



form1.pg1.sPrevAddress.presence = "hidden";



I tried:



for (int i = 0; i < sPrevAddress.count; i++)

{

form1.pg1.sPrevAddress[i].presence = "hidden";

}



but this didn't work.



I would be greatful for some guidance.



Thanks,



Kieran

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

23-02-2009

Each subform gets an instance number. You can address each individual subform by using form1.pg1.sPrevAddress[instancenumber].presence



To get the number of subforms you can use the form1.pg1.sprevAddress.instanceManager.count