Highlighted

Stop Initialize for Subforms that are invisible

Avatar

Guest

03-12-2008

Is there a way to stop the objects within a subform from initializing?



I have subforms with a lot of objects in them but it seems everything initializes.

Replies

Highlighted

Thomas_McConnac

03-12-2008

In short, no.



You can however move your script to one of the other events such as calculate which will trigger when the subform is made visible. You could then wrap your script in an if statement that will onyl run when the subform is visible (subform.presence == "visible").
Highlighted

Avatar

Guest

03-12-2008

I tried the wrapper in the initialize but it cuases more issues but can reconfigure the script to the calculate to see if it works out. If I am changing visuals like the x y coordinates, visibility, etc. wil the calculate redraw the form?
Highlighted

Thomas_McConnac

03-12-2008

The initialise will only trigger when the subform is first created. You can however trigger it to go again by using:



subForm.execInitialize();



I would think that it would work and redraw the form but haven't tried it out. I would also think that it would cause the calculate script to fire AGAIN after it had redrawn the form as that would be part of the layout process.



Tom
Highlighted

Avatar

Guest

03-12-2008

So if I need to initialize the form to redraw it and it causes the calculate event to fire - there is no benefit to move the script right?
Highlighted

Thomas_McConnac

03-12-2008

What I'm saying is that you could leave the script where it is, but start the initialise event again whenever you choose. The initialise will only run once (whenever you open the form at first), unless you tell it to run again.
Highlighted

Avatar

Guest

03-12-2008

Is there a way to redraw elements of the form wihtout execInitialize();?



Does resolveNode do thing instantly?

xfa.resolveNode("Form.combobox.ui.#choiceList.border.fill.color").value = "255,255,255";



And does the following require a redraw?

Form.combobox.ui.choiceList.border.fill.color.value = "255,255,255";



if so, maybe I can change my script to use resolveNode