-
1. Re: Reset button for particular pages
radzmar Jun 25, 2014 12:13 PM (in response to Westicles)Hi,
sure, you can use the resetDate methode with a comma separated list of som expressions of objects to reset-
xfa.host.resetData(xfa.form1,page2.somExpression, xfa.form.page3.somExpression);
-
2. Re: Reset button for particular pages
Westicles Jun 25, 2014 12:33 PM (in response to radzmar)Can you show me how to implement this?
-
3. Re: Reset button for particular pages
radzmar Jun 25, 2014 12:40 PM (in response to Westicles)Place a regular button in your form and add this script to its click event.
That's it.
Well, you will propably have to change the list of som expression, so it will fit your form design.
-
4. Re: Reset button for particular pages
Westicles Jun 25, 2014 12:49 PM (in response to radzmar)So if I am trying to reset ~150 fields on page 2 and 3, do I need to insert each of their SOM expressions into the script? Or is there a way to make it general to page 2 and 3?
-
5. Re: Reset button for particular pages
radzmar Jun 25, 2014 12:51 PM (in response to Westicles)If you add the SOM expression of page 2 the method will reset the data of all child elements of this page.
-
6. Re: Reset button for particular pages
Westicles Jun 25, 2014 1:03 PM (in response to radzmar)Okay this does not appear to be working. I may have the SOM expressions wrong for the pages. I want “SAMPLE_PG_1” and “SAMPLE_PG_2” to clear but data on “FORM” to remain.
-
-
8. Re: Re: Reset button for particular pages
radzmar Jun 25, 2014 11:25 PM (in response to Westicles)Hi,
the resetData() method requires strings, to resolve the node(s) to reset.
In your sample you're pointing to XFA objects so the method fails.
Add the property .somExpression which returns the SOM expression as a string, then it should work.
xfa.host.resetData(xfa.ONE.SAMPLE_PG_1.somExpression, xfa.ONE.SAMPLE_PG_2.somExpression);
-
9. Re: Reset button for particular pages
Westicles Jun 26, 2014 6:19 AM (in response to radzmar)“Add the property .somExpression which returns the SOM expression as a string, then it should work.”
Please excuse my ignorance but I am not sure what the above statement means. What is the “.somExpression” I should be using?
Wes
-
10. Re: Reset button for particular pages
radzmar Jun 26, 2014 10:06 AM (in response to Westicles)Hi,
somExpression is a scripting property of XFA nodes, that will return the full qualified SOM expression (as a string) of the current node.
Just try the script I posted above.
-
11. Re: Reset button for particular pages
Westicles Jun 26, 2014 10:19 AM (in response to radzmar)I put this script…
xfa.host.resetData(xfa.ONE.SAMPLE_PG_1.somExpression, xfa.ONE.SAMPLE_PG_2.somExpression);
into the click event and it did not work. My button is on page three and when I fill out fields on each page and press it, the field all still have data in them.
It is set as JavaScript ran at Client
-
12. Re: Reset button for particular pages
Magus069 Jun 26, 2014 10:43 AM (in response to Westicles)I suggest you do it separately:
xfa.host.resetData(xfa.ONE.SAMPLE_PG_1.somExpression);
xfa.host.resetData(xfa.ONE.SAMPLE_PG_2.somExpression);
-
13. Re: Reset button for particular pages
Westicles Jun 26, 2014 10:55 AM (in response to Magus069)Still doesn’t work.
Thanks for your help. I’m not sure what to do
WES
-
14. Re: Reset button for particular pages
Magus069 Jun 26, 2014 11:02 AM (in response to Westicles)You should have the right path to get the somExpression...
When you start a reference_syntax with 'xfa' you must specify which property you want to access,
because you want to access you form, you must specify form as the following:
xfa.host.resetData(xfa.form.ONE.SAMPLE_PG_1.somExpression);
xfa.host.resetData(xfa.form.ONE.SAMPLE_PG_2.somExpression);
-
15. Re: Reset button for particular pages
Westicles Jun 26, 2014 11:20 AM (in response to Magus069)Excellent! That worked.
Thanks so much for your help!
I love my Community!
Wes


