All,
Hopefully someone can help or respond.
Imagine:
Form (contains subform)
Subform (contains a numeric field and a button)
Button adds an instance of the subform:
//code in Click
_Subform1.addInstance(1);
xfa.form.recalculate(1);
Field should incrementally raise number by 1 from the previous
//code in Calculate
var myNewID=this.rawValue +1;
this.rawValue=myNewID;
Without binding, I can click the add button. Another field displays above with the number +1 higher. I need this since I need some unique IDs for each instance. If I click 4 times the fields come onto the screen with the numbers. For example (read across):
Box1 Box2 Box3 Box 4
1 -- -- -- <-- on first click
2 1 -- -- <-- on second click
3 2 1 -- <-- on third click
4 3 2 1 <-- on fourth click
When I bind the data to $record.match.left[*].id here's what happens:
Box1 Box2 Box3 Box 4
1 -- -- -- <-- on first click
2 1 -- -- <-- on second click
3 3 3 -- <-- on third click
4 6 6 6 <-- on fourth click
The next time would be 5,10,10,10,10 then 6,15,15,15,15,15 etc.
So, as you can see, it increments the first box by one, but then adds what box 1 and 2 were together and uses it for all the remaining boxes.
I did try using different code with a document variable but what I'd get was 1, 11, 111, 1111 (yep, couldn't seem to turn that string into an integer).
Does anyone have any idea how I can make this work? It should be very simple to mock up. I'd totally appreciate it.
Have a great weekend,
Lisa