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
Related
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();
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.
I have a data grid with a custom item editor that displays a DropDownList component. When I click the scroll bar in the component, it is firing a focus out event on the list, which is causing itemEditEnd to fire. I can't figure out why the list is not keeping focus, or how to make it keep focus. I'm using Flex 4.
Thanks for any help!
I couldn't reproduce your problem but the solution probably involves listening to an event on the scrollbar and stopping its propagation. That should prevent the datagrid from getting the event and dispatching its own itemEditEnd event.
I am designing a user control in ASP.NET where in i have a Textbox and onfoucus javascript event i am showing a checkbox list below and onBlur event i am hiding the checkbox list control
Now the problem is when i focus the textbox the Checkbox is visible and when i try to go and check the items it is getting hidden as onBlur event is called.
How can i avoid this any other way for this basically like a dropdown list....
Don't hide it in the onblur event.
Imitate what a real dropdown list does: it only goes away when either [a] you click an item in the list [b] some other page element is clicked.
Try hiding the checkbox on the click event (of checkbox).
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