Disabling the initialization of imported views

Hello everyone,
I have an issue with my application which has an impact on the performance. I hope you can help me in this topic.

So, what do I have:
I have a view A which imports another View B. This import shall be done if a boolean in View A is set true. In Order to achieve this I filled the ‘Rendered’ property with that boolean.

But I am still observing that the View B is initialized everytime I call View A, even if not needed (boolean set false).

I also tried to wrap the import with an if-construct and set the ‘Value’ property to that boolean but I am still not obtaining the behavior I want.

Is there any way to implement this behavior?

Thanks for you help.

Hi Sueleyman,

Rendered should always be set to true.
Use isVisible instead to toggle between visible(=true) and not visible(=false).

In this case view B should only be initialized onces upon load of the application.

Regards,
Holger

Hi Holger,
thanks for your answer.

There is no ‘isVisible’ property in the import view control but I found the ‘Visible’ property in the hideable panel which wraps the import view control. Anyway setting this property did not solve my problem. I am still running into instantiation of View B which I want to prevent if View B is not shown.

My problem with this behavior is that View B is coupled to some (data) objects that need to be instantiated. That is not needed if View A does not show View B.

I found a topic with a similar problem: http://tech.forums.softwareag.com/techjforum/posts/list/23662.page

But if I choosed to implement this approach I have to create a dummy view which takes nearly no time to initialize. And then decide depending on the boolean which view to load. But this does not seem like a good solution for me.

With kind regards
Süleyman

Hi,

I do think the view is always rendered statically, even if hidden.

The best you could do is to have the View B check it is hidden before calling its init methods and add a call to those upon showing the view (perhaps you can automatically call the ‘reload’ on a subview).

Best regards,

Hi Gerardo,
thanks for the information and your suggestion.

Both solutions (creating a dummy view and your solution) are workarounds for the real problem though calling a dummy view when View B is hidden seems more practical. This is because I do not want to change the inner behavior of View B just because it is not supposed to be shown. This is more likely to be a responsibility of the parent view.

Anyway I now have an idea about how to solve my problem. Thanks for the replies.

With kind regards

Süleyman B.