Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Allow a break in a form via JavaSkript

Avatar

Level 2

Hi all,

I have got a problem regarding breaks in a form. I concentrate data in SAP with ABAP in a table (several pages). And some parts of the table should't be broken in the form (at the end of the page). In ABAP I build a flag to query that via JavaSkript (in the layout).

If flag = X --> the rows can be broken at the end of the page 

If flag = ' ' --> the rows shouldn't be broken at the end of the page --> this rows should be located on the next page

How can I solve it with JavaSkript?

Thank you for your efforts.

12 Replies

Avatar

Former Community Member

On the pagination tab there is a section where you can program a conditional break .....this will tell the program when to break and when not to .....I do not think that you will be able to pragramatically set the allow break in content flag.

There is also the widow amd orphan controls that will allow you to keep certain objects together but again this woudl be for the whole document and not dynamically set like you are asking

I do not think you will be able to do what you are asking

Paul

Avatar

Level 6

This actually works, athough I'm not sure if it's "best practice":

Assuming the rows are bound to data, in the initialize event of your table add the following:

if (flag == 'X')

    this.keep.intact = 'none';

else

    this.keep.intact = 'contentArea';

xfa.layout.relayout();

Avatar

Level 2

Hi all,

thank you for the answers. But it didn´t work! I try to describe my problem in another way...

if the flag = X

I need the function --> subform --> allow pagebreak in the content (check box)   (---->in German --> Seitenumbrüche im Inhalt zulassen)

if the flag = ' '

I need the function --> subform --> not allow pagebreak in the content (check box)

I think it is possible to realise it in JavaSkript.

Another way is maybe to duplicate the relevant subform (with the conditioned table) and position the skripting in the parent subform.

- subform1 --> allow pagebreak in the content

- subform2 --> not allow pagebreak in the content

If flag = X

use subform 1

if flag ='  '

use subform 2

maybe is it possible to realise via Javaskript...thank you all in anticipation!

Avatar

Level 6

Is it possible for you to share the form with us?

Avatar

Level 6

I've sent you a private email with an address to send the form.

Avatar

Level 2

Sorry my boss is not amused to sent the form by email!

Avatar

Level 6

I understand.  Can you describe the structure of the form section in a little more detail?  What object is repeating, and how is it contained?

Avatar

Level 6

I have a working example that is similar to your layout.  Let me know where to send it to.

Avatar

Level 2

Hallo Kevin,

I think I couldn´t receive it, because of our firewall...It would be great if you could describe it.

Avatar

Level 1

Ich habe eine ähnliche Frage und keine Lösung.

Ich habe eine Datentabelle (SAP ABAP) mit einer Struktur in welcher mehrere Adressen (3) vorhanden sind. Diese werden als STRING aufbereitet.

Im Formular sollen alle 3 Adressen untereinander angedruckt werden.

Ein kompletter Datensatz muss auf eine Seite. Passt der zweite Datensatz auf die gleiche Seite, so ist das auch okay. Die 3 Adressen dürfen aber nicht getrennt werden.

Ist der 'Block' für die eine Seite zu lang, muss umgebrochen werden.

Ich habe mehrere Variante probiert.

Als Tabelle mit mehreren Zeilen zusammengefasst als Abschnitt.

Oder auch mit Subforms ohne Tabelle.

In SAP ABAP gebe ich bereits ein Kennzeichen mit, wann ein Seitenumbruch erforderlich ist.

Der bedingte Seitenumbruch reagiert aber nicht.

Wie kann man dies in JS lösen?

I have a similar question and no solution.

I have a data table (SAP ABAP) with a structure in which there are several addresses (3). These are formatted as STRING.

In the form, all 3 addresses should be printed one below the other.

A complete data record must be on one page. If the second data record fits on the same page, this is also okay. However, the 3 addresses must not be separated.

If the 'block' is too long for one side, it must be wrapped.

I have tried several variants.

As a table with several rows summarized as a section.

Or with subforms without a table.

In SAP ABAP, I already specify an indicator when a page break is required.

However, the conditional page break does not react.

How can this be solved in JS?