This is related to this question (http://vlforum.lansa.com.au/viewtopic.php?f=3&t=1371) where my "main instance list" does not contain the list itself but coordinates smaller more specific lists based on a different report selection. Everything works great, except this one thing.
Here is a pic of the list. The data is actually sorted by "Date Last Billed DESC". But you can see the list is not in order. The query that generates the data (in SQL Server shows the data is sorted properly and 20160807 should be the at the top of the list, XCOFID and XCOCN make up part of the "Number" and id in the avListManager) Even the trace output shows that it is the first item getting added to the list Yet the list is out of order.
The sorting is handled on the server side via the query, all I am doing is picking up the ColumnClicked event on the list, setting the sort directory and field and passing that back up to the server module. All other sorts are displaying correctly.
Code: Select all
evtroutine handling(#LastBilledColumn.ColumnClick) handled(#handled) origin(#origin)
#handled := True
#wk_SortDirection := #LastBilledColumn.SortDirection
#wk_SortBy := 'LAST_BILLED'
#ReportManager.SignalSort( #wk_SortBy #wk_SortDirection )
endroutine
Code: Select all
evtroutine handling(#ReportManager.Sort) sortby(#sortBy) sortdirection(#sortDirection)
#CMGApplicationManager.avFrameworkManager.avRecordTraceAValue component(#COM_OWNER) event("Handling Sort") avalue(#sortBy) avalue2(#sortDirection)
#wk_PageNumber := 1
#wk_SortBy := #sortBy
#wk_SortDirection := #sortDirection
#COM_OWNER.Search
endroutine
Code: Select all
mthroutine name(Search)
#CMGApplicationManager.avFrameworkManager.avClearMessages requester(#COM_OWNER) inmainform(False)
if (#COM_OWNER.IsValid = False)
#CMGApplicationManager.avFrameworkManager.avShowMessages requester(#COM_OWNER) formainform(False)
return
endif
#ReportManager.SignalReportLoading
* save our search fields
inz_list named(#SearchFields)
#CMGApplicationManager.avFrameworkManager.avRecordTrace component(#COM_OWNER) event("Executing Request")
#ListItems.RemoveAll
#Get.ExecuteAsync officenumber(#CLOFID) formalname(#CLOFN) countrycode(#wk_CountryCode) pagenumber(#wk_PageNumber) pagesize(#wk_PageSize) sortby(#wk_SortBy) sortdirection(#wk_SortDirection) resultlist(#ListItems) recordcount(#wk_Count) status(#wk_Status)
endroutine
Code: Select all
evtroutine handling(#Get.Completed)
#CMGApplicationManager.avFrameworkManager.avRecordTraceAValue component(#COM_OWNER) event("Get Request Completed") avalue("Record Count: " + #ListItems.ItemCount.AsString)
#CMGApplicationManager.avFrameworkManager.avReceiveSystemMessageQueue requester(#COM_OWNER) intomainform(False)
#avListManager.ClearList
for each(#item) in(#ListItems)
#ListManager.AddToList( #avListManager #item )
endfor
#wk_PageCount := (#wk_Count + #wk_PageSize - 1) / #wk_PageSize
#CMGApplicationManager.avFrameworkManager.avRecordTraceNValue component(#COM_OWNER) event("Page Count") nvalue(#wk_PageCount)
* restore search fields
get_entry number(1) from_list(#SearchFields)
* Go back to display free state
#ReportManager.SignalReportLoaded( #wk_PageCount #wk_PageNumber #wk_Count )
endroutine
Is there a way to debug and/or view the items in a list?
At this point I am just grasping in the air trying to find something out of place.
Since the data is correct, the trace output is correct I have no idea why the list display is not.
All other sorts are working correctly and they all use the same search method and completed handler.