Expand my Community achievements bar.

SOLVED

Page colors and extra fills

Avatar

Level 4

Hi,

I may be working this the wrong way, so I'd best listen to the experts before getting in too deep.

The multipage form I'm creating has different sections where the background color of each section is different to make it easier to identify the section. Currently, I am achieving this by initializing each page using the JavaScript command: this.fillColor = "234,234,239" or whatever for that page.

However, this will only color the background for subforms on that page. If the subforms found on the page do not take up the whole page, the remaining page which doesn't contain any forms is white. How would I go about making sure the rest of the page is similarly colored?

Thanks,

Graham

1 Accepted Solution

Avatar

Correct answer by
Level 7

Ok, so your sections are all starting on new pages, correct? If that's the case I think you're going to have to do a master page for each section (set to repeat, in case the section runs to multiple pages) and then set the color on the background of each master page.

View solution in original post

10 Replies

Avatar

Level 7

The easiest thing to do would be to just put an extra subform on each page that fills the page, move it to the back and change the background on that subform.

Avatar

Level 4

I think what you're proposing would be to fill the empty space with another form. However, I didn't mention that this form is dynamic, and that the pages are set to follow the previous in the pagination section. The form in it's current iteration needs to be quite expandable.

Avatar

Level 7

Ok, so are you wanting the background color changed based on a particular section or for the complete page? Or, to clarify, does each section always begin on a new page? If each section will start on a new page you might consider making a master page for each section that can repeat as needed for the form expansion. That way you could put a subform on the master page of each section and change it's background fill color.

Avatar

Level 4

Interesting, DJ: "If each section will start on a new page you might consider making a master page for each section that can repeat as needed for the form expansion" I will look into that.

My original plan is too have the background color change based on a particular section. Is that doable? Your other option seems like the direction I'll go if doing it the other way isn't feasible.

Graham

Avatar

Former Community Member

Look at the options for xfa.layout .....I am pretty sure there is a call that will return to you the page numbers that your object is on. I do not have access to my machine at the moment so I am going from memory.

Paul

Avatar

Level 7

Are your sections flowing together throughout the form? I'm not understanding where the white space is coming in. If you place each section on it's own flowed content subform you should be able to still have the subforms flow together and then change the background color on the flowed content subform rather than the positioned content subforms.

Avatar

Level 4

DJ,

Whenever a subform doesn't quite make it to the bottom of the page whenever a subform does not have "break within content" on, then the background is white.

Paul, to me, your answer is a bit cryptic. If I were to find this information, what would I do with it?

Graham

Avatar

Former Community Member

Misread your question ....rather than setting the backround color on the page why not set the backgroound color on the subform that is expanding. Then it will not matter if it breaks across pages or not as the color will be set. Make sure you put th ecommand on the layout ready event (after the data has been mmerged and we know where the subform will be.

Paul

Avatar

Correct answer by
Level 7

Ok, so your sections are all starting on new pages, correct? If that's the case I think you're going to have to do a master page for each section (set to repeat, in case the section runs to multiple pages) and then set the color on the background of each master page.

Avatar

Level 4

Thanks DJ and Paul.

DJ, I am taking your route. Creating extra master pages seems like the best thing to do.

Graham