modal-dialog

Disable Text Field Autofocus in Javascript

一笑奈何 提交于 2019-12-05 09:30:29
Is there a way in Javascript to forcibly disable text field autofocus on page load? I know of the focus() method, but not how to disable it. My actual problem is that autofocusing in a modal window forces the window to appear with the scrollbar halfway down already and scrolled to the first input field, whereas I would like to disable this entirely. Thanks! You can use .blur() , var elelist = document.getElementsByTagName("input"); for(var i = 0; i < elelist.length; i++){ elelist[i].blur(); } If you want to disable focus on all the textfields, var elelist = document.getElementsByTagName("input

Retrieve input entered in a JDialog

对着背影说爱祢 提交于 2019-12-05 09:07:47
I extended JDialog to create a custom dialog where the user must fill some fields : How should I retrieve the data entered ? I came up with a solution that works. It mimics JOptionPane but the way I do it looks ugly to me because of the static fields involved... Here is roughly my code : public class FObjectDialog extends JDialog implements ActionListener { private static String name; private static String text; private JTextField fName; private JTextArea fText; private JButton bAdd; private JButton bCancel; private FObjectDialog(Frame parentFrame) { super(parentFrame,"Add an object",true); //

Modal Segue Chain

北城余情 提交于 2019-12-05 08:50:50
I have an iOS app that has a log in view ( LognnViewController ) and once a user is successfully authenticated they are taken to another view ( DetailEntryViewController ) to enter some simple details. Once the details are entered the user is taken to the main part of the app that consists of a tab controller ( TabViewController ) that holds a variety of other views. The LogInViewController performs a modal segue to the DetailEntryViewController and the DetailEntryViewController then performs a modal segue to the TabViewController so I have kind of a modal segue chain going to get into the app

Can't set DialogResult in WPF

我只是一个虾纸丫 提交于 2019-12-05 08:41:22
问题 I show a WPF window using ShowDialog() from the calling window. The window opens and is modal as expected. However, in my OK and Cancel button's click events in the dialog window I set this.DialogResult = true (or false) respectively, and the value does not get set. The window closes as expected, but DialogResult is still null. Is this a bug in WPF? Or is there a reason the DialogResult property cannot be set yet does not throw an exception? The window is not hosted in a browser. Code in the

CSS/JavaScript: Make element top-most z-index/top-most modal element

◇◆丶佛笑我妖孽 提交于 2019-12-05 08:16:18
I would like to make an element (e.g. a <div> ) be the top-most layer on the page. My assumption is that the only way I can do this is to specify that the element has a style="z-index:" value that is the maximum the browser allows (int32?). Is this correct? Instead, would it be possible to somehow get the element's z-index whose is highest, and make this <div> 's z-index the [highest element's value] + 1 ? For example: $myDiv.css("z-index", $(document.body).highestZIndex() + 1); How do modal JavaScript "windows" work? Here's how to do it : var elements = document.getElementsByTagName("*"); var

Dojo “loading”-message

微笑、不失礼 提交于 2019-12-05 07:38:08
I'm new to Dojo, so I need a little help. Some of my links takes a while (when the user clicks, it takes several seconds before the page starts loading), and I'd like to add a "loading"-message. I can do it the "old fashion way", but I want to learn the new, easier, smarter Dojo-way. Exactly how it works is not important right now, but I imagine something like this: A rectangle appears in the middle of the browser-windows. (Not the middle of the document.) It has an animated gif, and a message like "Please wait...". All other elements are disabled, maybe "faded out" a bit. Maybe a big white 50

Swing modal dialog refuses to close - sometimes!

為{幸葍}努か 提交于 2019-12-05 07:23:31
// This is supposed to show a modal dialog and then hide it again. In practice, // this works about 75% of the time, and the other 25% of the time, the dialog // stays visible. // This is on Ubuntu 10.10, running: // OpenJDK Runtime Environment (IcedTea6 1.9) (6b20-1.9-0ubuntu1) // This always prints // setVisible(true) about to happen // setVisible(false) about to happen // setVisible(false) has just happened // even when the dialog stays visible. package modalproblemdemo; import java.awt.Frame; import javax.swing.JDialog; import javax.swing.SwingUtilities; public class Main { public static

Making only portion of screen modal with jQuery UI

让人想犯罪 __ 提交于 2019-12-05 06:32:09
Is there any way to create a modal 'scope' for jQuery dialogs? As a somewhat contrived example, I've got a page: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Console</title> <link href="console.css" rel="stylesheet" type="text/css" /> <link href="libs/jquery-ui/jquery-ui-1.8.13.custom.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="libs/jquery/jquery-1.6.1.min.js"></script> <script type="text/javascript" src="libs/jquery-ui/jquery-ui-1.8.13.custom.min.js"></script> </head> <body> <div id="toolbar"></div>

Replacing UITextField input with a UIDatePicker

百般思念 提交于 2019-12-05 06:00:49
I have a table view controller with (among others) a cell that is to represent a date. I followed this post " How do I make a modal date picker that only covers half the screen? " and I have it working with one big exception - I can't get the picker to disappear! I tried registering for the event UIControlEventTouchUpOutside, but it seems that this is not generated by the picker (or at least in the mode that I am using it). How can I recognize that the user has finished selecting a date? Also, is there a way to disable the user from inputting directly into the UITextField? I want to force them

Unexpected behaviour of System.Windows.Window.ShowDialog() when no other windows are open. Any idea why?

北城余情 提交于 2019-12-05 05:56:14
问题 I picked up on this (with some effort) when my WPF MVVM application tried to show two consecutive error dialog windows before the main window was launched: After OKing the first window, the application went into a loop and the second error dialog never showed up. I fixed the problem, but I was hoping someone could enlighten me as to why this happened. It seems that, if there are no non-modal open windows, if one dialog window has been closed, all new dialog windows are immediately closed,