cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Adobe Forms - Strange JavaScript Issues

Former Member
0 Kudos

Hello experts,

before i start with the the issue, I would like to describe some functions which we have developed in our adobe form (not interactive Form!).

  1. We are displaying XHTML Text coming from SAP , in order to load the XTHML into the controls we are calling the following line of code during the initialize event:
    this.value.exData.loadXML(this.rawValue);
  2. We are printing a table which contains 3 position types (SAP DATA)
    • Product items
    • Groups
    • Texts/Pictures (XHTML/Binary Data)

        On each new page a header line shall be printed if the type is product item. This codding is placed inside the layout:ready event:


data.BODY.HIERARCHY.GS_HIER.DATA.ALTERNATIVE_NODE_TYPE.NODETYPE::ready:layout - (JavaScript, both)

var vPage = xfa.layout.page(this);

Script.setHeaderline(vPage, this.rawValue, this.parent.FLAG_HEADER_LINE.rawValue);

data.BODY.HIERARCHY.GS_HIER.HEADER::ready:layout - (JavaScript, both)

var vPage =  xfa.layout.page(this);

Script.getHeaderline(vPage);

if (Script.gHeader == "X") {

  this.presence = "visible";

}

else {

  this.presence = "hidden";

}

SCRIPT SECTION: -->


var gHeader = "Y";

var level_hier = 5;

var new_page;

var gPage = 1;

arrHeader = new Array();

function setPage(in_page) {

  gPage = in_page;

}

function getPage(out_page) {

  out_page = gPage;

  return out_page;

}

function setHeaderline(in_page, in_nodetype, in_flag_header_line) {

  if (in_page != gPage) {

       if (in_nodetype == "1" && in_flag_header_line != "X") {

            arrHeader[in_page] = "X";

       }

  else {

       arrHeader[in_page] = "N";

  } }

  gPage = in_page;

}

function getHeaderline(in_page) {

  gHeader = arrHeader[in_page];

}

The first functionality was working always pretty good. For making the second functionality available we started calling the Adobe Forms using the Parameter DYNAMIC = 'X'. Unfortunaltey the first functionality is then not working anymore correctly. We have tried to change javascript processing to server side/client side and both, but in the mode DYNAMIC = 'X' it does not have any influence, all javascript is performed at the client and at runtime. The result is that some pdf reader can not see the XTHML texts and we are expierencing some other problems with pictures.

We need to have both functionalities working at the same time for all readers. I guess this is only possible if the javascript is processed at the server side and the ADS returns a finished/static PDF document.

Does anyone has an idea how to solve this issue ?

Thanks a lot,

Wladimir

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

We have found an alternative approach by calling the adobe forms processing twice:

  1. Call it with the flag DYNAMIC = X and read the XML data coming back from the forms function module. The data shall include a flag for each product whether a header line shall be printed or not
  2. Call it without the flag DYNAMIC and pass for each product line the flag based on the XML data.

Now the problem is, that we are not able to set the XML data inside Adobe/JavaScript.

Does anyone has an idea how to influence the data coming back inside the XML stream?

Thanks in advance,

Wladimir