CodeRAD
CodeRAD copied to clipboard
Problem with EntityEditor when it is not attached to a form
Ok, I do not know if this is related to EntityEditor
or ListNode
or NodeList
. The thing is that I have AbstractEntityView
implementation using EntityEditor
and ListNode
to render EntityList
elements. Very similar thing to the ChatRoomView
from RadChatRoom.
Now, I have several Views like this created. Think of it as several ChatRoomViews
created. Each view corresponds to a different EntityList
. Like you would have each ChatRoomView
created for different person you talk with. Only one View is displayed on the screen though and a user can switch between these views to display a different one.
For performance reasons and to reduce resources usage, I do not want to create a View every time a user switched to this view. Once the View
is created I keep it in a Map
and when a user wants to see this View
I just insert it into the form's Container
. Everything works great, except adding Entity
to EntityList
when the View
is not visible, that is when the View
is not in the form's Container
and it is stored in the Map
.
When the View
is visible on the screen, adding Entity
shows it on the list. When it is not on the screen and stored in the Map
then Entity
is added to the EntityList
but after I show the View
on the form, this added Entity
is not visible.
I guess, I should somehow refresh either EntityEditor
or ListNode
to render entities added when the View
was in background. I cannot, however, find a suitable API.
Do you have any suggestions on how this could be accomplished?