10/08/14, 10:56 PM | #1 |
|
Multiple ZO_ScrollList in same window
Hello,
I'm having trouble creating 2 ZO_SortFilterList objects in the same window. I have tried to create 2 scrollist / ZO_SortFilterList's based on the "ScrollListExample" from the developer utilities page. I have duplicated the XML to define the scrolllist and the Lua to create another ZO_SortFilterList but i'm getting the error message below. is there a way to house 2 ZO_SortFilterLists in 1 window? Code:
Failed to create control 'ScrollListExampleHeadersArrow'. Duplicate name Last edited by Argusus : 10/08/14 at 11:11 PM. |
10/09/14, 04:05 AM | #2 |
|
Just give them different names. You probably named both "ScrollListExample".
And if you want the lists to look the same, only have different data, it's best to make it a virtual control, so you don't need to copy tons of xml over and over. xml Code:
Lua Code:
|
10/09/14, 06:03 AM | #3 | |
|
I might have to go the template route down the road. my issue needs to be centering around the "second" paramater in the contructor. the error happens on the second call to the scroll list. it looks like that "ScrollListExampleMainWindow" is the parent of the control and the "ScrollListExampleMainWindowHeadersArrow" error, is render based on the parent named rather than the control name defined in XML. Code:
function UnitList:New() local units = ZO_SortFilterList.New(self, ScrollListExampleMainWindow) units:Initialize() return units end function UnitList2:New() local units = ZO_SortFilterList.New(self, ScrollListExampleMainWindow) units:Initialize() return units end |
|
10/09/14, 08:42 AM | #4 |
|
ScrollListExampleMainWindow is the scroll list control. ZO_SortFilterList is a class, of which you create an instance that wraps the control and adds some children (like the header Arrow) and functionality. In order to have two lists, you need two controls to represent them. That is, each ZO_SortFilterList.New(self, control) call must specify a different control. In my previous example I achieved that by creating the control from a template.
|
10/09/14, 10:43 AM | #5 | |
|
|
|
10/09/14, 08:41 PM | #6 | |
|
|
|
10/10/14, 05:02 AM | #7 | |
|
ZO_SortFilterList.New(class, control) -- returns an instance of class that wraps control; they call this instance manager so I'll stick to that. The control doesn't need the manager to exist, it is simply created from XML (in SLE case) or when I call CreateControlFromVirtual (in ex. above). The manager, when it is created in New, requires this control to already exist and have some children, namely "List" and "Headers". The manager wraps the "Headers" control by an instance of ZO_SortHeaderGroup, which adds sort-on-click functionality and the "Arrow" that indicates current sort key. And later it fills "List" with data rows. Now to SLE. It defines a subclass of ZO_SortFilterList named UnitList. That's necessary because ZO_SortFilterList has some blank functions you need to override (BuildMasterList, FilterScrollList, SortScrollList). The manager (named units here) that wraps ScrollListExampleMainWindow is therefore an instance of UnitList, not just ZO_SortFilterList. Lua Code:
Lua Code:
|
|
10/10/14, 09:30 AM | #8 | |
|
|
|
10/10/14, 06:55 PM | #9 |
|
I found the source to my problem.
In order to have "multiple" scrolllists when defined in XML, the controls must be housed with in a unique Container parent. Code:
<Control name="ListContainer1"> and <Control name="ListContainer2"> Code:
<Control name="$(parent)Headers"> Code:
<Control name="$(parent)List" inherits="ZO_ScrollList"> |
10/10/14, 07:20 PM | #10 |
Yup, there must be one child control called "List" and one called "Headers".
Lua Code:
|
|
ESOUI » AddOns » AddOn Help/Support » Multiple ZO_ScrollList in same window |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|