modal dialog in gwt with clicklistener - gwt

I've a huge panel with drop-down lists and checkboxes. To manage them I have to implement the ClickListener interface so that on expanding the drop-down list or clicking on the checkbox some actions are executed.
Then I have to show the dialog box with just one 'OK' button and this dialog should be modal. I create it using via the following constructor
final DialogBox msg = new DialogBox(false, true);
so it should be modal and it is except for drop-down lists and checkboxes because clicking on them calls to the onClick(Widget sender) method which knows nothing about the modality of the dialog box so it could expand the drop-down list or tick the checkbox.
I see that this could be resolved by just one if in that onClick() method where it should check if there is no modal window or there is one. But is there another option to resolve this issue?

Are you looking for setGlassEnabled(boolean)?

Related

Adding a static "new" option to MUI5 Autocomplete

MUI5 Autocomplete does not seem to have a footer option in which you can place a custom "new item" option. The required flow is:
Autocomplete's options drawer is opened
Scroll to the bottom of the options drawer
New custom model is clicked (last option)
Result: A modal is opened to customize the new custom item
What is the best course of action to support such a behaviour?
Adding it manually can collide with the sort/search capabilities of the AutoComplete component.

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.

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.

Parent-Child Window Interaction GWT

There is parent window, which has a Panel. When user clicks on a button from parent window then a popup opens up. On popup user populates some fields and clicks on OK button then a new row should be created on parent window's panel and set values from popup window and close it.
Any Idea how to do this in GWT? Please post some example if you have. Thanks in advance for your help.
You must create a class representing the Popup and add a field to it referencing the Parent Window. In the constructor of the Popup, you pass the Parent Window as a parameter. When the user clicks ok in the popup, you call the PArent window and ask it to add a row via a method present in the ParentWindow

How to use DialogBoxes in a TabPanel in GWT

i use the GWT TabPanel and want to use a DialogBox in one of these tabs. I think the DialogBox is added to the RootPanel because i see the box in every Tab.
Is there a option to see the box only in the box there the panel was created? Or must i create my own DialogBox or overwrite some methods (.show?)
Greetz,
Destiny
A DialogBox is is a popup and not attached to any of your panels. So you can't use a Dialogox in a TabPanel as it will not be attached to that panel as you found out yourself (it's attached to the RootPanel). If you want to only show this dialogbox when a specific tab is selected you need to hide the dialog box when another tab is selected. You can do this by adding a TabListener on the TabPanel and implement the onBeforeTabSelected method and check which tab is selected and hide or show the dialogbox.