Exception when using checkboxtrees [#17224]

To discuss development of addons / skins / customization of MediaMonkey.

Moderators: jiri, drakinite, Addon Administrators

TIV73
Posts: 229
Joined: Sat Nov 12, 2011 1:31 pm

Exception when using checkboxtrees [#17224]

Post by TIV73 »

Hi,
using a checkboxtree element in an addons config panel causes a 'setVisibility can be called only on elements in DOM tree!' exception if the element is within the first div of the panel, e.g.

Code: Select all

<div data-id="pnlCollectionsRoot" class="padding fill flex column">
    <div data-id="lvTreeView" class="fill flex column hSeparatorTiny" data-control-class="CheckboxTree" data-init-params="{enableDragDrop: true}"></div>
</div>
The snippet above causes the exception. If there is another div above it, even a blank one, the issue doesn't occur. The snippet below works fine

Code: Select all

<div></div>
<div data-id="pnlCollectionsRoot" class="padding fill flex column">
    <div data-id="lvTreeView" class="fill flex column hSeparatorTiny" data-control-class="CheckboxTree" data-init-params="{enableDragDrop: true}"></div>
</div>
To reproduce:
- Install the addon from https://github.com/mmuffins/addonsmenusample
- Open the list of installed addons
- Click the configure button for 'Addons Menu Sample'

This first started occurring in revision 2281, 2276 is working fine. Also see crash logs C491CB1E and A280AC70.
Ludek
Posts: 4945
Joined: Fri Mar 09, 2007 9:00 am

Re: Exception when using checkboxtrees

Post by Ludek »

Thanks, seeing the same, looking into it...

BTW: I think that in the previous builds the config.html wasn't supported at all (only config.js was)
Ludek
Posts: 4945
Joined: Fri Mar 09, 2007 9:00 am

Re: Exception when using checkboxtrees

Post by Ludek »

There are actually two bugs:
1) it takes only the first child element as the div for configuration (therefore it does not crash when the empty div is added, but also whole the CheckBoxTree is missing from the config!)
2) it initializes the controls before it is added to DOM

Both issues fixed in build 2285 as https://www.ventismedia.com/mantis/view.php?id=17224
TIV73
Posts: 229
Joined: Sat Nov 12, 2011 1:31 pm

Re: Exception when using checkboxtrees

Post by TIV73 »

I did not know that. In that case it's actually pure coincidence that I stumbled over this issue, I've been using this config.html file for at least two years now. :D

Back then I didn't like the idea to write inline html code in a js file, so I put the html definition for the config panel into a separate file. The configInfo.load function would then just read that file and replace the existing innerhtml node of the panel with it. Also see here for the full example.

But that would explain why an exception is raised in the last couple of builds, if the config.html file is now implicitly loaded when the config panel is opened.

Anyway, thanks a lot for the response!
Ludek
Posts: 4945
Joined: Fri Mar 09, 2007 9:00 am

Re: Exception when using checkboxtrees

Post by Ludek »

Yes, this explains everything! :-)

Feel free to report any such an issue or miss that you have or you wish. We really haven't had much feedback yet about the MM5 addon's developing, but we already have a guy writing the addon devs docs, should be ready soon.
Post Reply