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

Multiple subforms in the same place

Cake_Diva
Level 3
Level 3

I am working on a dynamic form with a flowed subform for Page 1. I would like several different subforms of information to occupy the same space on the page depending on text selected from a drop down list. How do I get one subform to be in the same x/y of another? I'm trying to disprove that old adage that two things cannot occupy the same space at the same time.

Thanks for any help you can offer.

7 Replies
Ida_Eve
Level 4
Level 4

on your drop down in the Change event/JavaScript add:

if (xfa.event.newText == ' value 1' )

{

subform1.presence = "visible";

subform2.presence = "hidden";

subform3.presence = "hidden";

}

if (xfa.event.newText==' value 2' )

{

subform2.presence = "visible";

subform1.presence = "hidden";

subform3.presence = "hidden";

}

Create the subforms, one at a time in the same location, once it is completed, set the subform presence as hidden, and start on the next form in the same location and so on.

Niall_O_Donovan
Level 10
Level 10

Hi,

I'm afraid that in a Flowed container, if both subforms are rendered at the same time, then they can have the same position. One will be directly underneath the other.

You could achieve the effect you want if you placed the two subforms within a Positioned subform.

Make sense?

Niall

Cake_Diva
Level 3
Level 3

If I put the subforms into one Positioned subform and I have an expanding text field in one of those subforms, will it still expand?

Niall_O_Donovan
Level 10
Level 10

Hi,

The textfield will expand, but it will just run over the top of other objects in the Positioned subform. Do both subforms HAVE to be visible at the same time? If so you might be able to position them side by side.

I'm gone now for a few days. Maybe Ida Eve or someone else can help.

Niall

Cake_Diva
Level 3
Level 3

The problem that I am having is that even when I select the first subform as hidden, it still holds a place on my form. Then when I try and position the next subform in the same location, it will not move there. It settles directly below the hidden subform.

My form will have a "screen only" drop down list that chooses between several outcomes to an application. Subform 1 is "Approved" and holds information about when the application goes into effect, how much money the applicant will receive, etc.

The second subform is "Denied", a multi line text field for the reason why, policy number, etc.

So only one should be visible on the form but I don't want the form to have a big space between the heading and the result of the application information.

But truly, it's either Approved or Denied. Can't be both.

The Page1 subform is set to flowed. The Approved subform is positioned and the Denied is Flowed. Does that make a difference?

kingphysh
Level 7
Level 7

Hi,

What you describe sounds like "invisible" instead of "hidden". Invisible objects still occupy space--hidden objects don't any occupy space. Be sure to use "hidden" to get the results you want. In addition,

What I believe what you need is to use a Flowed container (with hight set to expand) and a script that will change the presence of the different subforms to "visible" or "hidden". These subforms will get out of the way when they are "hidden". As Ida Eve has it shown above.

And, if there is a text field in one of those subforms, it can expand--you will want it's parent subform to be "Flowed" as well. Here's a representation of the layout::

<MainSubform>                                                                 //Flowed

    

     <Subform1>                                            

          <someStuff></someStuff>

     </Subform1>

    

     <Subform2>

          <someStuff></someStuff>

     </Subform2>

   

      <Subform3>                                                            //also Flowed

          <expandableTextField></expandableTextField>

     </Subform3>

</MainSubform>

So, Subform1, Subform2, Subform3, will reveal themselves in the same spot (individually) depending on the dropdoen box.

Subform3 also should also be set to Flowable because the textField set to expand.and you want the subform parent to expand with it.

Stephen