----- "johnf" <[email protected]> wrote:

> This is sort of difficult to explain so please bear with me.
> 
> Courts bizobj is a related table to 'Agency” - a child of Agency
> So I have Agency → courts
> 
> On the screen I have
> a grid that contains the list of courts
> and the fields (controls) below the grid.
> 
> The grid is used to select the current court.
> 
> In “Courts” I have 'state” and 'county' fields.  The two controls are
> dropdowns.  I have the event ValueChanged calling onStateSelected
> 
> def onStateSelected(self,evt):
>         self.escounty.removeFilters()
>         self.escounty.filter('state_1', self.txtStateID.Value)
>         choices,keys=self.countyChoices()
>         self.countyID.Value='<None>'
>         self.countyID.Choices = ''
>         self.countyID.Choices = choices
>         self.countyID.refresh()

Do you have AutoBind turned off. If not then wouldn't it be simpler to do:

def onValueChanged_StateSelected(self,evt)

> 
> The idea is  - when the user changes the state to limit the number of
> county
> selections based on the state.  When adding a new record the above
> works.
> 
> The issues are
> 1.When selecting a court from the grid.  The state may change but
> the “Choices” for the county dropdown does not change to match and
> therefore
> an error occurs – “String must be present in the choices”.
> 
> 2.If I bind an event from the grid such as “RowNumChanged” to
> onStateSelected
> the same error occurs because “_setStringValue” fires first.
> 
> 3.I then tried using different events on the state dropdown
> 
> 
> statelist.bindEvent(dabo.dEvents.InteractiveChange,self.Form.onStateSelected)
>     
> statelist.bindEvent(dabo.dEvents.ListSelection,self.Form.onStateSelected)
>        
> statelist.bindEvent(dabo.dEvents.LostFocus,self.Form.onStateSelected)
> 
> The combination sort of works but does not filter the counties
> correctly.
> 
> This must be a common problem could some kind soul suggest the best
> way to
> handle the above problem.
> --
> John Fabiani
> 


Adrian Klaver
[email protected]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/1420075505.8238281236979477493.javamail.r...@sz0030a.emeryville.ca.mail.comcast.net

Reply via email to