Expand my Community achievements bar.

2-Column Flowed Layout Problem

Avatar

Level 7

Hi,

In the interest in saving paper and toner, I have begun using 2 column layouts.Here is something I'm working on:

MasterPage1 has 3 content areas (Header, LeftColumn,RightColumn) //restriced to 1 occurance

MasterPage2 has 2 content areas (LeftColumn,RightColumn) //occurances not restricted--used for content overflow from MasterPage1

MasterPage3 has 1 content area   //occurances not restricted--NOT used for overflow from above--different content altogether

The Pagination is such that content flows through the LeftColumn,RightColumn content areas in the order shown above. It is slick! Overflow from the RightColumn of MasterPage1 goes to LeftColumn of MasterPage2. So far, so good. Just what I wanted... except

Here is the problem: When the form is first opened, there is no overflow--all the flowed 2-column content fits on MasterPage1. MasterPage2 exists however it doesn't have any content yet because there is no overflow yet from MasterPage1. It's rendered empty--I get an unused MasterPage2, between  MasterPage1 & MasterPage3.

In a perfect world, I wouldn't have an empty MasterPage2 when the form opens. In a perfect world, MasterPage2 would only exist when there is content in the MasterPage2.LeftColumn content area.

I think there must be a scripting solution--like testing a content area for content. There are no events for a content area and the xml for a content area is an empty element with attributes for x, y, w, h, name and id.

So how do you test for content in a contentArea? Perhaps there is a different way?

Thanks,

Stephen

4 Replies

Avatar

Level 10

Hi Stephen,

This is one I had been working on: http://assure.ly/iCNgAT. Same problem: if on a page only the left hand column has text, then there wont be a subsequent blank page. BUT if the text overflows, even a line, into the right hand column, then a subsequent page is rendered. Even though it is not required.

I couldn't solve it at the time.

Niall

Avatar

Level 7

Hi Niall,

Thanks for the demo. That is interesting--I think it might be possible to solve yours because you are flowing a single object and I think you could determine the total h value for it and control the occurrences of the MasterPage.

Something like setting MasterPage Max Occurance to 1 on the Object pallet

Then, track the combined h

var iHeight = xfa.layout.h($,"in",0) + xfa.layout.h($,"in",1)

if(iHeight > "10in")then

     xfa.form.form1.pageSet.pageArea.occur.max = "2"

endif

I know this isn't right, but I'm just wondering if this is a valid approach? What do you think?

Thanks again!

Stephen

Avatar

Level 10

Hi Stephen,

I cracked it: http://assure.ly/p2WcSV.

Two issues, (1) changed the pagination settings for page 1, and (2) included script in the textfield's layout:ready event to keep it's height to a minimum.

Hope that it may be of some assistance,

Niall

Avatar

Level 7

Hi Niall,

Nice find! That is interesting. Really important to know. Thanks!

The objects that make the 2-column part of my form grow to occupy 2 pages are added subforms, added tables, added table rows, etc--not a single expanding unwrapped text field. I am perplexed about why I can't successfully apply the technique you use for the text field to a subform container and wrap everything into it.

In most cases my 2-column form will fill to occupy more than 1 page--so the annoyance goes away as the user fills in the form.I just don't like the blank page inserted between before 1-column section (another Master Page) at the end of the form.

Thanks,

Stephen