For the dropbox widget:
Lua Code:
local countControl = parent
local name = parent:GetName()
if not name or #name == 0 then
countControl = LAMCreateControl
name = "LAM"
end
local comboboxCount = (countControl.comboboxCount or 0) + 1
countControl.comboboxCount = comboboxCount
control.combobox = wm:CreateControlFromVirtual(zo_strjoin(nil, name, "Combobox", comboboxCount), control, "ZO_ComboBox")
I do not fully understand this code. Why you just simply do not use panel name? All panels
must have name. But you have to count with submenus, so:
Lua Code:
local panel = parent.panel or parent
As I have written week ago in comments to LAM, simple and easy way is:
Lua Code:
local panel = parent.panel or parent
panel.comboboxCount = (panel.comboboxCount or 0) + 1
control.combobox = wm:CreateControlFromVirtual(panel:GetName().."Combobox"..panel.comboboxCount, control, "ZO_ComboBox")