on ‎2009 May 07 9:29 AM
Hi,
i try to create a print form with Adobe Forms. The job is nearly done, but now i have to do following:
Depending on some data (which is not bound via data binding) i'd like to do some formatting (background color, font ...).
For this purpose i have inserted a javascript to the initialize-event:
this.rawValue = xfa.resolveNode("xfa.datasets.data.MY_FIELD").value;
But i get no data. The MY_FIELD node is not found.
After trying resolveNode with various paths, i tried
this.rawValue = xfa.resolveNode("xfa.datasets.data").saveXML();
Result:
<?xml version="1.0" encoding="UTF-8"?>
<xfa:data xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:dataNode="dataGroup" />
The data node is empty. But why???
Data binding works. The data is passed to the form completely. I just cannot read it via script.
I don't want to use data binding with invisible fields and then read the field values, because i need this also in a table. Using invisible fields in table is not a good idea, because you cannot make table cells invisible without getting "holes" in your table
Any help appreciated!
Peter Herweg
Request clarification before answering.
Hi,
i found the solution by myself.
This is my script placed into the initialize-event of a table-row.
function pad(t, count) {
var s = new String(t);
while ( s.length < count) {
s = '0' + s ;
}
return s;
}
for(var z=1;z<=31;++z) {
var sDay = pad(z,2);
var s = "$record.TABLEDATA.DATA[" + this.index + "].DAYS.VALUE" + sDay;
var oDay = this.resolveNode(s);
if (oDay.HOLIDAY.value == "X"
|| oDay.WEEKDAY_S.value == "SA"
|| oDay.WEEKDAY_S.value == "SO") {
this.resolveNode("SHORTSVALUE" + sDay).fillColor = "255,100,100";
}
}
The problem was the SOM expression which is passed to resolveNode. I have a book which tells me to begin the SOM expression with xfa.datasets.data in order to access the data nodes. Obviously this is wrong You have to start with $record.
Kind regards,
Peter Herweg
Edited by: Peter Herweg on May 8, 2009 3:20 PM
Edited by: Peter Herweg on May 8, 2009 3:21 PM
Edited by: Peter Herweg on May 8, 2009 3:22 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.