View Single Post
02/23/15, 05:22 AM   #5
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Hi, Garkin.

It has something to do with creating those controls outside LAM settings panel.
I'm not 100% sure, but I think it was "No, Thank You" which was creating a control named "Combobox1". Which did not conflict, but it is not a wise name.
The name of the parent and not it's panel is used as a prefix and therefore source of potential duplicate name generation. If there is no prefix, a global prefix with a global counter is used. Just to be sure.
If everything is as it should be, a counter per parent control is used as you suggested.

Originally Posted by Garkin View Post
As I have written week ago in comments to LAM, simple and easy way is:
Lua Code:
  1. local panel = parent.panel or parent
  2. panel.comboboxCount = (panel.comboboxCount or 0) + 1
  3. control.combobox = wm:CreateControlFromVirtual(panel:GetName().."Combobox"..panel.comboboxCount, control, "ZO_ComboBox")
  Reply With Quote