In case this comes up again, since I have seen it come up at least twice on
the discussion list, and, if I am wrong or there is a simpler solution please
correct me.
I use three comboboxes, A, B, and C, to allow selection of three values to be
used to create a filter. A selection in B should filter the available
selections in C. I do not want to store a value in a table, only make a
selection of a value. I do not want to use a list because the value is
associated with a description: e.g. 1, Biology; 2, Chemistry. I need the
number but must display the word. Setting up a combo box with just the
listdatasource, viewcolumn, and listcolumn (no datasource) will result in a
combo box that does not respond to changes in the listdatasource filters. I
inserted a dummy table in the datasource and selected a column and the combo
now responds as expected.
#get current value of combobox: function returns viewcolumn
filtervalue=hk_thisform.get_pyvisible("cbosubject").value()
#so we must find the associated listcolumn value by finding the corresponding
value in the same row
rownum=hk_thisform.get_pyvisible("cbosubject").viewcolumn().find(0,1000,filtervalue)
hk_thisform.get_pyvisible("cbosubject").listdatasource().goto_row(rownum)
filtervalue=hk_thisform.get_pyvisible("cbosubject").listcolumn().asstring()
filterstring="subjectid = " + filtervalue
datatbl=hk_thisform.get_datasource(4)
datatbl.disable()
datatbl.set_temporaryfilter(filterstring)
datatbl.set_use_temporaryfilter(True)
datatbl.enable()
#this datasource is the dummy table in the second combo box for which we want
to filter the listdatasource
datatbltmp=hk_thisform.get_datasource(7)
datatbltmp.disable()
datatbltmp.enable()
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Hk-classes-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hk-classes-discuss