OZ e-Form Developer
  • OZ e-Form Concepts
  • 🌈e-Form DEVELOPER
    • Day 1: Welcome On Board
      • About Course
      • Preparations
      • OZ e-Form Overview
    • Day 2: e-Form Design
      • Designer Environments
      • e-Form Layout Structure
      • e-Form Components
      • e-Form From Documents
      • Preview / Export / Save
      • Hands-on Practice
    • Day 3: Dynamic e-Form
      • e-Form Scripting Guide
      • Hands-on Practice
      • Advanced Features
    • Day 4: e-Form Application
      • Server Deployment
      • Viewer In HTML
      • Viewer APIs
      • Prefilling e-Form
      • Submitting e-Form
      • Sending MemoryStream
    • Get Your Certificate
    • Design Guide
      • Dialogue Flow
        • Overview
        • Creating Dialogue Flow
        • Uploading e-Form to Server
        • Running Dialogue Flow
        • Group and Statement
        • Custom Styling
      • Multilingual e-Form
      • Miscellaneous
      • Videosign
        • Videosign User Guide
      • OZ Verifier
        • OZ Verifier Introduction
        • Implementation and Use
        • Requirements
      • HTML5 Editor
        • HTML5 Editor Introduction
        • HTML Editor
        • Requirements and Sample
    • Day 5. Server & Reporting
  • 🌈Server Developer
    • OZ Server Console
    • OZ Scheduler
      • Features
      • Installing OZ Scheduler
      • Scheduler Task
    • Binding & Exporting
      • Overview
      • Export API Example
        • Extract Input Data
        • Export with OZ Server
        • Export with Scheduler
        • Export with Scheduler Task
    • Repository Server
    • Sync Server
      • Overview
      • Installing Sync-Server
        • SSL configration
      • Sample Application
      • Implementation
    • QR Link Mobile Sign
  • 🌈Report Developer
    • Overview
      • About Course
      • Preparation
      • Report Designer Overview
    • Query Design
      • Database Connection
      • Designer Environment
      • Dataset Design
    • Report Design
      • Designer Environment
      • Components
      • Table
      • Master-Detail
      • ODI Parameter
      • CrossTab
      • Chart
  • 🌈MOBILE DEVELOPER
    • Android Native
    • iOS Native
    • TOTO Framework
      • TOTO Overview
      • Sample App Overview
      • Server Application
      • Android Project
  • ⬇️Product Downloads
  • 📚 Product Documentation
  • 📕Technical Guide
  • ⚛️ ReactJS Integration
Powered by GitBook
On this page
  • Overview
  • Events
  • Writing Script
  • Component Identifier
  • Referencing Component Object
  • Current component - This
  • Other components -This.GetComponentByName()
  • Other input components - This.GetInputComponent()
  • Methods
  • Global Methods
  • Component Methods
  • Viewer Parameters
  • Review and Edit Whole Scripts
  • Debugging

Was this helpful?

  1. 🌈e-Form DEVELOPER
  2. Day 3: Dynamic e-Form

e-Form Scripting Guide

Learn scripting concepts and basic knowledge

PreviousDay 3: Dynamic e-FormNextHands-on Practice

Last updated 3 months ago

Was this helpful?

Overview

  • Components raise various events at runtime according to their component type and processing steps.

  • Write scripts in events.

  • When an event is raised at runtime, the event script is executed.

  • e-Form API methods are used in the event script to control appearances and behaviors at runtime.

Events

Report event ( Rendering components / Binding data )

  • Events that are raised during the process of opening e-Form - starting and initializing the e-Form template, rendering components, and binding component with data,

  • OnStartUp, OnInitialize, OnStartBind, OnBind, OnEndBind, etc.

e-Form event ( Value change / User action )

  • Events that are raised when the user has changed the value of the input components or has done some action on the input components.

  • OnClick, OnValueChanged, OnFocus, OnCheckValidity, etc.

Key events by component

Event
Description

OnStartUp

Put viewer parameters to control component properties

OnInitialize

Component created

OnStartBind

Binding began

OnBind

Get data, bind it to component, set properties

OnEndBind

Get the page number, Get the component value.

OnFocus

Get focus

OnValueChanged

Data input or change

OnKillFocus

Loose focus

Functions

Contain global functions

OnCheckValidity

Form input validtion logic

Writing Script

Editor settings (Options dialog > Editor)

  • Use help tooltip

  • Tab size

Writing scripts in JavaScript Editor

  • Select a Component and Event

Component Identifier

Name and FormID must be unique.

Name

  • The default name consists of a component type and serial number.

  • Cannot contain the dot(.) character.

FormID

  • Used for some Input features (ex: make Lable work as Textbox)

  • Required for DialogueFlow

  • Allow dot(".") characters to represent array items (parent and child)

  • Take precedence over Name.

Referencing Component Object

Current component - This

  • The reserved word This references the current component object.

  • When typing in "This.", available functions for the chosen event are listed.

The <F1> key opens the manual page for the current function.

Other components -This.GetComponentByName()

Get the object of other components by its Name.

// OnInitialize of the Dummy band containing a label
var obj = This.GetComponentByName("label");
obj.SetBackgroundColor("lightgreen"); 

Other input components - This.GetInputComponent()

Get the object of other Input components by FormID or Name (FormID takes precedence)

// OnClick of a Button 
var obj = This.GetInputComponent("button");
obj.SetVisible(false); 

Methods

Global Methods

  • Not specific to any event and can be used globally

  • Start with an underscore('_').

Frequently used methods for debug:

  • _MessageBox

  • _TraceLn

Component Methods

  • Control property or data

Frequently used methods:

  • GetComponentByName

  • GetInputComponent

  • GetText

  • SetText

  • GetInputValue

  • SetInputValue

  • SetChecked

  • IsChecked

  • SetEnable

  • SetVisible

  • GetDatasetValue

Viewer Parameters

  • Viewer parameters control e-Form rendering options or viewer features.

  • Viewer parameters can be set both in the e-Form or from the application (HTML)

    • Set the default or invariable parameter values in the e-Form

    • Variable parameter values can be set from the application (HTML).

  • Use SetReportOption() in OnStartUp event of the ReportTemplate component.

// OnStartUp event of the ReportTemplate
This.SetReportOption("viewer.viewmode", "fittoframe"); // fit form into frame
This.SetReportOption("viewer.pagedisplay", "continuous"); // allow scroll down
This.SetReportOption("viewer.showthumbnail", "true"); // show thumbnail pages on the left pane
This.SetReportOption("eform.signpad_type", "dialog");  // dialog or direct
This.SetReportOption("comment.all", "true"); // enable highlighter pen
This.SetReportOption("information.debug", "true"); // show viewer console information on the web
This.SetReportOption("connection.alternativereportname", "forcs/common/company-header.ozr"); // path to the ozr file to be imported

Review and Edit Whole Scripts

  1. Right-click the ReportTemplate.

  2. Choose Preview Script.

Debugging

Opening Viewer Console

  1. Point anywhere on your e-Form opened by previewing or by the application.

  2. Hit the shortcut key <Ctrl+Shift+Z>.

Information provided

Tab
Description

Information

General information such as product versions

Debug

Debugging information such as Viewer execution environments and tracing log messages by _TraceLn() function.

Error

Errors occurred while running the e-Form.

All

Above all information is merged in the tab

For details on e-Form API, refer here or help manual by hitting the <h1> key.