Hello Mike,

first of all thanks for your detailed explanation.
I do have good news for you, you can switch back to the combobox  
because it still supports read only. Well not the combobox itself but  
the textfield and you can access that textfield shown here:

box.getChildControl("textfield").setReadOnly(true);

Could that solve some of your problems? :)

Best,
Martin


Am 18.06.2009 um 17:02 schrieb mshillin:

>
> Martin,
>
> I guess my problem arises because the I was originally using the  
> ComboBox
> which has (or did have) the behavior I want.  But in 0.8.x I can no  
> longer
> set a ComboBox to "readOnly", so I had to switch to a SelectBox.
>
> To tell the truth -  it would be much easier for me if ComboBox still
> supported ReadOnly.
>
> Anyway, using:
>
> selectBox.addListener("changeSelection", function(e){
>  if (e.getOldData().length < 1 || e.getData().length < 1) {
>    return
>  }
>  doSomething();
> }, this);
>
>
> Works for the initial add()  and the removeAll() and will filter the  
> events.
>
> It has been awhile since I used MFC/Swing/SWT  and maybe I am  
> mistaken, but
> I think this is the first time I have ever seen this type of  
> behavior in a
> Combo/Select box.
>
> If this is the expected behavior, I understand, it just seemed odd.
>
> ++++++++++
>
> A more detail use-case is:
>
> I have a form with a SelectBox, some other fields and a table.
>
> The SelectBox is populated dynamically
>
> The table is populated based on the value of the SelectBox.
>
> The user can refresh (via a button) the items in the SelectBox.
>
> Because loading the table is a heavy operation, I only want to  
> reload the
> table if the User has changed the selection - or if the current  
> selection is
> no longer available after a refresh.
>
> To refresh the Select box I
> 1. Save the currently selected item
> 2. call the backend to get a new list of items
> 3. call selectBox.removeAll()
> 4. add all of the ListItems returned from the back end
> 5. If the value selected before the refresh is present in the new  
> list, I
> want to make it the current selection and NOT reload the table (I am  
> already
> handling this in my code)
>
> My problem is that removeAll() and add() are firing the  
> changeSelection
> event based on what I am doing, not what the user is doing.
>
>
>
> Jim,
>
> Adding the listeners after populating the SelectBox works fine until  
> you
> have to repopulate it.  Then you would have to remove and re-add the
> listener.
>
> While it is true that the selection has changed - the user did not  
> change
> the selection.  Guess I am drawing a distinction between programmatic
> control and user events.  I my mind programmatic changes should not  
> trigger
> user events.  It should be left up to the programmer to handle this  
> either
> by  manually firing an event or calling a function (setSelection())  
> that
> fires the event.
>
>
> Mike
>
> -- 
> View this message in context: 
> http://www.nabble.com/SelectionAPI-woes-%28part-1%29-tp24077884p24094879.html
> Sent from the qooxdoo-devel mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to