I have a field in my notes form called "PairList" (Text, allow multiple value, separator is comma or semicolon).
What I intend to store in that field is like the following:-
I'm creating something that will auto-calculate the points given to a participant based on how many days they've attended an event. So from the above, if they attend 2 days, they'll get 3 points, if they attend for 3 days, they'll get 5 points and so on.
The following is from my designer:-
The repeat above is bound to a viewScope which stores an ArrayList. The ArrayList will then be used to create the "PairList" above to be stored.
Testing the above, I managed to do the following. The (add) and (remove) works perfectly:-
My problem is I don't know where to bind the 2 inputTexts to so that I can retrieve their value and construct the "PairList". I remember David Leedy doing something similar in one of the Ni9 but that one's in Java. My app will mostly be in SSJS and will be maintained by someone only fluent in SSJS so using Java is not an option.
I'm thinking of creating another 2 viewScopes each storing an ArrayList so that those 2 inputTexts can be bound to each of the viewScope. But it just seems weird that to bind a control to a collection which is within a collection (repeat control) itself. Something just doesn't make sense to me. Any suggestions? I'm assuming if it can be done and saved successfully, the next time I open this document, any value in those inputTexts will be auto-populated based on what I previously entered too.