I've got a checkbox list that I am able to select multiple items at once by using the shift key (click/check an item, shift click/check another item and all items in between are checked). I've got that working (Y)
Checkbox list multi select w/ shift click working
What's next is to try to get the mouse to allow multiple selection via click and drag. You know how you can do this with a basic <select multiple></select> element?
Your basic select multiple element
I would like to be able to do something similar with my checkbox list. Here's my initial attempt, but for some reason, I can't get the ng-mousedown / ng-mouseup to get triggered.
My attempt to get mouse click drag working for select multiple
Any ideas or pointers in the right direction are appreciated.
Edit 1:
I believe I have something working here, but every once in a while, I get the not allowed cursor when trying to drag. Any ideas on the not allowed cursor?
Related
I'd like to get swipes on certain cells within a WKInterfaceTable.
It is possible to add a WKSwipeGestureRecognizer to a group within a cell but the action is never called.
Adding the recognizer to the table works but this way I cannot get a reference to the cell that was tapped.
Any ideas/ or solutions to this issue?
I'm trying to select an item from a list that's sorted the same way as a ToggleGroup I have besides it. However, I found that toggleGroup.getToggles().indexOf(toggleGroup.getSelectedToggle()) always returns -1 (visible in the IndexOutOfBoundsException thrown as I pass it). Is there another way of figuring out the index, or am I at a loss with my approach and need to figure out something completely different?
UPDATE: Apparently, for the first time an item is selected (I have this code attached to changes of selectedToggleProperty()), it works fine (I just get no notice of it because the elements I make visible have no proper layout). However, when an item is selected while another item already is selected, getselectedToggle() becomes null, causing aforementioned behavior.
All of the JavaFX toggle controls have a property called UserData. You should use that to create the links between the toggles and data list. Relying on the index of the toggles in the toggle group is probably a bad idea.
I'm using robotframework for automating angularjs application.
I have a dropdown with list of states. I need to select 1 of them. Pictures are attached
Values that are available in dropdown
HTML for this
Could anyone help in selecting the value from dropdown?
I tried below
***variables***
${Residential_Address_State} dom = document.getElementById('PD_Me_AddrRes').getElementsByTagName('span')[3]
***test cases***
click element ${Residential_Address_State}
select from list by value ${Residential_Address_State} Victoria
I tried select from list by index and label as well, it didn't work. It clicks on the element, however it doesn't select the list in the dropdown i.e. victoria.
Can anyone please help?
Just click the element that you need
Click Element xpath=//li[text()="Victoria"]
Also, consider using ExtendedSelenium2Library if you haven't already.
I have two QTreeViews side by side and I want to implement dragging one item from one table into the other table. What I would like to do however is that when the item to be dropped reaches the destination table, that the two rows sort of "make space for it" and separate to really show the user exactly where the item would be dropped. Could someone point me in the right direction as to how to do this as I have no idea really where to start.
Thanks,
Stephen
http://doc.trolltech.com/latest/dnd.html should lead you to pretty much anything you want to do re drag and drop.
As for your specific goal, you need to implement QWidget::dragMoveEvent(QDragMoveEvent* event), which will get called every time the mouse moves within the destination tree while dragging an item. Then get the position of the cursor with QDragMoveEvent::pos(). After that, while in dragMoveEvent, use QTreeView::indexAt(pos()) to get the item under the mouse. Now, I don't know how to get the items to separate in a smooth animated way, which would be ideal. But what you can do is (temporarily) add a blank item to the list, which will have the almost identical effect. Then implement QWidget::dropEvent() to handle the drop event, and when this happens delete the blank item and insert the dragged item in the location where it was.
I have a list control and i want the user to be able to select many items at a time. Thus I want it to act that if the control key is pressed while he is clicking. Eg if he clicks on a selected row it should become unselected and if he clicks on a unselected row it should become selected.
Do you have any idea how to do this?
Thanks,
Dennis
If you want to follow standard UI Precedent; then set allowMultipleSelection to true and teach your users to use the control and/or shift button to select multiple items.
If you want to select multiple items without having the using press the shift or control button you'll have to extend the List class. I did a sample a while ago using the DataGrid:
http://www.flextras.com/blog/index.cfm/2009/7/23/Flextras-Friday-Lunch--Episode-22--07032009--Auto-Select-DataGrid
http://www.flextras.com/labs/AutoSelectDataGrid/
http://www.flextras.com/labs/AutoSelectDataGrid/srcview/index.html
You can probably use the same technique with a List. But, I don't recommend this approach.