How to disable multi-select behavior on touch-devices in cytoscape.js? - cytoscape.js

For cytoscape.js 2.0.[0-1], on touch-devices, by default, as you click on nodes/edges, every one of them gets "selected" -- causing multiple-selections as user taps on different elements within the network. Is there an option to prevent this behavior so that every tap selects the target element and unselects the rest?

I don't think so, but we will add one:
https://github.com/cytoscape/cytoscape.js/issues/290

Related

How do I uniquely identify enabled/disabled objects in QTP

In my application, I have to verify if a particular button is enabled or not. It gets enabled after I fill in certain values.
But, the problem is the properties for the button is EXACTLY the same when its enabled and disabled. (Even the value of isEnabled is false in both cases)
If I try to click on that button, it gets clicked in both cases (even it gets clicked when its disabled but however since its disabled nothing happens)
So, how do I proceed now?
Are you sure all the properties are exactly same? Do you have access to the color property? Font color or background color. If yes, then I am sure color for enabled and disabled button would be different. If this is the case- viola!
You can check the height and width of the object to identify the object .
Mostly in masked scenario it will be zero .
Well, if the button is disabled, then clicking it will yield no result. If this is for a web-based application, then you can include a checkpoint in your code to check that no request/response is sent from the webpage. (ie. no communication is initiated from the browser).

Setting active a page(tab) in a notebook of form view

I'm developing a module for openerp v7.
I've defined a workflow and in my view defined a form with a notebook which contain as tabs as status defined in workflow.
In every tab i've a button which triggers the change of status of the workflow. All of this works like a charm!
The problem I am facing is that when the button triggers the workflow status change, the status changes but the tab marked as active is not changed, as far i know this is the expected behaviour, but i would like to change the active tab when the status of workflow changes and i didn't find any way to do it.
INFO: According to the DOCS there is a way of doing this with the fields:
default_focus: set to 1 to put the focus (cursor position) on this field when the form is first opened. There can only be one field within a view having this attribute set to 1 (new as of 5.2)
But no way with pages...
Any help would be very appreciated.
I think that making a tab to be active is not the expected behavior with a workflow. Normally, buttons are putted in the header next to the statusbar, and each button have the "states" attribute to define those status they must appear in (according with the "state" field of the model).
If you want to show/hide some information (say field, group, page, etc) according to the workflow status, you can use the "attrs" parameter with the "invisible" option restricted to a domain over a "state" field value.
If you want to use JavaScript, you can use this to focus a tab page:
$('.oe_notebook #ui-id-3').click()
Where ui-id-3 is the 1 based index of the tab page. Here it would be the third page. Works in v8, can't tell for other versions. Hope it helps anyway :)

In a group check box is it possible to select an option by clicking anywhere in the screen and not exactly inside the check box?

From a group check box is it possible to select only one option. And I want to know whether a particular option can be selected without exactly clicking inside the check box. i,e Is it possible to select an option by just clickig somewhere in the screen where the text of the option is displayed.
I was testing an application and i found that it was able to select an option even without clicking inside the check box, so wanted to know whether that is a validation bug!!
I do not think that it is a bug if there is only one radio button or check box on the screen. Such type of functionality is sometimes provided in order to provide extra functionality to the user. There are certain validations that are capable to do this. But if there are multiple check boxes or radio buttons on the screen then it must be a bug. Because in case of multiple check boxes on the screen the script does not know which button to check.

How to always display a control on the currently active tab of a TabControl?

I have a tab control with two tabs. Both tabs have controls which are unique to them, but there is one control which I would like to always appear on whichever tab is currently active.
I figure I just need to add some code to TabControl1_SelectedIndexChanged().
I tried
MyControl.Parent = TabControl1.TabPages(
TabControl1.TabPages.IndexOf(TabControl1.SelectedTab))
MyControl.Parent.Update() ' is this necessary?
and I also tried
TabControl1.TabPages(
TabControl1.TabPages.IndexOf(TabControl1.SelectedTab)).Controls.Add(SeMyControl)
but neither worked (the control moved once, but when I went back to the original tab, the control did not appear there.
googling found someone suggesting
TabControl1.TabPages(TabControl1.TabIndex).Controls.Add(MyControl)
but that looks dodgy as the control is never removed from the old tab, so repeated switching would probably add the control multiple times.
I feel that I am close, but not quite ... how do I do it?
No, that works fine since Controls.Add() changes the Parent property. Which automatically removes it from the tab page it was on before. A control instance can only have one parent.
The more straight-forward approach is to simply not put the control on a tab page but leave it parented to the form which a lower Z-order so it is always on top of the tab control. The only problem with that is that the designer will hassle you. It automatically sucks the control into the tab page when you move it on top of the tab control. One trick to fix that is to leave it off the tab control and change its Location property in the form constructor.
Using your second code snippet that you are concerned about because it doesn't remove it from the original tab, why not just remove it from the original tab before you add it to the new tab?
Maybe something like: TabControl1.TabPages(TabControl1.TabIndex).Controls.Remove(MyControl)

Visual Basic & Context Menu

Is there a way to add a Header to the popup menu? I don't find a property for this.
You could also simulate a header on the context menu by putting the information you want to display in the header as the first item in the context menu. Put a separator (or perhaps two) underneath it and put no code behind it.
That visually separates the item and users will learn pretty quick that clicking the first item doesn't do anything.
This may not work in your situation, but whenever I needed to show a context menu off of a grid row that wasn't the current/highlighted row, I made that row the current row first, then showed the menu. That would eliminate the need for a header on the menu. I assume you're showing the context menu if the user right clicks on the row. Well before showing the context menu, make sure that row is current and highlighted.
Do as Corin says, but disable the first item as well. If you disable it, that should remove confusion entirely.