click events of combobox in flex - apache-flex

I found that in flex, combobox has 3 events: open, close, change
combobox events example
Let's say I selected A in my combo box. Then I might do 2 things:
I open combobox and click A option again
I open combobox and close it by clicking somewhere else (without clicking A option)
There is no selection change in either of the case above. And they both have open and close involved. So if I want these 2 actions have different behaviors, I can't programmatically distinguish them....
Is it possible to have a click event on combobox or combobox options?? I am using a data provider for my combobox...
Thanks a lot!!!

The ComboBox events do have a click event defined, although it is inherited.
Unless the ComboBox has a click event listener and calls preventDefault() to prevent the event from bubbling, you should be able to listen for the click event on a ComboBox without any issues.

Related

How to cancel selection in ListView?

I try to cancel user selection in a ListView according a condition. I tried to consume mouse clicked and mouse pressed event in ListView and ListCell but it didn't work. I don't understand why bu events occur after the selected item property change.
How can I cancel the user selection?
If I understand correctly, you want to prevent users from selecting items by clicking on it. I further suppose that you tried a solution like this:
listView.addEventHandler(MOUSE_CLICKED, click -> click.consume());
That does not prevent other click handlers from being executed. Even if it did, the internal event handler seems to be fired before your event handler, since the selected item is changed before your handler is executed.
You need to add an event filter to prevent any event handlers from being fired:
listView.addEventFilter(MOUSE_CLICKED, click -> click.consume());
listView.getSelectionModel().clearSelection();

How to control strange behavior of Ext.NET ComboBox controls?

I have few Ext.NET ComboBox controls on a Web Form. Selecting an item from the first fires the ValueChanged event to populate the second, and so on.
Except Force Selection property, I have not altered other properties of the ComboBox control.
I am experiencing odd behavior of Combo Box controls. As all controls get filled via AJAX request, I find it difficult to set focus on any control. As soon as I bring focus on any control, the cursor disappears after it gets filled.
Secondly, one of the ComboBox is not permitting me to select an item from the list. Even if I try to select an item, it automatically brings back the default item back, which is actually a sixth item in the list.
I double checked the queries and there is no way through which sixth item should get selected.
If I try to open the DropDown list using mouse, it opens for few seconds and collapses automatically.
Is there any way to fix these strange issue? Any other third-party open-source control?
I guess that combos are rebinded in each ajax requests
I suggest to rebind combos in Select direct event handler
Also see the following sample
http://examples1.ext.net/#/Form/ComboBox/Ajax_Linked_Combos/

How to keep focus on control intact while AJAX fills DropDown?

I am using Ext.Net 1.3 library for ASP.NET.
I have five ComboBox controls and each is linked to the other. Selection in the first ComboBox is compulsory. Selecting an item from the first fills the second ComboBox, and so on.
The problem is when I press TAB key to navigate on the controls, the focus is lost after appearing for some time on the next Combo.
This is because, when the first Combo looses focus, it fires the OnSelectedValueChanged event which executes the code to fill the second ComboBox using AJAX.
How to keep the focus intact even while AJAX request is executed?
One option may be to call .Focus() on the triggering ComboBox from within your OnSelectedValueChanged event handler.
This will force the focus to be reset on the ComboBox after the DirectEvent returns.
Hope this helps.

Detect if Flex AdvancedDataGrid itemClick is actually a drag

Is there any way to detect if AdvancedDataGrid itemClick event is actually caused by the user dragging? I'd like to take action on click, but ignore drag.
you should add drag handler, dispatch new click event for the same target and kill drag event or stop it.
or just use standard click event

Help! dragDrop event not firing for my TextArea control

I'm working on a simple view in my app that allows a user to drag an item from a list control and drop it onto a textarea.
Seems the dragEnter event fires just fine, but the dragDrop event does not.
i forgot to add the textarea as a drop target during my drag enter handler. :P

Resources