Stateful EJS

About This Space

A simple Demo of how to deploy EJS templates from a stateful Node.js script


Last updated on July 31, 2019

Public Permissions:   View   Open/Fork   Run   Comment  

Stateful EJS Template

This simple template demonstrates the use of EJS in a stateful environment. EJS stands for Embedded JavaScript templating. For more information, visit http://ejs.co.

Statefulness

This app uses a stateful top-down paradigm, meaning that when a screen is displayed, the Node.js code is paused to wait for the user's input. In a stateful program, EJS screens can intermingle with Rich Display screens built using the Visual Designer tool.

Strongly typed fields

This app uses strongly typed fields and the pjs.define() API.

At its core, JavaScript is a loosely typed language, which means you do not have to declare the data types of variables explicitly. JavaScript variables assume a data type based on the content that is placed in them.

However, for business applications, being able to explicitly specify a data type can be extremely useful. For example, you may want to strongly type an amount field, so that it can only hold numeric data with a specific precision (length and decimal positions). In a business application, putting character data into an amount field should raise an exception.

API

  • pjs.define() - Define a strongly typed field
  • pjs.display() - Display content from an EJS template and wait for the user to respond

Be the first to comment:      

Comments

Write Preview Markdown: bold italic code link
Post

Filters:

Popular Recent

Application for adding, viewing, updating, and searching posts relating to a specific project.

2599

0

A demo of how to build, test and consume APIs

6249

0

0

MatUI light/dark auto-themeing.

7298

0

0

Optionally downloads the Material Icons and Material Symbols font files, @fontface rules files, and a JSON object for use with Profound UI's `pui.customIconList` configuration.

6400

0

0

Optionally downloads the Material Icons and Material Symbols font files, @fontface rules files, and a JSON object for use with Profound UI's `pui.customIconList` configuration.

7387

0

0

This is an example for a few ways you could set up a grid to be able to scroll/have any row at the top of a grid.

22156

0

1

Mat UI - Solarized Dracula Scheme

7548

0

0

6888

0

0

7644

0

0

7391

0

0

i80

7734

0

0

Mat UI - Solarized Color Scheme

7374

0

0