Can I add a action on a subform somehow.
In my form it depends what column you enter then some other columns should be disabled.
I can put a action on one field and get a subform disabled. But I can not put a action on a subform.
That means I have to put this action on so many fields it gonna take me one day to do it.
Is there a way to put a action on a subform or multiple fields?
/ Anders
Sweden
Hi,
It depends on what version of LC Designer you have AND what version of Acrobat/Reader that the users have.
One method would be to propagate the event. See here: http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?conte nt=000018.html.
You would place generic script in the exit event of the subform and enable propagation for that script. This would mean that the script would fire as the user exits any field within that subform.
Please note that you would need to keep the script generic, so that for example this.rawValue would refer to the value of the field just exited.
Also the form would need to be opened in Acrobat/Reader v9.1 or above, as event propagation is not supported in earlier versions.
Hope that helps,
Niall
Hello,
Thank you.
Im preety new to this but I been trying and googling this.
First it seems that the button for propagation is removed in my version of LC. Something I see people talking about was done in SP2.
But I found out that I could edit the XML. Something I dont know anything about but always fun to try.
So what I want to do is to fill any of the fields in clumn 1 and then all the fields in column 2 is disabled.
And as I understand the script should look something like this.
<event activity="exit" name="event__exit" listen="refAndDescendents">
followed of he script created with the action builder?
Well it doesn´t work so is there something easy to fix here?
/ Anders
Sweden
Hi,
You can add the propagation instruction in the XML Source, but proceed with caution.
The latest version of LC Designer (v10), you can turn on the option for Event Propagation in the Tools > Options dialog:
I am not sure that you will get the propagation to work from the Action Builder. You may need to add the script yourself, directing into an appropriate event in the Script Editor.
Hope that helps,
Niall
Hi Anders,
It is not a big/insurmountable step to create your own script, instead of using Action Builder.
Let's say TextField1 is in the first column and TextField2 is in the second column. The following JavaScript in the exit event of the subform (propagated) should work:
if (xfa.event.target.name === "TextField1") {
if (xfa.event.target.rawValue === null) {
var vRow = xfa.event.target.parent.index;
xfa.resolveNode("Row1[" + vRow + "].TextField2").access = "open";
}
else {
var vRow = xfa.event.target.parent.index;
xfa.resolveNode("Row1[" + vRow + "].TextField2").access = "readOnly";
}
}
Okay, it might seem a little involved and the script above will depend on your form's structure. But the message should be that it is possible.
Hope that helps,
Niall
I been playing around with this and have to say I got some things working.
One little question though.
If I want this to happen.
If one field in column 1 is entered with text then all fields in column 2 should be disabled.
Doesn´t matter what row is entered in colmn 1.
Just put a image of the form Im working on.
Anders
Sweden
Thank you for your answer.
Im gonna remake make form with the structure you used in your example. Just insert a table.
The user will not be able to add any rows. So if we used your first example but by filling in any of the rows in column 1 would disable all of the rows in column to and viceversa.
/ Anders
Sweden
Hi Anders,
Have a good look at this amended example: http://assure.ly/LWbvj8. It has the functionality you require, you just need to extend it to the number of objects in each row.
Be sure to have a look at this discussion on SOM Expressions and xfa.resolveNode/xfa.resolveNodes: http://assure.ly/kUP02y.
Hope that helps,
Niall
North America
Europe, Middle East and Africa
Asia Pacific