Methods |
Below is a list of Webster+ methods in alphabetical order. When referencing the method, it would normally be prefixed with %Webster'.
Method |
Description | ||||||||||
This function can be used to add a row to a grid. It will use the current values for the variables defined in the IOList attached to the grid memory file as defined in the variable names in gridname$. If the specified row already exists in the grid, a new row will be inserted. An Error 11 will occur when an invalid row is specified. (The AddRow method was added in PxPlus 2022.) | |||||||||||
This function can be used to update an existing row in a grid. It will use the current values for the variables defined in the IOList attached to the grid memory file as defined in the variable names in gridname$. If the specified row does not exist in the grid, an Error 11 will occur. (The ChgRow method was added in PxPlus 2022.) | |||||||||||
ClrUserField(variable$) |
This function is used to clear/remove the specified user variable from the current user's profile. | ||||||||||
Console.Error( ) Console.Log( ) Console.Warn( ) |
These functions provide a means to output to the browser log. %Webster'Console.xxx(text$) Where:
The console output can be viewed by the user by pressing F12 on most browsers. The three types of output are displayed in different colors based on the severity with Error generally being on a Red background, Warn on a Yellow background and Log being on White. | ||||||||||
This function can be used to delete an existing row in a grid. If the specified row does not exist in the grid, an Error 11 will occur. (The DelRow method was added in PxPlus 2022.) | |||||||||||
Download(filename$) |
This function initiates a file download to the workstation. Where:
This function will initiate a browser download of the specified file. The file will be placed in the standard download location based on the workstation or device settings. | ||||||||||
This function can be used to enable/disable a button on the page. Where:
| |||||||||||
Event(eventname$) |
This function is used to force an event to be generated by a Webster+ page. Where:
Note: | ||||||||||
Focus(element$ [ ,grid$, line ] [, radiobtnval$ ] ) |
This function is used to set focus to the specified element on the page.
Note: | ||||||||||
GetFileUrl$(filename$) |
This function returns a URL that can be used to retrieve any file on the system from a browser. This function is typically used to provide access to images or other files (PDF, Documents, etc.). The URL returned includes an encrypted key that Webster+ will use to access the file. The key is based on the user currently signed on; thus, the URL itself is only of use to that user. Where:
Note: | ||||||||||
This function returns a URL that will display the given iNomads URL embedded in a Webster+ page. Where:
(The GetiNomadsEmbedURL$ method was added in PxPlus 2024.) | |||||||||||
GetTempFile$(filename$) |
This function returns the pathname to a temporary file based on the filename provided. These temporary files should be deleted when no longer needed; however, the system will delete any temporary file over one day old. Where:
The path returned will point to a file in the system temporary file directory (as defined in Webster+ setup) with the filename provided altered to include a unique timestamp sequence number inserted before the file suffix. | ||||||||||
Hide(name$, state [,leavespace]) |
This function can be used to hide/show a control on the page. Where:
| ||||||||||
This function can be used to lock a control such as an input field or list. Where:
| |||||||||||
This function will return the message identified by messageid$ from the system message library. Where:
This method provides enhanced replacement capabilities over the standard MSG( ) function; however, instead of replacing parameters by ordinal numbers (%1, %2, %3, etc.), it replaces values by variable name. Example: Using Message Library Maintenance, the following message could be defined: Message Key: OnHold You could then use this method to convert this, passing the message key and the values to be substituted as follows: Text$ = %Webster'Message$("OnHold" with Acct$=AccountNo$) This would replace the string %Acct$ with the value currently in AccountNo$. Numeric variables can also be used; however, no formatting of the value will be done; that is, the parameter in the text will be replaced with a simple STR( ) of the variable's value. Note: | |||||||||||
MsgBox(message$, title$, options$ [ , eventprefix$ ] ) |
This function provides the ability to generate and display a message box on the page when it is returned to the browser. The buttons on the message box can be used to signal events to your page for further processing. Where:
When the user selects a button from the message box, Webster+ will generate an event, causing the page contents and event to be returned to the program specified on the [form] short code. The event name will be lowercase text value from the button. For example, the "Yes" button by default will return an event of "msgbox_yes". The "OK" button (when no eventprefix$ is defined) and the "Cancel" button (in all cases) are exceptions and will simply close the message box without generating an event. Optionally, if you manually define button text using BTN1=xxx, etc., you can include a :Event following the text to appear on the button, and that will be used instead. For example, if you included the option "BTN1=Authorize:auth", the first button would contain the text "Authorize" and, when pressed, would generate an "auth" event. Example: Suppose you want a message box to ask for confirmation to delete a record. This could be done using the following: %Webster'MsgBox("Do you want to delete this record","Please confirm","?,YESNO","delete") This would display a message box and, if the user clicked the "Yes" button, your program would receive an event of "delete_yes". If the user selects "No", you will receive "delete_no". If the user simply closes the message box, you will receive nothing. If you do not want or need a "delete_no" event, you can add "btn2=No:" to the option string. This will override the default behavior for the "No" button and simply cause the message box to close with no event generated. | ||||||||||
This method can be used to update a named infobox (a [show] short code with the class of infobox) with message text followed by up to five options from which the user can select. Where:
Once the user selects one of the options, the specified event will be generated with the corresponding variable (same as event name) loaded with the number of the option selected. Example:
… would generate an infobox like this:
Since the event$ parameter specified is "", once the user selects one of the options, the event "payinfo" (name of the infobox) will be generated, and the variable "payinfo" will be set to the selected option number. (The OptionBox method was added in PxPlus 2022.) | |||||||||||
PopInput(message$, title$, options$, variable$ [ , inputoptions$ ] ) |
This function provides an enhanced MsgBox that will prompt for input. The value entered by the user will be returned in a variable named by the variable$ parameter. Where:
(The PopInput method was added in PxPlus 2022.) | ||||||||||
SetErrorMsg( [ variable$, message$ [ ,grid$, line ] ] ) |
This function is used to force an input field to be flagged as invalid and to set the error message to be displayed. Where:
Once an error has been set on a field, you must either replace the whole page or specify an empty ("") error message. If there are any fields with errors, a button with a 'validate' specification will not issue its associated event when pressed. Instead, the system will set focus on the first invalid field on the screen and redisplay its associated error message. | ||||||||||
SetUserField(variable$, value$) |
This function is used to define user variables that will be loaded into %usr.variable$ and made accessible to the application. Where:
This routine will allow values to be saved to the profile information for the current user. Example: %Webster'SetUserField("CellPhone","4165551212") This would result in the value %usr.CellPhone$ being set to "4165551212" on subsequent requests for the current user. A maximum of 2K worth of data values may be saved. | ||||||||||
This function is used to show a file, such as an image file or PDF, to the user (if newtab=1, force new tab). | |||||||||||
This function signals a change in the specified pathname$ that can be watched (using the WatchChange method) by another tab in the browser. It is used by the Webster+ program and HTML page editors to signal that a file has changed in order to have other tabs, such as a directory listing or program view, update their display. (The SignalChange method was added in PxPlus 2021 Update 1.) | |||||||||||
Update(channelNumber) |
This function is used to update the contents of a tree view by passing the channel number that contains the tree view contents. When updated (like when initially displayed), the tree view will only show the top level of the tree. To expand/expose lower levels, you need to update the tree view using the %Webster'Update(tree_name$, value$) method. The %Webster'Update(channelNumber) method can also be used to directly update the contents of a grid. (The Update(channelNumber) method was added in PxPlus 2023.) | ||||||||||
Update(listboxname$) |
This function is used to update a list box. It is a more consistent way of running %Webster'Bind'Reload(listboxname$). See %Webster'Bind'Reload. Where:
(The Update(listboxname$) method was added in PxPlus 2023.) | ||||||||||
This function is used to update the contents of a variable on a Webster+ generated HTML page. Where:
You can call this routine with no parameters to force Webster+ to flip to Ajax style updates. This can be useful if you have nothing to update on the screen (i.e. you only processed the event and do not change anything). It can also be used in conjunction with %Webster'SetErrorMsg("control", "message") to set a validation error message on a control or if all you want to do is respond with a message box using the method %Webster'MsgBox("message", "title", "options"). If you do not call 'Update( ) to flip to Ajax mode, your response will be sent as part of a full screen retransmission. | |||||||||||
UpdateFMDisplay( ) |
This function is used in conjunction with File Maintenance generated Webster+ pages to force a full update of all fields on the page as if a new record has been retrieved. Note: | ||||||||||
UpdateFMShowVars( ) |
This function is used in conjunction with File Maintenance generated Webster+ pages to force an update of any SHOW.xxxx values on the current page. For information on SHOW.xxxx descriptive fields, see Extended Class Validation and Display. Note: | ||||||||||
UpdateIOL(iolist$, values$ [ ,grid$, line ] ) |
This function is used to update the contents of multiple variables on a Webster+ generated HTML page. Where:
Note: | ||||||||||
This function initiates a background monitor for changes made by another tab in the same browser to the specified pathname$. When a change is signaled (using the SignalChange method), the button whose ID is specified in buttonid$ will be logically clicked, allowing an event to be sent to the host for processing. To monitor a directory for any changes in subordinate files, append /* to the directory name. (The WatchChange method was added in PxPlus 2021 Update 1.) |