I'm having trouble refreshing a check box-list box using an event trapped between <<%code% 'my refresh code is here %code%).
This is the initial code which generates the list. The list was created using the genie.
And this is the line of code which displays the list in the xdialog. Again this line of code was generated
using the genie.
Following the line which displays the list is a row of radio buttons which when selected, dynamically
changes the filter for the list. Any time a different button is selected, the event is trapped using !x.
I then copied the original code from the first code block above, stripping out the format stuff as it is dimmed, and placed it in the
event area of the xdialog script.
This setup does not work. The initial list is create. But when I change a radio button, the list disappears.
With some guessing, I stumbled on to a work around.
If I change
the list is regenerated using the new filter. While it works, I'm not sure why and I'm not sure if this could cause
a problem.
Anyone have any thoughts?
This is the initial code which generates the list. The list was created using the genie.
Code:
auto_list_vPickList = table.external_record_content_get("persons",\ "\" \"+P_Status+\"|\"+Id+\"|\"+Address+\"|\"+City+\"|\"+recno()",\ "p_status+ID+Address+City",\[COLOR="#0000FF"][/COLOR] "P_Status="+s_quote(left(var->vFiltered,1)) ) Dim format as p Format.tab_stops=".75,2.75,4.75,6.75,8.7" Format.odd_row_color="White" Format.even_row_color="White" Format.odd_selected_color="Dark Blue" Format.even_selected_color="Dark Blue" Format.font="Calibri,11" Format.font_color_unselected="Black" Format.font_color_selected="White" Format.lastbutton="OK" Format.group_size=1 Format.number_rows=.f. Format.alternating_bands=.f. 'Apply 'owner draw' formatting information to the list auto_list_vPickList = a5_owner_draw_list_fmt(auto_list_vPickList,Format) temp_count = w_count(auto_list_vPickList,crlf()) DELETE a_vPickList DIM a_vPickList[temp_count] as c a_vPickList.initialize(auto_list_vPickList)
using the genie.
Code:
[%d;O={@@}%.76,20vPickList^$$a_vPickList?vfilteredLabel="Selected"]
changes the filter for the list. Any time a different button is selected, the event is trapped using !x.
Code:
View: (vFiltered:Active!x?vFilteredLabel="Selected") (vFiltered:InActive!x?vFilteredLabel="Selected") (vFiltered:Pre-School!x?vFilteredLabel="Selected") (vFiltered:School!x?vFilteredLabel="Selected") (vFiltered:Archive!x?vFilteredLabel="Selected");;;
event area of the xdialog script.
Code:
%dlg%,<<%code% IF a_dlg_button = "x" THEN auto_list_vPickList = table.external_record_content_get("persons",\ "\" \"+P_Status+\"|\"+Id+\"|\"+Address+\"|\"+City+\"|\"+recno()",\ "p_status+ID+Address+City",\ "P_Status="+s_quote(left(var->vFiltered,1)) ) 'Apply 'owner draw' formatting information to the list auto_list_vPickList = a5_owner_draw_list_fmt(auto_list_vPickList,Format) temp_count = w_count(auto_list_vPickList,crlf()) DELETE a_vPickList DIM a_vPickList[temp_count] as c a_vPickList.initialize(auto_list_vPickList) a_dlg_button = "" END IF %code%)
With some guessing, I stumbled on to a work around.
If I change
Code:
[%d;O={@@}%.76,20vPickList^$$a_vPickList to [%d;O={@@}%.76,20vPickList^$$auto_list_vPickList
a problem.
Anyone have any thoughts?
Comment