Set "Allow Page Break within Content" during runtime

arvindkumar7

08-12-2015

Hi,

Can some help me setting the subform/table property "Allow Page Break within Content" with javascript?. I have a repeating table in a form and want only long tables to break after certain height. Question is simple but I guess answer is not. Cannot find anything after searching for many days.

Thanks

Arvind

Accepted Solutions (1)

Accepted Solutions (1)

_Bruce_Robertson

MVP

10-12-2015

Hi Arvind,

I don't think you can set the "allow page break within content" with JavaScript.  If you set allow page break within content on your table and then you could add a subform that causes a page if the table is small enough to fit on the next page.

You would have to do this in the layout ready event and updating the form structure in the layout ready can cause it to become unresponsive as it causes the event to fire again.  This means you must be careful to remember what has caused the event to fire.

Anyway, here's a sample that should get you started.  https://sites.google.com/site/livecycledesignercookbooks/home/ForcePageThrow.pdf?attredirects=0&d=1

Have a look at the Subform1 layout:ready event code.

Regards

Bruce

Answers (3)

Answers (3)

_Bruce_Robertson

MVP

16-12-2015

Hi Arvind,

Glad you got it working.

The absPageSpan() method returns an integer giving the number of pages an object spans, so it your case if it spans more than 1 page we know we have to do something (if it is small enough), Adobe LiveCycle ES4 * absPageSpan

Regards

Bruce

arvindkumar7

16-12-2015

Hi Bruce,

That work superbly, like a charm, no words for it. I did not find any solution to this before this attachment. Sorry I took long to reply.

Can you please explain a little it to me? I tried comments but did not get it.

What xfa.layout.absPageSpan(Subform1)  return ??

It was really what I want.

Thanks a lot and really appreciate you help.

Regards

Arvind