Show/Hide Toolbars

Inventu Viewer+ Server Macros

Navigation: Implementing the ServerMacro Class > ServerMacro Members > Client Interaction Methods

ClientPrompt - display a prompt for a single input value

Scroll Prev Top Next More

The ClientPrompt call will display a prompt with a single input value for the client to enter.

 

MacroDialogRC ClientPrompt(string label, ref string text, string description,
string title [, FVInpEnum inputType] [, MacroMessageType icon]
[, MacroButtons buttons] [, int timeOut])

 

Parameters

 

label

 Required. The prompt displayed in the dialog for the text value to be entered.

 

text

Required. The text that the user has entered.  NOTE: this is a reference value, so you need to have a string value defined and pass this as a ref parameter.  You can initialize the value to null or any string value appropriate for the prompt.

 

description

 Required. The title displayed for the HTML input field used when the mouse hovers over it.

 

title

 Required. The title displayed at the top of the prompt as displayed to the user

 

inputType

Optional. FVInpEnum value indicating type of input.  Default = FVInpEnum.text.  Note that at this time the ClientPrompt does not support the FVInpEnum.radioButtons option and will treat them as text input.

 

icon

Optional. Icon to be displayed.  See MacroMessageType enumeration.  Default=MacroMessageType.question

 

buttons

Optional. Buttons to be displayed.  See MacroButtons enumeration; you can combine multiple values with the OR | symbol.  Default=MacroButtons.ok | MacroButtons.cancel

 

timeout

Optional. Number of milliseconds to wait for client response.  -1 means no timeout (indefinite wait).  Default value is -1 (indefinite wait)

 

Remarks

Your macro code will wait until the user enters a value and clicks on a button unless the timeout parameter is used.  You can then check on which button was clicked by setting a  MacroDialogRC value as the return and using the MacroDialogRC in logic.

 

Example:

 

 public override MacroRunResult run()

 {

         string pw = null;

         MacroDialogRC rc = this.ClientPrompt("Insure System Password: "ref pw, 

                                 "The password to signon with...",         "Signon Password Entry"

                                 FVInpEnum.password, MacroMessageType.question, 
                                 MacroButtons.ok | MacroButtons.cancel);

         if (rc == MacroDialogRC.ok)

         {

                 this.oScreen.putCommand("simmy[enter]", 2000);

                 this.oScreen.putCommand("2[enter]", 2000);

                 this.oScreen.putCommand("simmy[tab]"+pw+"[enter]", 2000);

                 // Only continue if password advanced the screen successfully

                 if (oScreen.getText(1,1,3)=="DFH")

                 {

                         this.oScreen.putCommand("[clear]", 1000);

                         this.oScreen.putCommand("info[enter]");

                 }

         }

         return MacroRunResult.ok;

 }