Recent Changes - Search:

Start

(back to index)    (edit this in the feed-back web form)

Title
Input validation feature request

 

Type
Feature_request

 

Raised by
cleon

 

Date opened
Thursday, 19 November 2009

 

Description
Let’s say I have a simulation with an editable velocity, and that I as simulation creater also want an upper limit to the entered velocity.

 

The end user may be playing around with the velocity, examining a region of special interest, perhaps a critical point.

 

Currently I program simulations as follows: in the Variables table I create two variables: ‘velocityInput’ and ‘velocity’. What the end user actually edits is the value of ‘velocityInput’, I code the subsequent action code to propagate that to the value of ‘velocity’.

 

In the action code I code an ‘if then’: if the user entered value is outside the criterium then the user entered value is rejected (notifying the end user with the ‘_alert()’ method.)

 

As far as I know EJS first flushes the existing velocity value and replaces it with the user entered value, and then proceeds to execute the action code.
If I would not subdivide into ‘velocityInput’ and ‘velocity’ then a rejection of a user entered value would result in overall loss of the last entered value, and EJS would have to fall back on the default value.

 

Importance
1

 

Proposed solution
The Feature request:

To have in the Element properties of text fields:
- A cell and/or dialog window to enter an expression (in Java syntax) that evaluates to a Boolean, for acceptance or rejection of the user entered value.
- A cell and/or dialog window to enter the text to be displayed by the _alert() method upon rejection.
- To have as default that if the user entered value is rejected the pre-existing value is re-instated.

 

This would make the Variables table cleaner, and the validation of the end user input would then be handled separately, and not by the action code.

 

Urgency
1

 

Status
Open

 

Resolution

(back)
« 00041 · Edit Form · 00043 »

Edit - History - Print - Recent Changes - Search
Page last modified on November 20, 2009, at 12:12 AM