Adobe Examples
Adobe Examples
/*
Where,
LV_DATA : variable to hold data
IM_TEST : context structure variable (Import parameter variable)
FIELDNAME : name of field in structure
*/
Retrieve context internal table data
var LV_DATA = xfa.resolveNode("$record.IM_TEST.DATA[" + INDX +
"].FIELDNAME").value;
/*
Where,
INDX : index of table record. (start from zero).
LV_DATA : variable to hold data
IM_TEST : context table variable (Import parameter variable)
FIELDNAME : name of field in internal table
*/
OR if you are looping a table
var IMTEST = xfa.resolveNodes("$record.IM_TEST.DATA[*]");
var LV_DATA;
/*
Where,
INDX : index of table record. (start from zero).
LV_DATA : variable to hold data
IM_TEST : context table variable (Import parameter variable)
FIELDNAME : name of field in internal table
*/
Retrieve control (field) data
Manipulate (reference) fields in script for adobe forms
/*
Where,
this.name = name of a field. "use on initialize event
*/
Set dynamic reserve space of Caption
this.caption.reserve = "1in";
x = y % 2; //division remainder x = 1
Set floating points of field
this.rawValue = (this.rawValue).toFixed(3);
if (reg.test("Abcd")){
//expression passed
}
Set focus on filed
xfa.host.setFocus(this);
Populate Alert Message Box
xfa.host.messageBox("Helloo");
Set ToolTip of control
this.assist.toolTip.value = "toolTip text";
Set height of Sub-Form
var b = parseFloat(sfrmName.h) + 5;
if (b < 0) {
b = 0;
}
sfrmName.h = b + "mm";
if you are using DateTime adobe field you can directly give pattern to field.
Select DateTime Filed –> Go to property window –> click on Pattern button –> Select
accordingly
Note:
Cancel Printing
data::prePrint - (JavaScript, client)
xfa.event.cancelAction = 1;
HTML Rich Text Rendering
var envelope = "<?xml version='1.0' encoding='UTF-8'?>" +
"<exData contentType='text/html'
xmlns='http://www.xfa.org/schema/xfa-template/2.8/'" +
"><body xmlns='http://www.w3.org/1999/xhtml'
xmlns:xfa='http://www.xfa.org/schema/xfa-data/1.0/' " +
"xfa:APIVersion='Acroform:2.7.0.0' xfa:spec='2.1'>" +
"<p>"+ this.rawValue +"</p></body></exData>";
this.value.exData.loadXML(envelope,1,1);
Best Regards.
Prajesh Desai