I have 3 column with the name country_id , states_id and city_id in a datawindow with dropdown datawindow style in powerbuilder.
I'm using below code in itemchange event but when re select country then states and city column show country row id and state row id.
this.accepttext( )
long ll_country_id, ll_state_id,ll_city_id
DATAWINDOWCHILD ldwc_state, ldwc_city, ldwc_country
this.getchild('country_id',ldwc_country)
this.getchild('state_id',ldwc_state)
this.getchild('city_id',ldwc_city)
if dwo.name = 'country_id' then
ldwc_state.reset()
ldwc_city.reset( )
this.setitem(this.getrow(),'state_id', ' ' )
this.setitem(this.getrow(),'city_id', ' ' )
ldwc_country.accepttext( )
ll_country_id = ldwc_country.getitemnumber(ldwc_country.getrow(),'country_id')
ldwc_state.settransobject(sqlca)
ldwc_state.accepttext( )
ldwc_state.retrieve(ll_country_id)
end if
if dwo.name = 'state_id' then
ldwc_city.reset( )
this.setitem(this.getrow(),'city_id', ' ' )
ll_country_id = ldwc_country.getitemnumber(ldwc_country.getrow(),'country_id')
ll_state_id = ldwc_state.getitemnumber(ldwc_state.getrow(),'state_id')
ldwc_city.settransobject(sqlca)
ldwc_city.accepttext( )
ldwc_city.retrieve(ll_state_id,ll_country_id)
end if