Skip to content

esferatec/ec-luart-validationmanager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

ec-luart-validationmanager

The project is a validation management module written in Lua. It defines a ValidationManager object that handles validation of widgets in LuaRT desktop applications.

LuaRT 2.1.0

Features

The project provides a modular and flexible way to manage validation in desktop applications. It allows easy addition of widgets and their corresponding validation rule, as well as applying the error message. Several validation managers can be used in one application.

Installation

  1. Create a folder called "ecluart" in your application.
  2. Copy the "vm.lua" file into this folder.
[application]
|
|----ecluart
|   |
|   |----vm.lua
|   |----...
|
|----app.wlua

Usage

The validation manager (vm) can be loaded using the function require():

local vm = require("ecluart.vm") 

Constructor

ValidationManager() -> object

Initializes a new validation manager instance.

Method - add

ValidationManager:add(widget: object, property: string, rule: function, message: string) -> none

Adds a widget, widget property, validation rule and error message.

Method - validate

ValidationManager:validate() -> none

Performs validation checks for each widget.

License

Copyright (c) 2023 by esferatec. It is open source, released under the MIT License. See full copyright notice in the LICENSE.md file.

About

virtual validation manager for LuaRT

Topics

Resources

License

Stars

Watchers

Forks

Languages