Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8944

Re: Wanted: trigger for pagebreak

$
0
0

Hi Kai,

 

Finally I got it, I was just trying to test it before I commit.

 

The idea is to find out if the previous content and 2nd row of the table are on same page.

I though 2 solutions.

1) recursively read each element on each page and force the content to next page but that's performance killing code.

2) is the logic with some hidden fields and simple scripting I explained below.

 

Anyways from my below screen shot as highlighted.

 

1) Have a subform "Identifier" as hidden and is above your 2nd table.
2) with in subform "identifier" have 2 text fields  "One & Two" and both are hidden.

3) With in this Subform "Identifier" have a subform "breaker" with height "0.001" and property "pagination"-after = "Go to next page" and is hidden.

 

KAI.png

 

lets talk about scripting.

 

1) Tabel2.cell2 on layout ready event I get the page I get the row index & page number where this row is being displayed.

when row index = 1, I get the page# and put it in the hidden field "Two".

2) on hidden field "One" layout ready even, same as above put the page number.

3) finally on the "breaker" subform docready event, I check if field one & two values are same, that mean if both field One and 2nd row of the table are on same page when they are on different page I make the breaker visible that will push the entier tabe to the next page.

 

Also placing the code so you get to understand what I mean.

form1.Body.Subform1.Identifier.Breaker::docReady - (JavaScript, client)  if(this.parent.One.rawValue != this.parent.Two.rawValue){  this.presence = "visible";  }
form1.Body.Subform1.Identifier.One::ready:layout - (JavaScript, client)  this.rawValue = xfa.layout.page(this);
form1.Body.Subform1.Table2.Body2.Cell2::ready:layout - (JavaScript, client)
if(this.parent.index == 1){  xfa.form.form1.Body.Subform1.Identifier.Two.rawValue = xfa.layout.page(this);
}

Note: you need to change the element names as per your form anyways.

 

Thanks,

Sai


Viewing all articles
Browse latest Browse all 8944

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>