I came up with the following solution. It is a bit convoluted:
#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()
#now we can reset the grid filter
gridact=hk_thisform.get_pyvisible("gridtblact")
filterstring ="actsubjectid = " + filtervalue
hk_this.show_warningmessage(filterstring)
gridact.datasource().disable()
gridact.datasource().set_temporaryfilter(filterstring)
gridact.datasource().set_use_temporaryfilter(True)
gridact.datasource().enable()
On Saturday 04 August 2007 17:27, Jesus Arocho wrote:
> After some checking through previous emails and manual I found and edited
> some code:
>
> cbosubject is a combo box with no datasource attached. The grid field
> datasource is different from that of the form. The question is: I expected
> the function hk_thisform.get_pyvisible("cbosubject").value() to return the
> listcolumn value, not the viewcolumn value. How can I get the selected
> listcolumn value? The filter works fine, except that I cannot use a
> reference to another table.
>
> filtervalue=hk_thisform.get_pyvisible("cbosubject").value()
> hk_this.show_warningmessage(filtervalue)
> gridact=hk_thisform.get_pyvisible("gridtblact")
> filterstring ="actsubjectid = " + filtervalue
> hk_this.show_warningmessage(filterstring)
> gridact.datasource().disable()
> gridact.datasource().set_temporaryfilter(filterstring)
> gridact.datasource().set_use_temporaryfilter(True)
> gridact.datasource().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
-------------------------------------------------------------------------
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