View Single Post
11/24/14, 01:14 AM   #7
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Advanced Filters

In advanced Filters I see this:

On a single click of an inventory button:
Oops, my picture is missing the first 3 lines:

Unregistering a filter: AdvancedFilters_Button_Filter
Unregistering a filter: AdvancedFilters_Dropdown_Filter
ResetToAll


* thats just d("xxxxx") code I added to AF

1) So ChangeFilter( self, filterTab ) gets called which calls
2) ResetToAll() gets called, which unregisters the AdvancedFilters_Dropdown_FIlter, and the AdvancedFilters_Button_Filter
That seems ok...

3) But then ResetToAll() selects the first item in the dropdown...which in turn fires:
4) OnDropDownSelect (through the function assigned to the dropdown items) which calls SetUpCallbackFilter, which attempts to unregister the AdvancedFilters_Dropdown_Filter again and then reregisters the AdvancedFilters_Dropdown_FIlter,

5) Then the OnClickedCallback fires, which again selects the first item in the dropdown...which starts the cycle all over:
6) Fires OnDropdownSelect, SetUpCallbackFilter, which unregisteres & reregisters AdvancedFilters_Dropdown_FIlter, filters again.

7) And then at the end of the OnClickedCallback...it has its own code to manually fire: SetUpCallbackFilter again...
Although this one might look like it is ok, its for the button this time, not the Dropdown_Filter BUT...it does end up attempting to Unregister the AdvancedFilters_Button_Filter again, which we already did at the very beginning in ChangeFilter(...), then it reregisters the button filter.

Aren't these filterID's UNIQUE...why are they being unregistered at all, if you just re-register the exact same filter ?
Either way the exact same filter is getting unregistered & reregistered multiple times as we can see, unless I am missing something if the filterID's are not unique or being changed in the code somewhere & I missed it.


If you can get libFilter fixed so it doesn't call UpdateFilterList on every Register/Unregister, and you straighten out this sequence of code events in AdvancedFilters so it doesn't select the first item in the dropdown multple times and stop it from firing extra register/unregister events I think the two will solve all your problems.

Last edited by circonian : 11/24/14 at 01:41 AM.
  Reply With Quote