Expand my Community achievements bar.

Nested Subforms setInstances(); is this possible?

Avatar

Former Community Member
Hi all,



Can someone tell me if I can show/hide an instance of a nested subform? I've spent days on this, tried workarounds which "worked" but rendered the forms unusable.



If this is the situation:

Subform 1 (options)

Option 1 will show Subform2 and Subform2b

Option 2 will show Subform2 but not Subform2b



Subform2 (content)

Subform2b (content)



At this point I just want to know if this can even be done. I've asked before but I can't seem to get any responses and searching the Internet has also been futile. Everything but this works so /shrug I don't know...



If someone could at least respond with a yea/nay I'd so appreciate it.



Regards,

Lisa
3 Replies

Avatar

Former Community Member
lisa_j_richards@adobeforums.com wrote:

> Hi all,

>

> Can someone tell me if I can show/hide an instance of a nested subform? I've spent days on this, tried workarounds which "worked" but rendered the forms unusable.

>

> If this is the situation:

> Subform 1 (options)

> Option 1 will show Subform2 and Subform2b

> Option 2 will show Subform2 but not Subform2b

>

> Subform2 (content)

> Subform2b (content)

>

> At this point I just want to know if this can even be done. I've asked before but I can't seem to get any responses and searching the Internet has also been futile. Everything but this works so /shrug I don't know...

>

> If someone could at least respond with a yea/nay I'd so appreciate it.

>

> Regards,

> Lisa



This should be easy to do. I'm not sure what the issue is that you're running into. You can set

the 'presence' attribute of Subform2b to "visible" for option1 and "hidden" for option2.



Maybe there's more to it that you haven't explained. If so, I'm all ears. :-)



--

Justin Klei

Cardinal Solutions Group

www.cardinalsolutions.com

Avatar

Former Community Member
Ahh, well I just used some sort of workaround. It's not as efficient, but it works :).



I needed to use setInstance(); since using presence resulted in some data loss when the form was saved. The way I can ensure the data remains in the form was to use setInstance.



The issue I had was i could _parentSubform.setInstance, but I couldn't _parentSubform.childSubform.setInstance. I wasn't sure if there was a way to do this.



Thanks again, Justin :).

You have an awesome day,

Lisa

Avatar

Former Community Member
lisa_j_richards@adobeforums.com wrote:

> Ahh, well I just used some sort of workaround. It's not as efficient, but it works :).

>

> I needed to use setInstance(); since using presence resulted in some data loss when the form was saved. The way I can ensure the data remains in the form was to use setInstance.

>

> The issue I had was i could _parentSubform.setInstance, but I couldn't _parentSubform.childSubform.setInstance. I wasn't sure if there was a way to do this.

>

> Thanks again, Justin :).

> You have an awesome day,

> Lisa



Lisa,

The setInstances method is only valid on an instanceManager. That's why it didn't work for you.

The following would have worked:



parentSubform._childSubform.setInstances()

parentSubform.childSubform.instanceManager.setInstances()



--

Justin Klei

Cardinal Solutions Group

www.cardinalsolutions.com