# Advanced condition editor

{% hint style="info" %}
The editor does not require entering the prefix "**js:"** and it will not display it in conditions. The prefix will be added in the source automatically when saving changes.
{% endhint %}

## Introduction

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

* syntax highlighting,
* displaying hints for variable and field names while editing conditions,
* displaying eximee API hints while editing conditions.

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2FmETG15vbI4zoi572JY0P%2Fimage.png?alt=media&#x26;token=bdde05b7-a52d-4489-aa26-f2d5bd98ff56" alt=""><figcaption><p><em><strong>Figure 1.</strong> Example conditions in the component properties palette</em></p></figcaption></figure>

## Occurrence locations <a href="#zaawansowanyedytorwarunkow-miejscawystapienia" id="zaawansowanyedytorwarunkow-miejscawystapienia"></a>

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

* visibility condition,
* activity condition,
* required condition.

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2F52zBTvRCbwWxpmXqnAXm%2Fimage.png?alt=media&#x26;token=416100e1-2783-4b42-b07a-cec84916dabe" alt=""><figcaption><p><em><strong>Figure 2.</strong> Advanced condition editor - editing the visibility condition</em></p></figcaption></figure>

## Syntax hints <a href="#zaawansowanyedytorwarunkow-podpowiadanieskladni" id="zaawansowanyedytorwarunkow-podpowiadanieskladni"></a>

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

Standard JS methods and fields:

* parseInt()
* parseFloat()
* .length
* size
* empty

API provided by eximee:

* getValue()
* getData()
* isVisible()
* getStatementValue()

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2FlCh0Hq1CgW7xgu2iJ6Je%2Fimage.png?alt=media&#x26;token=c318b360-d984-4bfc-b86e-a25e3276ca25" alt=""><figcaption><p><em><strong>Figure 3.</strong> Advanced condition editor - expanded list with syntax hints</em></p></figcaption></figure>

\
Additionally, the hints will include component MIDs (with their ID in parentheses) and the names of session variables present in the application.

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2Fq1A348C1AqakwWgdIAL1%2Fimage.png?alt=media&#x26;token=8fb252bb-19a6-48ce-9d2a-7a858bdafb76" alt=""><figcaption><p><em><strong>Figure 4.</strong> Advanced condition editor - component hint view for components located in the artifact</em></p></figcaption></figure>

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2FDFAEqMYCMmD2Uf7i2sxc%2Fimage.png?alt=media&#x26;token=ada8d9e5-0622-48c2-ac9f-847767cddaa7" alt=""><figcaption><p><em><strong>Figure 5.</strong> Advanced condition editor - filtered component hint view</em></p></figcaption></figure>

## Condition examples <a href="#zaawansowanyedytorwarunkow-przykladywarunkow" id="zaawansowanyedytorwarunkow-przykladywarunkow"></a>

```javascript
// integer comparison of a TextField field
parseInt(getValue("GesTextField3"))>5
  
// floating-point comparison of a TextField field
parseFloat(getValue("GesTextField5"))<200.001
  
// boolean comparison (equal) of a CheckBox field
getValue("GesCheckbox1")=="true"
 
// boolean comparison (different) of a CheckBox field
getValue("GesCheckbox1")!="true"
 
// text comparison of a RadioGroup field
getValue("GesRadioGroup1")=="audi"
  
// check whether the value, e.g. a session variable, is not empty
!!getValue("nazwiskoZew")
  
// check whether the 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"
 
 
// required condition for a field if others are empty
!!!(getValue("@GesTextField13")||getValue("@GesTextField8"))
 
 
// checking combobox values
getValue("@GesCombobox1")!=2&&getValue("@GesCombobox1")>0
 
 
// checking whether the TextField is visible
isVisible("@GesTextField1")=="true"
 
 
// check whether the number of characters in the TextField is 10
getValue("GesTextField5").length==10

```
