If I've got a change event for a checkbox declared like this:
topmostSubform.Page2.Competitions_CB.Checkbox::change - (JavaScript, client)
how can I get this object path into a variable so I can process it and extract the "Competitions_CB" part? Even traversing up the object tree would be fine, but I can't seem to find which property returns object names.
I've been through all of the properties that sounded likely, in both xfa.event, event and this, but nothing seems to be what I'm after.
Solved! Go to Solution.
Hi,
Using "this.somExpression" will return a string of the full object path;
xfa[0].form[0].topmostSubform[0].Page2[0].Competitions_CB[0].Checkbox[0]
You can also use "xfa.context.somExpression" to return the same thing, using xfa.context is handy when the code is in a script object and called from many object events.
Also, "parent.name" would return the "Competitions_CB" part, so parent.somExpression would return
xfa[0].form[0].topmostSubform[0].Page2[0].Competitions_CB[0]
Regards
Bruce
I'm beginning to think this is not possible. Another hour of searching found nothing.
I popped a breakpoint in the change handler to inspect both global and local objects, but the debugger is too barebones.
I had a look at Assuredynamics' "Referencing Objects" example, and although it's not the point of the example and maybe would have confused the point of the example, I noted the light switch handlers each hardcode the specific light switch they reference, instead of generically determining it dynamically.
Views
Replies
Total Likes
Hi,
Using "this.somExpression" will return a string of the full object path;
xfa[0].form[0].topmostSubform[0].Page2[0].Competitions_CB[0].Checkbox[0]
You can also use "xfa.context.somExpression" to return the same thing, using xfa.context is handy when the code is in a script object and called from many object events.
Also, "parent.name" would return the "Competitions_CB" part, so parent.somExpression would return
xfa[0].form[0].topmostSubform[0].Page2[0].Competitions_CB[0]
Regards
Bruce
Great timing Bruce, thanks, and obvious now you point it out. That saved a lot of manual work I was not looking forward to.
Views
Replies
Total Likes
Views
Likes
Replies