if (advanced.Subform3.instanceManager.count ==
advanced.Subform3.instanceManager.max) {
xfa.host.messageBox(“You have reached the maximum number of items
allowed.”,”Combining Instance Manager Concepts”, 1);
advanced.Subform3.instanceManager.addInstance(1);
if (advanced._Subform3.count == advanced._Subform3.max) {
xfa.host.messageBox(“You have reached the maximum number of items
allowed.”, “Combining Instance Manager Concepts”, 1);
advanced._Subform3.addInstance(1);
if (advanced.Subform3.instanceManager.count == 0) {
xfa.host.messageBox(“There are no subform instances to remove.”,
“Combining Instance Manager Concepts”, 1);
advanced.Subform3.instanceManager.removeInstance(0);
if (advanced._Subform3.count == 0) {
xfa.host.messageBox(“There are no subform instances to remove.”,
“Combining Instance Manager Concepts”, 1);
advanced._Subform3.removeInstance(0);
if (Subform3.instanceManager.count < Subform3.instanceManager.occur.max) {
var oNewInstance = Subform3.instanceManager.addInstance(1);
var nIndexFrom = oNewInstance.index;
var nIndexTo = Subform3.index + 1;
Subform3.instanceManager.moveInstance(nIndexFrom, nIndexTo);
xfa.host.messageBox(“You have reached the maximum number of items
allowed.”, “Combining Instance Manager Concepts”, 1);
if (_Subform3.count < _Subform3.occur.max) {
var oNewInstance = _Subform3.addInstance(1);
var nIndexFrom = oNewInstance.index;
var nIndexTo = Subform3.index + 1;
_Subform3.moveInstance(nIndexFrom, nIndexTo);
xfa.host.messageBox(“You have reached the maximum number of items allowed.”, “Combining Instance Manager Concepts”, 1);
if (Subform3.instanceManager.count > Subform3.instanceManager.occur.min) {
Hinweis:
|
Dieses Skript gibt mit dem Wert parent.parent.index an, welche Subform3-Instanz entfernt werden muss. Die parent-Referenz bezeichnet den Container des Objekts, welches die Referenz verwendet. In diesem Fall würde die Referenz parent.index das unbenannte Teilformular bezeichnen, welches die Schaltflächen „Instanz unten einfügen“, „Diese Instanz löschen“, „Eine Zeile nach oben“ und „Eine Zeile nach unten“ enthält.
|
Subform3.instanceManager.removeInstance(parent.parent.index);
xfa.host.messageBox(“You have reached the minimum number of items
allowed.”, “Combining Instance Manager Concepts”, 1);
if (_Subform3.count > _Subform3.occur.min) {
Subform3.removeInstance(Subform3.index);
xfa.host.messageBox(“You have reached the minimum number of items allowed.”,
“Combining Instance Manager Concepts”, 1);
if (Subform3.index != 0) {
var nIndexFrom = Subform3.index;
var nIndexTo = Subform3.index – 1;
Subform3.instanceManager.moveInstance(nIndexFrom, nIndexTo);
xfa.host.messageBox(“The current item cannot be moved because it is the
first instance in the list.”, “Combining Instance Manager Concepts”, 1);
if (Subform3.index != 0) {
var nIndexFrom = Subform3.index;
var nIndexTo = Subform3.index – 1;
Subform3.moveInstance(nIndexFrom, nIndexTo);
xfa.host.messageBox(“The current item can’t be moved since it already is the first instance in the list.”, “Combining Instance Manager Concepts”, 1);
if ((nIndex + 1) < Subform3.instanceManager.count) {
// nIndexFrom and nIndexTo store the before and after index values to use with the moveInstance() method.
var nIndexTo = nIndex + 1;
Subform3.instanceManager.moveInstance(nIndexFrom, nIndexTo);
xfa.host.messageBox(“The current item cannot be moved because it is the last
instance in the list.”, “Combining Instance Manager Concepts”, 1);
var nIndex = Subform3.index;
if ((nIndex + 1) < Subform3.instanceManager.count) {
var nIndexTo = nIndex + 1;
_Subform3.moveInstance(nIndexFrom, nIndexTo);
xfa.host.messageBox(“The current item can’t be moved since it already is the
last instance in the list.”, “Combining Instance Manager Concepts”, 1);