0

Here is my current code, so far the button will create a new row in the table and it will reset the fields (AdditionalComments, CellLocation, and FailureSelection, which are all text fields), but it will not allow me to populate the original FailureRow or the new instance of FailureRow that is created:

field name="AddFailureButton" w="31.114mm" h="6mm">

        event name="event__click" activity="click"
           script contentType="application/x-javascript"
           xfa.host.messageBox("Failure Recorded, Please Continue Filling Out the Form Until All Failures Have Been Recorded.  Then Please Save and Submit the form.", "Continue/Save/Submit", 3);
           this.resolveNode('failuretable.Table1._FailureRow').addInstance(1);
           if (xfa.host.version < 8) {
           xfa.form.recalculate(1);
}

//****need to set values of current FailureRow to be equal to CellLocation, FailureSelection, and AdditionalComments, THEN clear the values as written below*****

           xfa.host.resetData("form1.page1.AdditionalComments");
           xfa.host.resetData("form1.page1.CellLocation");
           xfa.host.resetData("form1.page1.FailureSelection");
</script>
4

1 回答 1

0

试试下面的代码:

var newRow = this.resolveNode('failuretable.Table1._FailureRow').addInstance(1);
newRow.CELL_NAME.rawValue = form1.page1.AdditionalComments.rawValue;
newRow.CELL_NAME.rawValue = form1.page1.CellLocation.rawValue;
newRow.CELL_NAME.rawValue = form1.page1.FailureSelection.rawValue;

请记住用正确的名称替换 CELL_NAME。

顺便提一句。当您在脚本中引用对象时,您可以只使用它的 SOM 表达式failuretable.Table1._FailureRow而不是this.resolveNode('failuretable.Table1._FailureRow').

于 2013-03-23T12:15:01.817 回答