Problem refreshing drop down lists 
Author Message
 Problem refreshing drop down lists

I have a dialog containing 2 drop down lists with the contents of one list
dependent on the selection in the other list. If the user selects an item in
one list the app has to change the contents of the other list. The method
that responds to the selectionChanged event on the controlling list changes
the ListModel in the other list. This has the effect of triggering a
selection changed event on the other list. Unfortunately the method that
handles the event fails when it retrieves the selection index because it is
set to zero (i.e. no selection).

I have used a kludge to get round the problem. I'm sure there is a better
way of dealing with this, but I can't find one.

Cheers
Keith



Wed, 26 Oct 2005 23:48:44 GMT  
 Problem refreshing drop down lists
Keith,

Quote:
> I have a dialog containing 2 drop down lists with the contents of one list
> dependent on the selection in the other list. If the user selects an item
in
> one list the app has to change the contents of the other list. The method
> that responds to the selectionChanged event on the controlling list
changes
> the ListModel in the other list. This has the effect of triggering a
> selection changed event on the other list. Unfortunately the method that
> handles the event fails when it retrieves the selection index because it
is
> set to zero (i.e. no selection).

> I have used a kludge to get round the problem. I'm sure there is a better
> way of dealing with this, but I can't find one.

Is not having no selection a condition that should be anticipated?  There
are methods like #selectionIfNone: that you can use to early out of a
handler that would otherwise get upset.  Is that the kludge?  If so, I'm not
sure I consider it one.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.



Thu, 27 Oct 2005 09:36:49 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Drop down list box refresh problem

2. VA Drop-down list problem with keys?

3. Drop down list problem

4. Beginner w/ Problem in Drop Down List Box Filter/Range Limit

5. problem with drop-down list boxes

6. How to refresh filter in drop down combo box

7. Drop-down box refresh in php?

8. Refresh form on drop-down changes

9. LIST BOX AND DROP DOWN LIST BOX

10. EIP drop down list box

11. Contents of drop-down-list dissappeaers

12. Help ... Coding DROP DOWN LISTS / MULTI SELECTIONS ALSO

 

 
Powered by phpBB® Forum Software