Hi,
I’ve just discovered that I can break my client-side UI into different forms and then nest/embed them in the main form by dragging them onto it. Looks like a neat way to keep my code manageable by breaking it into functional units.
For example, there is an area in my client-side UI where I have a few drop-down menus and buttons related to selecting time periods, and I am thinking about putting these and the code that relates to them into a separate form to encapsulate it, and then dropping that into my main form.
Off the top of my head, I could do this for maybe 5-10 functional units.
However, before I go all out on this: Does it have any major performance implications?
I don’t want to create some sluggish monster.
Note: I am not primarily talking about repeating panels - I will also use these, but this question is about non-repeating forms used to make the code more manageable.
I think that from the performance point of view it will be identical. You may end up one or two div deeper in the html hierarchy, but it will have no impact on performance.
The only problem is that sometimes this will create a separation between that functional unit and the rest of the form and for example it might make things slightly more difficult when the inner components of two distinct units need to communicate.
If you find that the separated form becomes difficult to deal with, you can make it a custom component, so you can expose its properties and create events. This will help especially if you want to reuse it on another form.
Thanks for the answer, @stefano.menci , I’m glad to hear that!
Yes, I thought of that, but I guess that forces me to use some more structured mechanism for communication between my components, which may be better in the long run than chains of self.parent.parent. ...
Ah, I hadn’t thought of that yet! Might be a bit of overkill, but maybe a good thing to play around with to figure out how it works, if only for future projects. Thanks a lot!