- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Hi, I got your form, but I don't see the problem. Which one it the table your're talking about?
What I see is that you heavily using the resolveNode() method, which makes you form really slow since your're always starting at the root node of you form using xfa.resolveNode("xfa.form …"). This is unneccessary because you can address nodes directly by using their SOM expression.
For example look at the click event under form1.sfSpeakers.tblSpeakers.rAddSpeaker.btnAddSpeaker. Your current way is to resolve each target beginning from the root node which is slowest possible way to do this.
xfa.resolveNode("xfa.form.form1.sfSpeakers.tblSpeakers.rSpeaker").instanceManager.addInstance(1);
xfa.resolveNode("xfa.form.form1.sfTimekeeper.tblTimekeeper.rSpeakerTimesFaults").instanceManager.addInstance(1);
xfa.resolveNode("xfa.form.form1.sfJudge.tblJudge.rSpeakerEvaluation").instanceManager.addInstance(1);
xfa.resolveNode("xfa.form.form1.sfJudgeImpromptu.tblJudge.rSpeakerEvaluation").instanceManager.addInstance(1);
You can use much shorter code and avoid the resolveNode() method at all, when you use SOM expressions. Those can be relative to the current position of you object in the forms hierarchy.
_rSpeaker.addInstance(true);
sfTimekeeper.tblTimekeeper._rSpeakerTimesFaults.addInstance(true);
sfJudge.tblJudge._rSpeakerEvaluation.addInstance(true);
sfJudgeImpromptu.tblJudge._rSpeakerEvaluation.addInstance(true);
Another sample for the initialize event under form1.sfSpeakers.tblSpeakers.rSpeaker.nfSpeakerOrder. Don's use the resolveNode() method. Don't use the initialize event for this purpose. Why? Because the event only fires once so the vaues won't get updated until you reopen the form next time. This can lead into confusion if you delete instances.
this.rawValue = xfa.resolveNode("xfa.form.form1.sfSpeakers.tblSpeakers.rSpeaker").index + 1;
Use the SOM expression relative to an object. In this case use the repeated itself and its index change event which is form1.sfSpeakers.tblSpeakers.rSpeaker. Since the field nfSpeakerOrder is a nested object you can simply write this short code.
nfSpeakerOrder.rawValue = this.index + 1;
Btw: There'e a function in the script editor that helps to get the SOM expressions. Place the text cursor at the position of you code you want enter the SOM expression. Then move the mouse over the object you want the reference, hold down [Ctrl] so the mouse arrow becomes a "v" then click the left mouse button. The SOM expression of this object then is pasted into the position in script editior you've selected before.
Views
Replies
Total Likes