Advanced condition editor

The editor does not require specifying the prefix "js:" " and will not display it in conditions. The prefix will be appended in the source automatically when changes are saved.

Introduction

The advanced condition editor is a special editor designed to streamline the work of the form designer. It has the following features:

  • syntax highlighting,

  • displaying suggestions for variable and field names while editing conditions,

  • displaying eximee API suggestions while editing conditions.

Illustration 1. Example conditions in the component property palette

Occurrences

Three component attributes in Eximee Designer use this editor. These are:

  • visibility condition,

  • activity condition,

  • requiredness condition.

Illustration 2. Advanced condition editor - editing the visibility condition

Syntax suggestions

The editor suggests eximee API elements and commonly used JS methods to the user. Editor suggestions can be seen by pressing Ctrl + Space. This will expand a list of items from which you can see the following:

Standard JS methods and fields:

  • parseInt()

  • parseFloat()

  • .length

  • size

  • empty

API provided by eximee:

  • getValue()

  • getData()

  • isVisible()

  • getStatementValue()

Illustration 3. Advanced condition editor - expanded list with syntax suggestions

In addition, suggestions will include component MIDs (with their ID in parentheses) and names of session variables appearing on the form.

Illustration 4. Advanced condition editor - view of suggestions for components located in the artifact
Illustration 5. Advanced condition editor - view of filtered component suggestions

Condition examples

// integer comparison of a TextField-type field
parseInt(getValue("GesTextField3"))>5
  
// floating-point comparison of a TextField-type field
parseFloat(getValue("GesTextField5"))<200.001
  
// logical value comparison (equal) of a CheckBox-type field
getValue("GesCheckbox1")=="true"
 
// logical value comparison (not equal) of a CheckBox-type field
getValue("GesCheckbox1")!="true"
 
// text value comparison of a RadioGroup-type field
getValue("GesRadioGroup1")=="audi"
  
// check whether a value, e.g. a session variable, is not empty
!!getValue("nazwiskoZew")
  
// check whether a value, e.g. a session variable, is empty
!getValue("nazwiskoZew")
  
// check whether the statement with MID oswiadczenie1 in the component with id GesStatementPopup1 has been accepted
getStatementItem("GesStatementPopup1","oswiadczenie1") == "true"
  
// check whether the statement with MID zdrowotne in the component with id GesStatementFlat5 (located in a composite component) has been accepted
getStatementItem("@GesStatementFlat5","zdrowotne")=="false"
 
 
// requiredness condition for a field if others are empty
!!!(getValue("@GesTextField13")||getValue("@GesTextField8"))
 
 
// check combobox values
getValue("@GesCombobox1")!=2&&getValue("@GesCombobox1")>0
 
 
// check whether TextField is visible
isVisible("@GesTextField1")=="true"
 
 
// check whether the number of characters in TextField is 10
getValue("GesTextField5").length==10

Last updated

Was this helpful?