Home

Class goog.ui.Prompt

Creates an object that represents a prompt (used in place of javascript's prompt). The html structure of the prompt is the same as the layout for dialog.js except for the addition of a text box which is placed inside the "Content area" and has the default class-name 'modal-dialog-userInput'

extends goog.ui.Dialog
Instance Method Summary
callback_()

Callback function which is invoked with the response to the prompt

createDom()

Create the initial DOM representation for the prompt.

disposeInternal()

Disposes of the component. Calls {@code exitDocument}, which is expected to remove event handlers and clean up the component. Propagates the call to the component's children, if any. Removes the component's DOM from the document unless it was decorated.

enterDocument()

Called when the component's element is known to be in the document. Anything using document.getElementById etc. should be done at this stage. If the component contains child components, this call is propagated to its children.

focus()

Overrides setFocus to put focus on the input element.

getCols() ⇒ number
getRows() ⇒ number
handleInputChanged_()

Handles input change events on the input field. Disables the OK button if validation fails on the new input value.

onPromptExit_(?goog.ui.Dialog.Event e)

Handles the closing of the prompt, invoking the callback function that was registered to handle the value returned by the prompt.

setCols(number cols)

Set the number of cols in the user input element.

setDefaultValue(string defaultValue)

Sets the default value of the prompt when it is displayed.

setRows(number rows)

Set the number of rows in the user input element. A values of 1 means use an element. If the prompt is already rendered then you cannot change from to