Ok...got it:
def onValueChanged(self, evt):
selectedCity = self.KeyValue
conn = self.Application.getConnectionByName("norcaddb")
bizCities = self.Application.biz.CitiesBizobj(conn)
crsc = bizCities.getTempCursor()
crsc.execute("select * from dbo.Cities where CityID = %s", ('%s' %
selectedCity))
dsc = crsc.getDataSet()
recc = dsc[0]
cityName = recc["CityName"]
provincestateName = recc["ProvinceState"]
dabo.ui.setAfter(self.Form.tbProvinceState, "Value", provincestateName)
self.Form.getBizobj().setFieldVal("City", cityName)
This works when I enter a new record but not when the record is edited.
Carey
On Sat, Jan 5, 2013 at 8:50 PM, Carey Gagnon <[email protected]>wrote:
> I use the following to update ui data controls when the dropdownlist is
> changed. I figured I could just and what I need to this function, but the
> field I want to set is back and only and doesn't actually have a form data
> control. I'm not sure of the format for setFieldVal but I think this call
> would give me what I want:
>
> def onValueChanged(self, evt):
> selectedCity = self.KeyValue
> conn = self.Application.getConnectionByName("norcaddb")
> bizCities = self.Application.biz.CitiesBizobj(conn)
> crsc = bizCities.getTempCursor()
> crsc.execute("select * from dbo.Cities where CityID = %s", ('%s' %
> selectedCity))
> dsc = crsc.getDataSet()
> recc = dsc[0]
> cityName = recc["CityName"]
> provincestateName = recc["ProvinceState"]
> dabo.ui.setAfter(self.Form.tbProvinceState, "Value", provincestateName)
> self.Form.setFieldVal((*self*, *fld*, *val*, *row=None*, *pk=None*)
> <---------------- How to set this??????
>
>
> Carey
>
>
> Depends on how the rest of the code is set up. Just know when a selection
> is made the Choice part becomes the dDropdownList.StringValue. This then
> can be used to set the Value for the City field.
>
>>
>> Adrian Klaver
>> [email protected]
>>
>
>
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/CAMGTPFF_u8Pcx_HDx592EUaRR-sj=478+baaip6dnmne3rz...@mail.gmail.com