Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Dynamic Forms with Subforms and Text Fields

Avatar

Former Community Member
I've been reading all of the messages relating to subforms and dynamic forms and have used many of the suggestions, but haven't found anything that addresses the problem I am having. I'm using Designer 7.0. I've saved my form as a dynamic form, I've set my text fields for multiple lines and expand to fit. My problem is that as soon as I set the parent subform to Flow Content, everything moves to the left margin. I've tried grouping items together within a subform in hopes that the items will maintain their position on the page, but everything always moves to the left margin. I'm creating a legal form that needs to have text and a text field centered at the top of the page. Below that to the left is a text field that needs to be able to expand with two text fields to the right of it. Below that are additional text fields that need to expand as needed.



Am "stacking" my subforms incorrectly and setting the wrong subform to Flow Content? Or, can you now lock a field to a specific position? Any help would be greatly appreciated.
8 Replies

Avatar

Former Community Member
You might want to create positioned subforms for the content you want in specific locations and have those wrapped in a flowed subform. This can allow you to have certain non-flowing/non-expanding fields positioned where you want even when pushed down the page (or up the page).



For example:

(each - represents a layer or level in the document -, followed by -- shows that items in -- are contained inside - )



[body page] = flowed, top to bottom

-[title_subform] = positioned

-- some logos, text, titles, date fields, what ever you want.

-[body_field] = flowed, top to bottom

-- main_text = expanding field height-wise**

-[additional_info] = positioned

-- contains more text, small fields, drop down lists, etc.



** if your field is not going to take up all of the width of the page you can approach this a number of ways but I think the easiest way is to adjust the left margin on the containing subform (in this case main_text) to force it away from the edge.



Does that make sense?

Avatar

Former Community Member
Sandy,



I'm just wondering if perhaps you're thinking that you need flowed subforms in order to have expandable fields. That's not the case.



I think that in your situation -- especially with a legal form where the layout must be precise -- you should only use positioned subforms as containers and for the fields that need to be expandable, just set their Expand-To-Fit property (check box) on the Layout palette under the X and Width properties. This will make the field expand in width to fit the value entered. You can also make it expand in height if you're using multi-line text fields.



Stefan

Adobe Systems

Avatar

Former Community Member
Thanks, Stefan. Just so I'm clear, are you saying that I do not need flowed subforms in order for the content to move down the page as text fields are expanded in height? I know I can expand the fields, but some of the info in the text fields may take up half a page, so anything below it needs to move down the page. I thought you had to use flow content for that?



Thanks, Sandy

Avatar

Former Community Member
Unfortunately, I hadn't understood that you needed the fields to expand in height and everything below them to move down the page. In that case, you'll need to use flowed subforms.



Having all objects move to the left side of the page is expected when setting a subform to flowed. That's because the flow is top-down, left-right.



One thing you could try is making the text field that needs to be centered exactly as wide as the flowed subform and then setting its left- and right-hand margins to an equal number. This would ensure an equal amount of space on the left- and right-hand sides and because the field would be as wide as its flowed container (subform), entering multiple lines of text would result in everything below moving down.



I've attached a sample form where the page subform has been set to flowed, the text field at the top is a multi-line/height-expandable text field with its width set to the page width and its left- and right-hand margins both set to 2in and the button and check box objects are pushed below the text field.



When text is entered into the text field, it expands in height and causes the button and check box to move down.



To achieve other horizontal and vertical positioning/offsets, you could play with the margins of all the fields that need this.



Stefan

Adobe Systems

Avatar

Former Community Member
After setting the subform to flow, set the orientation to western text.

Avatar

Former Community Member
Thank you all very much. My form is working great except for one last issue. Is there any way to place a flow content subform and a position content subform side by side?



I need an expandable text field on the left (that will allow the rest of the form to move down the page as needed) and a text field and two static text "fields" to the right (basically two columns).



If I place the static text and text field on the right in a position content subform, the subform left margin is, of course, the left margin of the page, which then doesn't allow me to place a text field on the left side.



This is the first legal form we've created using Designer 7.0, but I'm sure more are in my future, so if anyone has a solution, I'd appreciate any help. For now I'll set the text field on the left to a specific size and not to expand to fit and group the left and right sections in a position content subform.



Thanks for your time, Sandy

Avatar

Former Community Member
I think what you need to use in this case is a flowed subform with its Flow Direction (see Object palette's Subform tab) set to
Western Text, as Stephen suggested earlier.



In my previous post, I had indicated that flowed subforms laid-out their content from top-bottom, left-right. I was slightly mistaken in that the flow direction depends on the property setting:
Top to Bottom will lay-out the content from top to bottom only whereas
Western Text will do a left-right layout which wraps at the right-hand edge of the flowed container (subform) and keeps going at the next row (beneath the tallest object on the previous row).



I've attached a sample form in which the first page is a flowed subform with a Western Text flow direction. It contains an expandable-height text field on the left and a positioned content subform to its right-hand side containing 2 static text objects and a text field (trying to mimic what you were describing in your most recent post). There are also a button and a check box on the next row which get pushed-down when the expandable-height text box on the previous row contains at least 5 rows of text (at which point its height extends beyond the height of the positioned subform to its right-hand side).



Stefan

Adobe Systems

Avatar

Former Community Member
Thank you Stefan. I hadn't completely understood Stephen's earlier post. Designer Help didn't really explain what Western Text flow was. When I tried it, it didn't seem to make a difference; now I understand it was because I hadn't set up the subforms as you explained in your post. My form now works perfectly. Thank you all very much for all of your help!