On Friday 13 March 2009 11:00:55 am johnf 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()
>
> 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.onStateSelect
>ed)
> 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.

BTW if I use the gotFocus of the county dropdown to set the choices I have a 
new issue.  I can's save the list choice I make.  IOW the selection does not 
appear in the control.

-- 
John Fabiani

_______________________________________________
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/[email protected]

Reply via email to