Exemple #1
0
 def countriesForProvince(self, setID, selectedID):
     #rint'countriesForProvince'
     cmb = self.combo_country
     cmbID = self.cmbID(cmb)
     if selectedID: aList = fetch.countriesForProvinceID(selectedID)
     else:          aList = fetch.countriesForProvinceID(setID)
     return self.setGen(cmbID, aList, cmb)
Exemple #2
0
 def OnProvince(self, event):
     selectedProvinceID, province = fetch.cmbIDV(self.combo_province)
     if selectedProvinceID:
         countryList = fetch.countriesForProvinceID(selectedProvinceID)
         if countryList:
             selectedCountryID = fetch.cmbID(self.combo_country)
             self.setGen(selectedCountryID, countryList, self.combo_country)
     # work up ---------------------
     kabupatenList       = fetch.kabupatenForProvinceID(selectedProvinceID)
     selectedKabupatenID = fetch.cmbID(self.combo_kabupaten)
     if selectedKabupatenID in self.idList(kabupatenList):
         return
     self.clearPostcodeCtrls((self.combo_kecamatan,
                              self.combo_kabupaten,
                              self.combo_kelurahan))
     #  kabupaten --------------------------
     if kabupatenList:
         kabupatenID = self.setComboItems(self.combo_kabupaten, kabupatenList)
         if selectedKabupatenID != kabupatenID:
             pass
Exemple #3
0
 def OnProvince(self, event):
     #rint'OnProvince '
     print
     selectedProvinceID = self.cmbID(self.combo_province)
     province           = fetch.cmbValue(self.combo_province)
     
     if selectedProvinceID:
         #rint'Selected province ', selectedProvinceID , ':', province
         #rint'work down'
         
         #rint'Get country for selected province (there should only be one)', selectedProvinceID
         countryList = fetch.countriesForProvinceID(selectedProvinceID)
         #rint'countryList ',countryList
         if countryList:
             selectedCountryID = self.cmbID(self.combo_country)
             #rint' this should select the country if there is one'
             self.setGen(selectedCountryID, countryList, self.combo_country)
         
         # work up ---------------------
         #rint' work up'
         kabupatenList       = fetch.kabupatenForProvinceID(selectedProvinceID)
         selectedKabupatenID = self.cmbID(self.combo_kabupaten)
         #rint'kabupatenList, ',kabupatenList , ',    SelectedKabupatenID', selectedKabupatenID
         if selectedKabupatenID in self.idList(kabupatenList):
             return
         self.clearPostcodeCtrls((self.combo_kecamatan,
                                  self.combo_kabupaten,
                                  self.combo_kelurahan))
         #  kabupaten --------------------------
         if kabupatenList:
             #rint'Has kabupatenList'
             kabupatenID = self.setComboItems(self.combo_kabupaten, kabupatenList)
             if selectedKabupatenID != kabupatenID:
                 pass
                 # select kecamatan for all kabupaten in list
                 
     else:
         pass