Change footer text

This procedure shows you how to change a footer using a front call.

About this task

To implement this footer change requires you to:

This customization can be used to display information in the header or footer such as the name of the logged-in user, databases user is logged in to, and so on.

  1. In the gbc-project-dir/customization/customization-project-dir/js directory, add a js file called myFrontCallModule.js or add the functions contained in the modulum method to your existing module:
    // in myFrontCallModule.js
    "use strict";
    
    modulum('FrontCallService.modules.myfcmodule', ['FrontCallService'],
      function(context, cls) {
        context.FrontCallService.modules.myfcmodule = {
    
          myCustomSyncFunction: function (name) {
            if (name === undefined) {
              this.parametersError();
              return;
            }
            if (name.length === 0) {
              this.runtimeError("name shouldn't be empty");
              return;
            }
            return ["Hello " + name + " !"];
          },
    
           replace_html: function (id, value) {
              document.getElementById(id).innerHTML=value;
              //return;
              return ["0"];
          },
    
          myCustomAsyncFunction: function (name) {
            if (name === undefined) {
              this.parametersError();
              return;
            }
            if (name.length === 0) {
              this.runtimeError("name shouldn't be empty");
              return;
            }
    
            window.setTimeout(function () {
              this.setReturnValues(["After 5s, Hello " + name + " !"]);
            }.bind(this), 5000);
          }
        };
      }
    );
    In this example the customization is defined in the replace_html function. This function is called by the front call. It has two parameters: the id is the identifier of the DIV element where the footer is added, and the text (value) to display in the footer is provided in the second parameter.

  1. Edit MyMainContainerWidget.js.
  2. Edit MyMainContainerWidget.tpl.html.
  3. Save your changes and rebuild your customization using gbc build:
    $ gbc build --customization customization-project-dir
  4. In your Genero BDL app, create a simple form for the user to enter text.
    1. Your file should resemble the code in the following example.
    2. Save your file as replace_html.per
    3. Compile your form.
  5. View the changes by opening the app with a front call command to call the replace_html function.
    In this example, the replace_html form is opened. The front call to the replace_html function is made when the user clicks the Replace button after inputting text. In the call to ui.Interface.frontCall() the ["gbc_cust_username",txt] specifies the id of the DIV element where the footer is added and the text to add.