addInstance issues
Hi,
This is the scenario:
Consider P as the parent replicant container, and S as the child replicant containers.
Container P1 has S1, S2, S3 inside with all the values entered.
Now when I try to add P2, I need to get all the values from P1 inside P2.
ie, values from P1 -> S1,S2, S3 needs to get set to P2-> S1,S2.S3.
Inside each S container, there are multiple items like text fields, radio, check box & multiple select.
I have used getValue() & setValue () for the text fields, while getOptions() & setOptions() for the others inside the java-script.
My issue is: all the values for all the items get set properly, but for the multiple-select item "ITEM"
ITEM has 2 values(A1, A2) in it.
So if we have P1 with S1:ITEM=A2, S2:ITEM=A2, S3:ITEM=A2 ;
When I create P2, the values for P2 are set like
S1: ITEM= A2, S2:ITEM=A1, S3:ITEM=A1.
One more thing, if we select both A1 & A2 for ITEM in these S replicants, the values get properly set in the new P replicants.
I use addInstance() inside the loop to create the new S replicants whenever a P replicant is added.
Strangely, I could also see that, if we add a simple alert, like alert("Hello") just after addInstance() function, the whole problem is resolved.
Why is it looking for a "click" for only this one?
All the other values get set properly, but this one is giving me a head ache.
Please guide.