How to prevent GWT dialogbox from closing when clicking outside it - gwt

I plan to add a menu that pop ups when a user performs a certain action. This menu will include some fields that the user will fill out and then hit "Submit" which will close the dialog box and update the client based on information inputed.
However, I want the user to be able to close the dialog window by hitting cancel or submit, and not by clicking on the screen outside of the dialog box.
How can i do this? Or maybe I should just use a PopupPanel?

It's as easy as setting the auto-hide behavior to false, either at construction time or later.

Related

WicketTester: How to click secondary mouse button?

I want to test a wicket component which shows a context menu on click with the secondary mouse button.
With WicketTester.click(Component) I can click obviously simulate a click on a component. But how do I simulate a click with the secondary mouse button?
WicketTester does not provide means to test JavaScript!
If the context menu is being shown with Wicket Ajax call to the server to make it visible then you can do tester.executeAjaxBehavior(...).
If the menu is shown via JavaScript in the browser then WicketTester cannot check whether it is visible or not. But in that case you should be able to test selecting a menu item, i.e. sending an Ajax call with the appropriate value for the item.

Implementing "onclickout" with GWT

I need a way of capturing onclick event when a user clicks out of a FocusPanel(in the form of a dialog box). I need to warn the user to save their work before clicking outside thus losing the panel. I know how to do it in JavaScript but it I am stuck with GWT. Any assistance will be appreciated.
Every click event provides coordinates of a click. Check that these coordinates are outside of your popup panel.
Alternatively, make your PopupPanel modal, so that users can exit it only by clicking on UI elements that you provide, for example, submit and cancel/close buttons.

Skillbuilders save before exit

I am using the Skillsbuilders Save Before Exit Oracle ApEx plugin within one of my pages but for some reason, I do not want it to fire when the user presses the "Save" button on the page that basically branches back to itself, when they change something on the page.
Now the "Save" button is fired as part of a Dynamic Action, which basically first calls a JavaScript function, followed by PL/SQL and then performs a apex.submit("SUBMIT") JavaScript call.
With this plugin, how can I prevent it from firing when the user presses the "Save" button because when a user changes a field on the screen and then proceeds to press the "Save" button, this plugin fires and displays the dialog to the user that changes have been made, which is not what I want. I just want it to save the changes and stay on the page.
See here for plugin details:
http://apex.oracle.com/pls/apex/f?p=46685:SAVE_BEFORE_EXIT:0:::::
I have read documentation http://skillbuilders.com/download/download-resource.cfm/instructions.pdf?file=Oracle-Apex/plugins/save_before_exit//instructions.pdf
You must change attribute of the plugin named "Disable Warning Selector". Specify jquery selector, applied for all buttons which you want to fire the dialog.

How can I make Dialog Box to hide when user clicks anywhere outside Dialog Box?

How can I make Dialog Box to hide when user clicks anywhere outside Dialog Box?
It is a GWT application where a view is extending Dialog Box. I have a Close button in Dialog Box which OnClicked hides the Dialog Box. However, as per requirement, if user clicks anywhere outside the Dialog Box, it should hide.
Any help would be greatly appreciated.
Thanks
Use the constructor DialogBox(boolean autoHide) or the setter setAutoHideEnabled(boolean autoHide) in order to automatically hide the box when the user clicks outside of it.
You can also auto-hide on history token changes, using the setAutoHideOnHistoryEventsEnabled(boolean enabled) setter.

GWT-Google web Toolkit-DialogBox

I have doubt regarding GWT .In Gwt if i click one button than it shows one dialog box at th same time the form outside the dialog box disabled.What component can be used for this task?
Thanks in advance
So, you want to open a popup dialog box, and at the same time disable the rest of the page until the user closes the dialog box?
If so, you can simply use gwt's DialogBox.
Use the constructor with the autohide flag set to false, and the box will not close until the user responds, thus disabling the rest of the page. If you want to make this even more clear, use the glass effect:
yourBox.setGlassEnabled(true);
You can also use the PopupPanel directly and build your own custom dialog box.
Now, if I got it wrong and you want to disable the form so it remains disabled after the popup, just disable it in the onClick handler of the button that opens the box.