HI,
I've an issue with a table.
I've found some answers here : http://forums.adobe.com/thread/849841 but don't work.
Let me explain.
I've got a dynamic table (with addInstance button and remove one).
There is 4 columns: 2 open and 2 readOnly.
Some users are allowed to change the readOnly ones.
Then, I've created a password field.
with :
if (formulaire1.titre.pw.pass.rawValue == "123")
xfa.resolveNode{"formulaire1.check.tab1.r1.[" + i + "].materiel").access = "open" ;
}
but failed (notting happend)
I've tried :
xfa.formulaire1.check.tab1.r1.resolveNodes("materiel[*]").access = "open";
Views
Replies
Total Likes
Hi,
The finished version of the SOM Expression example is here: http://assure.ly/kUP02y.
Try this in the exit event of the pass object:
var nMateriel = xfa.resolveNodes("formulaire1.check.tab1.r1[*].materiel");
var nFinishes = xfa.resolveNodes("formulaire1.check.tab1.r1[*].finishes");
if (this.rawValue == "123") {
for (var i=0; i<nMateriel.length; i++) {
nMateriel.item(i).access = "open";
nFinishes.item(i).access = "open";
}
}
else {
for (var i=0; i<nMateriel.length; i++) {
nMateriel.item(i).access = "readOnly";
nFinishes.item(i).access = "readOnly";
}
}
This covers the material object and a fictional "finishes" to represent the second object that you want to set to open.
Also in your for script you were using an "i" variable, but you did not declare it, eg "var i=0". This is a hit on performance.
Hope that helps,
Niall
Message was edited by: Niall O'Donovan: there was an extra . in the xfa.resolveNodes. r1.[*] should have read r1[*].
Views
Replies
Total Likes
Hi Niall,
Thanks for your rapid answer
But it didn't work. It just open the first instance... is it because passfield is in an other subform than table ?
Thanks a lot.
Nath
Views
Replies
Total Likes
Can you recheck the script? There was an extra dot in the xfa.resolveNode and xfa.resolveNodes. "r1.[*]" should read "r1[*]".
Niall
Views
Replies
Total Likes
I can't find this extra dot... May I send U my file ?
Views
Replies
Total Likes
Hi,
I have removed it from my sample script.
If you upload the form to Acrobat.com, publish it and then share the published link here.
Niall
Views
Replies
Total Likes