Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User input in a messageDialog box

I'm trying to add a custom user input field in a messageDialog box, like the one below in the Bing Sports app. However, it seems you can only add commands, which are buttons. Any help?

(I'm working in HTML/JavaScript)

Normally, control over messageDialog boxes appears as follows:

var dialogMessage = 'This is the dialog text';
var dialog = new Windows.UI.Popups.MessageDialog( dialogMessage );
dialog.commands.append(new Windows.UI.Popups.UICommand("Button", function (command) {
    /* Action goes here */
}));
dialog.showAsync();

As you can see, you can only append a command to the dialogMessage, in the form of an actionable button...

enter image description here

like image 393
romeboards Avatar asked Jun 06 '12 18:06

romeboards


1 Answers

I've been stuck with the same problem for a few days now, and after hours of searching I still haven't found anything that lets you add an input text field to your MessageDialog. Note that I am fairly new to Windows 8 development, though I do have a few years of JavaScript experience.

I'm not sure if this is relevant, but since I wanted the input fields for a login, I came across this blog post from MSDN's blog. It explains the CredentialPicker class which is somewhat similar to the MessageDialog in terms of visual style, but as the name implies, it's only for collecting credentials from the user.

If this is not what you're looking for, you could check out the guidelines for usage of MessageDialog and the quickstart guide for MessageDialog, both on Microsoft's Dev Center, if you haven't already. I'm sorry I can't provide both the links due to restrictions on new users on StackOverflow.

like image 196
Christian Grimsgaard Avatar answered Oct 21 '22 20:10

Christian Grimsgaard