Purpose
List of the commands that are specific to the WebUI interface.
Most of the commands included in this reference library can be used on multiple interfaces. However, the following commands can only be used with Liquid UI's Web Server and WebUI interfaces. These commands are as follows:
- htmlnode
- usecss
- usejs
We will explain these three commands in the following sections of this document.
htmlnode
The htmlnode command is used to read or to display HTML on SAP screens in WS. This can be very useful when users want to view images in Web Server or implement a Google map, to name two very common uses of the Htmlnode command. The syntax to display or read HTML in WS is as follows. The parameter '101' in the syntax example refers to the type of control - in this case it references an entry field.
htmlnode('101',[row,col],"html string");
Options
The htmlnode command does not take any options.
Examples
To view an image in SAP with htmlnode:To view Google maps with htmlnode:
usecss
Modifying Web Server css files.
The usecss command is used to modify the included CSS format in the WS Web Server. These modifications are usually for personalizing the WS platform to match a customer's corporate environment, but can be for a variety of purposes. Some possible uses might be to add background image or to specify an external location for a CSS file. In this section we will demonstrate how to use the usecss command.
Options
The usecss command does not take any options.
Adding a background image
To add a background image to the CSS, use the following syntax:
usecss("string");
The string in the preceding syntax would include the specifications for the background image. For example, if we wished to use the image file 'Synactive.jpg', we would need to add the following code to the config.sjs file in the C: \Program Files\Synactive Inc\GuiXTFuzion directory:
usecss("body.urBdyStd {background-image: url('.demo_images/synactive.jpg'); No-repeat;}");
This code will result in a background image being added to the server. CSS files are also maintained in the server.
Specifying an external CSS file
You can also specify an external file to use as the CSS file with GuiXT Web Server. The syntax is as follows:
usecss("C:\\Program Files\\Synactive Inc\\GuiXTFuzion\\test.css");
GuiXT Web Server will now use the specified file as the source for the CSS.
usejs
Including JavaScript or a file within a script in Web Server.
The usejs command is utilized to include Javascript or a file within a script in WS Web Server. Usejs functions very similarly to the usecss command and is placed in the same config.sjs configuration file as well. The syntax is as follows:
We will explain these three commands in the following sections of this document.
Options
The usejs command does not take any options.
Including a script
The string in the command could include a number of parameters or possibly a short script that would then be incorporated into the WS script. For example, if a user wanted to include code to print out 'Hello World', the following would need to be included in the config.sjs configuration file in the C:\Program Files\Synactive Inc\GuiXTFuzion\ directory.
usejs("println('Hello, World')");
The body of the action to be performed will be included within the double-quotes. In this case, the included line is for a simple 'println' operation. However, this string could be more complex as well.
Including a file
You can also call a separate Webscript function or even a complete script from an external file. To do this, the syntax would be as follows:
usejs("filename");
For example, if you want to include a script or function that would be housed externally in the file C:\ExternalScripts\TestFunction.js, you must also include the following code in the config.sjs configuration file:
usejs("TestFunction.js");
For files housed in the same directory as the scripts, you do not need to include the true or absolute path - the code can find the relevant file as long as it is in the same directory. If the file is housed in a different directory, then it would be necessary to include the full path to the file, as in the following example:
usejs("C:\ScriptFiles\TestFunction.js");
This file can contain any content from a single function to a complete script. Once called, the file will run, and then the remainder of the original code will continue from the point where the file left off.