Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Orphan Canvas (Label, DynamicForm) in Document

    1. SmartClient Version: v9.1p_2014-03-04/Pro Deployment (built 2014-03-04)
    2. Any Web Browser

    Hi,

    Problem:
    the HTML Document number of elements increase by 1 everytime a Window (that contains a DynamicForm) is shown, no matter if the window is destroyed.
    This happens too if the DynamicForm contains a CanvasItem with a Label as content (the label with autogenerated name "isc_Label_NNN" stays in the document tree forever after the window is destroyed)

    Question:
    How can we remove those orphan canvases?
    Is there a kind of garbage collector for this?

    Use Case:

    1) The application shows a (V-H)Layout "MY_LAYOUT" with a Button "MY_BUTTON".
    2) When MyButton is clicked, it opens a modal Window "MY_WINDOW"
    3) MY_WINDOW adds a DynamicForm "MY_FORM" (attached to a DataSource but setting some fields with setFields(...))
    4) MY_WINDOW addCloseClickHandler will destroy the window (MY_WINDOW.destroy())
    5) When the window is closed, it destroy itself but in the Document tree there is an isc_DynamicForm_NNN element that was created by SmartGWT by default, attached to the document and hidden.

    Test:

    1) Click the button --> windows open
    DOC TREE:
    +MY_LAYOUT
    +---MY_BUTTON
    +MY_WINDOW
    +---MY_FORM

    2) Close the window
    DOC TREE:
    +MY_LAYOUT
    +---MY_BUTTON
    +isc_DynamicForm_1

    3) repeat 1 and 2 several times and at the end the doc tree will show:
    DOC TREE:
    +MY_LAYOUT
    +---MY_BUTTON
    +isc_DynamicForm_1
    +isc_DynamicForm_2
    +isc_DynamicForm_3
    ...
    +isc_DynamicForm_n

    If we use the Developer Console Watch Tree functionality, and "Show" any of the elements with ID isc_DynamicForm_NNN, we can see that the form is drawn with ALL the DataSource fields. But, we actually provided an ID to it: "MY_FORM" and we actually provided a few fields with setFields(...).

    Thanks,
Working...
X