How to remove submit button from a dialog opened for a web-item? - modal-dialog

The dialog opened for the web-item has a submit button and a cancel link in it.
I don't want the submit button to be present in the dialog.
How to do that?
The api provided by connect i.e.
AP.require('dialog', function(dialog){
var submitButton = dialog.getButton("submit");
submitButton.disable();
});
has methods only to enable/disable it.

You can turn the chrome of the dialog off when it's created via dialog options. You would need to add your own buttons in once this has been done.

Related

How to redirected to the main page using an elevated button on alert dialog without clicking on the button?

How to redirected to the main page using an elevated button on alert dialog without clicking on the button?
I just want to hover the mouse on the button and it will do the specific action and also redirected to the main page without clicking on the button that will appear on alert dialog box.
How to redirected to the main page using an elevated button on alert dialog without clicking on the button?
I just want to hover the mouse on the button and it will do the specific action and also redirected to the main page without clicking on the button that will appear on alert dialog box.
You can use onHover method of your Button class.
Check documentation example of ElevatedButton page
onHover → ValueChanged<bool>?
Called when a pointer enters or exits the button response area.
final, inherited

how can I disable bootstrap modal on desktop and enable only for mobile/tablets?

enter image description here
We have two user interface, one for desktop and one for mobile, when user gonna login via desktop, then the username input and username password fields will show, and when it turns into mobile view, then both fields will be hidden and the screen shows look like below;
enter image description here
the issue is this, when I try to log in and click on login button, the login will appear ok, but when I click on login via desktop, the modal will appear too, I want to move or display hidden login popup on desktop screen. please answer.
You can handle click event on the button and check whether are input fields visible or not. If not, then show modal programmatically by calling $("#modal").modal('show')
So as default, use your login form as regular form (dont use bootstrap modal) and in JS:
$("#submitbutton").click(function() { //catch button click
if ( !$("#username").is(":visible") ) { //is mobile version?
event.preventDefault(); //dont send form
$("#modal").modal('show'); //but instead, show modal
}
});

How to prevent GWT dialogbox from closing when clicking outside it

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.

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.