Web Application - Prompt Method

Show the browser Prompt dialog

Member of Web Application (PRIM_WEB.Application)

Parameters

NameTypeData TypeDescription
Caption*InputUnicode StringText to be displayed in the dialog
Value*BothUnicode StringValue for the input box in the dialog
ResultCode*Result (Optional)EnumerationButton pressed in the dialog

Details

The Prompt method provides access to the JavaScript Prompt function.
 
Prompt shows the Caption as specified returning whatever was entered in the Value parameter.
 
Prompt uses a JavaScript feature. Precise implementation will depend on the browser.

Example

Simple example demonstrating the use of the Prompt method.
Begin_Com Role(*EXTENDS #PRIM_WEB)
 
   Define_Com Class(#PRIM_PHBN) Name(#Prompt) Caption('Prompt') Displayposition(1) Left(16) Parent(#COM_OWNER) Tabposition(1) Top(14) Width(193)
 
   Evtroutine Handling(#Prompt.Click)
 
      #xDemoAlpha128 := "Enter a value here"
 
      If (#sys_web.Prompt( "Prompt for something" #xDemoAlpha128 ) = OK)
 
         #Prompt.Caption := ("Reply &1").substitute( #xDemoAlpha128 )
 
      Else
 
         #Prompt.Caption := "Prompt cancelled"
 
      Endif
 
   Endroutine
 
End_Com

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020