on 12-22-2010 1:38 PM
Hi Community,
Is it possible to delete or set the attributes of a subform back (initial)?
But not for example with data1.rawValue = null;.
Maybe with a simple method?
E.g. you press on a button and the whole entered data of a subform will delete.
Thanks
Chris
There is a simple way hot to loop at the list of all "children" (children of the root, the root is the subform). In such loop you can copy the default values from backend, setup the values with code or remove the values completely (and use default values staticaly defined at design time maybe?).
Cheers Otto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can also use the below method.
xfa.host.resetData(<subformname>);
Example below:
xfa.host.resetData("data.sf10.sf15");
Note: this is in Java script, check for such in ADLC help for formcalc if required.
if you have an heirarchy of subforms with in that subform you specifiecd in that method, it will flush data for all the child nodes with in it.
On button click event call this method for that particular subform and you are done.
Have a Try and let me know if you need any help.
Cheers,
Sai
Hi Chris,
You can loop subforms and tables in an adobe form by using the function resolveNodes().
var sub1 = xfa.resolveNodes("sfMain[*].sf1[*]");
var sub1_len = sub1.length;
for (var i=0; i<sub1_len; i++)
{
var val = sub1.item(i).rawValue;
}
Similarly for table,
var tab1 = xfa.resolveNodes("sfMain.sf1[*].table1[*]");
Hope this will give you an idea.
Thanks & Regards,
Sanoosh
Hi Chris,
I saw some code once in one of the Adobe forms.
That will basically do tree traversing, somebody wanted to validate field mandatory on the form then the reply was this traversing approach.
I didn't have the code right now, if you have no other approach then let me know i would try to find it once again.
Cheers,
Sai
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.