tooltipScreenShot
XSP.openTooltipDialog("#{id:tooltipDialog1}",'#{id:button1}')
How does it work on SSJS? If a function returns false, this tooltip dialog has to appear next to the button. I believe this tooltip should be close to the button.
It appears bottom left corner
All these commands below don't work:
facesContext.getViewRoot().postScript("XSP.openTooltipDialog('#{id:tooltipDialog1}')");
facesContext.getViewRoot().postScript("XSP.openTooltipDialog('#{id:tooltipDialog1}','#{id:button20}')");
view.postScript("XSP.openTooltipDialog('#{id:tooltipDialog1}');");
Use getComponent("tooltipDialog1").show(). The syntax for opening tooltip dialogs in SSJS is the same as for normal dialogs, see XPages Extension Library pp156-162.
setFor() is available via SSJS only.
Related
I am having a scenario to click on a svg element, tried the following code, it is not throwing any error. it is clicking but the element state is not changed. tried force click also.
cy.xpath("(//app-job[contains(#class,'selected')]//highcharts-chart[#id='GMF_K_CHART']//*[name()='svg']//*[name()='g' and #class='highcharts-series-group']//*[name()='g' and #clip-path='none' and not(#visibility)])[4]//*[name()='path'][4]")
.click()
Graph how displaying after clcik
But it should be if clicked properly
I tried multiple combination of clicks
`.click({force: true})
.click()
.trigger('change')
.trigger('focus')
.click()`
Please make sure that you're selecting the svg element and then, use trigger() to click on that element.
cy.get('<svg element>').trigger('click')
It seems that cypress expects that click is preceded by mouse hover. In that case, make sure that cypress hovers the mouse over the point (the tooltip must fire) and then let the cypress perform a click event on the point.
cy.get(".highcharts-container")
.get(".highcharts-point")
.eq(1)
.trigger("mousemove");
cy.wait(1000);
cy.get(".highcharts-container")
.get(".highcharts-point")
.eq(1)
.trigger("click");
If that didn't work, it would be possible that some cypress event is not correctly triggered; in that case try the following workaround:
cy.get(".highcharts-container")
.get(".highcharts-point")
.eq(1)
.trigger("mousemove").trigger("mousemove");
cy.wait(1000);
cy.get(".highcharts-container")
.get(".highcharts-point")
.eq(1)
.trigger("click").trigger("click");
It'd be handy if there was a keyboard shortcut for hiding and showing the sidebar. Sublime has cmd+k+b and it's a quick way of gaining some screen real estate when you need it. Anybody know if this exists or if the user can add it manually to VS Code?
The command can be triggered via Ctrl+B on Windows and Linux or Cmd+B on the Mac.
There are 3 bars on the side, 2 left and 1 right:
the activity bar with 5 buttons
the primary sidebar toggled by clicking any of the activity bar buttons.
the minimap
All of these hotkeys and more (e.g. the terminal & output panel, Ctrl+J) are now visible through the View (Alt-V) and View>Appearance menus:
The activity bar has no toggle hotkey by default, but you can assign one like this:
{
"key": "ctrl+alt+b",
"command": "workbench.action.toggleActivityBarVisibility"
},
Or hide completely with "workbench.activityBar.visible": false
The sidebar toggle hotkey is Ctrl+B by default, but may be overridden by e.g. vim plugin, here's how to enforce or change it:
{
"key": "ctrl+b",
"command": "workbench.action.toggleSidebarVisibility"
},
The minimap can be hidden with "editor.minimap.enabled": false and toggled with editor.action.toggleMinimap since vscode 1.16.
And with the Sidebar-activity toggler extension, so you toggle both activity and sidebar together with one key mapping to sidebar-activity-toggler.toggleSidebarAndActivityBar
To Hide the 5 button Activity Bar we can now:
View -> Hide Activity Bar
This is in vscode 1.9, not sure which version it was introduced in.
As Benjamin Pasero's answer states you can use:
Ctrl+B on Windows and Linux
⌘ Cmd+B on the Mac.
but sometimes you have another keyboard shortcut with ⌘ Cmd+B, in my case I had it to format some React code. To reverse that you can use the following:
Code > Preferences > Keyboard Shortcuts (⌘+K ⌘+S) then search for B and disable the other shortcut command.
You can also change the it and put which ever shortcut you want, just search for Toggle Side Bar Visibility like this:
Just in case you be intended for hiding the right lateral "sidebar", also called minimap, there is no shortcut. But you can configure the settings with:
{"editor.minimap.enabled: false"}
One can also hide the activity bar with the following setting in settings.json:
"workbench.activityBar.visible": false
To hide/show the side bar:
Ctrl+B on Linux and Windows.
⌘ Cmd+B on Mac.
No need to edit Settings.json directly
Do the following:
Open the Keyboard Shortcuts by pressing ctrl+k & ctrl+s
Search: "Toggle Activity Bar Visibility"
Enter the keyboard shortcut
Done!
Activity bar visibility in visual studio code
Mac users,
⌘ + B or
⌘ + 0 - Worked Perfectly
In the VS code version 1.43, you can hide or show the side menu or activity bar by going under the 'VIEW' tab in the nav bar in the top margin of VS CODE(called the 'Menu Bar'). Go to View => Appearance, there you can check or uncheck different nav bars to show/hide each one.
If you have the top bar (Menu Bar) currently hidden press 'alt' key to bring it back then follow above instructions to check it to keep it there permanently if desired.
In my OSX Electron app I have a tray icon that I would like to toggle between opening and closing the Electron app window. Similar to how clicking on the OSX Dropbox tray icon will open and close the Dropbox tray menu, no matter how fast you click the tray icon.
Here is the code I'm using:
tray.on('click', function(e){
if (mainWindow.isVisible()) {
mainWindow.hide()
} else {
mainWindow.show()
}
});
This works if you click slowly (wait a second between clicks) however if you click repeatedly, more than 1x in a second, the click fails and nothing happens. I couldn't find any type of delays in the docs. Any ideas on what's going on and how to make the click event work reliably?
The problem you're describing is easy to reproduce. The result you're getting is not a bug or a wrong implementation on your side but it's the expected result regarding the current way Electron is handling these click events on a tray element.
The class Tray exposes 3 events relative to click: click, double-click and right-click.
If you use the right-click event, you're not going to have this issue, you can click as fast as you want, you'll get your callback called every times.
The Electron code for macOS for example to handle this event is the following:
- (void)rightMouseUp:(NSEvent*)event {
trayIcon_->NotifyRightClicked(
[self getBoundsFromEvent:event],
ui::EventFlagsFromModifiers([event modifierFlags]));
}
For every right click, they're firing the right-click event and that's it.
Now if we take a look at how the left click are handled, the code is slightly different:
- (void)mouseUp:(NSEvent*)event {
// ...
// Truncated to only show the relevant part...
// ...
// Single click event.
if (event.clickCount == 1)
trayIcon_->NotifyClicked(
[self getBoundsFromEvent:event],
ui::EventFlagsFromModifiers([event modifierFlags]));
// Double click event.
if (event.clickCount == 2)
trayIcon_->NotifyDoubleClicked(
[self getBoundsFromEvent:event],
ui::EventFlagsFromModifiers([event modifierFlags]));
[self setNeedsDisplay:YES];
}
When the tray icon get clicked multiple times, the event.clickCount doesn't always return 1. Instead, it returns a value that counts the clicked times.
So when you're click the tray icon very fast, event.clickCount will have a value greater than 2 and they're only emitting an event when the value is 1 or 2 and if it's not the case, they don't have any fallback, they simply don't emit any event. That's the result you're seeing in your tests when clicking fast enough.
So without modifying the Electron implementation yourself, submitting an issue or a pull request, you can't at the moment avoid this behaviour.
Electron 3.0 introduced an API that prevents waiting for double-click.
// Ignore double click events for the tray icon
tray.setIgnoreDoubleClickEvents(true)
"Sets the option to ignore double click events. Ignoring these events allows you to detect every individual click of the tray icon. This value is set to false by default."
Related Docs | Release Notes for Electron 3.0
I have an HTA which opens a showmodaldialog and this JavaScript code in the dialog page:
function helpButton(){
document.body.style.curosor = "help";
my_div.onclick = function(){alert("Help for the div is displayed here")}
}
I want a help button in the title bar of the showmodaldialog, like on the picture below:
(don't mind about the fact that the picture's in French, it's my computer's language)
When I push on that help button, I want it to execute the helpButton() function.
There was showModalDialog('path', 'arg', 'help:yes'); and you could attach an onhelp handler within the opened dialog's window. However, this dialog property is obsoleted - since IE9, if I'd recall correctly - and can't be returned by downgrading the app using X-UA when running a HTA with a newer IE.
You still can set onhelp, and call it by hitting F1:
window.onhelp = function () {
alert('Help is asked.');
};
I'm using a GRAILS UI (1.2-SNAPSHOT) an it's implementation of the YUI menubar (YUI 2.7.0.1). I am seeing flakey mouseover behavior in IE (Firefox is ok). When I mouse over the menu item with a submenu, it will show. As I try to mouse over the sub-menu, the submenu disappears before I can click. This happends in a pattern I haven't fully figured out. Usually the first time I select a menu it's fine but if I move around the menu back to a menu item, the submenu begins to display this behavior. By clicking and holding the mouse button I can usually get the sub-menu to stick around.
I've palyed with various configurations like keepopen and automenudisplay but they don't seem to change the behavior. I have not seen much posted about this. But I also don't see menu's documented in the UI plugin either. I could really use some feedback if UI menu is not ready for primetime yet or I'm missing something else. I've not worked with much AJAX before.
Below is the code with the added options I played with that did not have a positive impact.
<gui:menubar id='menubar' renderTo='mainmenu' autosubmenudisplay="false" shadow="true" keepopen="true">
<gui:menuitem url="/esmzone">Home</gui:menuitem>
<gui:submenu label='Profile'>
<gui:menuitem url="${createLink(controller:'memberProfile', action:'view')}">View</gui:menuitem>
<gui:menuitem url="${createLink(controller:'memberProfile', action:'profile')}">Edit</gui:menuitem>
<gui:menuitem url="${createLink(controller:'user', action:'account')}">Settings</gui:menuitem>
<gui:menuitem url="#">Subscription</gui:menuitem>
</gui:submenu>
Here is the code generated by the plugin:
<script>
YAHOO.util.Event.onDOMReady(function() {
GRAILSUI.menubar = new YAHOO.widget.MenuBar("menubar_div", {'autosubmenudisplay': false,
'shadow': true,
'keepopen': true});
GRAILSUI.menubar.render('mainmenu');
});
</script>
I made some progress on this by researching the YUI library. There is a documented bug with IE7. Apparently the grails-ui plugin does not address the fix. I'm testing with IE8 but I assume it's still there.
http://developer.yahoo.com/yui/menu/#knownissues
It appears that you should set the zoom property to 1 (zoom:1) for the bd class.
I added the following code to my style sheet
div.yuimenubar .bd {
zoom: 1;
}
and it seems to help. I see no side effect in Firefox but I didn't dynamically check for the version of browser as I would need to hack the code that generates the YUI javascript and put in
if (YAHOO.env.ua.ie === 7) {
YAHOO.util.Dom.addClass(document.body, "ie7");
}
after the render() call. Then instead of the style I added you could do an IE7 (probably >=7) style.
This is what the Yahoo site had to say about it:
The following application of
"zoom:1" sets the "hasLayout"
property to "true" and prevents
first tier submenus of a MenuBar
from hiding when the mouse is moving
from an item in a MenuBar to a
submenu in IE 7.
For more on the "hasLayout" property:
http://msdn.microsoft.com/en-us/library/ms533776(VS.85).aspx