Search

User Manual

GETTING STARTED


MODULES AND PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


GLOSSARY


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support
SDK Documentation
SDK Examples

ALL USER MANUAL VERSIONS

Ignition 8.1
Ignition 7.9
Ignition 7.8

Deprecated Pages

Skip to end of metadata
Go to start of metadata

The following feature is new in Ignition version 8.0.3
Click here to check out the other new features
This function is used by Ignition's Expression language.

Description

The expression function urlEncode() enables users to create an HTTP binding's URL on the fly. It will be possible to freely bind different URL path parameters to different component properties on a view or window.

The first argument is the string that's being encoded, second parameter is a boolean arg that controls whether you use query parameter style escaping or URI fragment style escaping.

Syntax

urlEncode(string, [usePercentEscape])

  • Parameters

string url- The URL to encode.

bool usePercentEscape - Optional. False or black indicates to use query parameter style escaping. True indicates to use URI fragment style escaping.

  • Results

string- The encoded URL.

Examples
Code Snippet
urlEncode("Hello World")   //yields "Hello+World"
Code Snippet
urlEncode("Hello World", False)  //yields "Hello+World"
Code Snippet
urlEncode("Hello World", True)  //yields "Hello%20World"

Example

Vision Example

  1. Drag a Text Field component and a Label component onto a window.
  2. In the Vision Property Editor, enter a parameter for the URL you'll use. For this example, we used 'Hello World.'
  3. Select the Label component, then click on the Binding icon for the label's Text property.
  4. On the Property Binding screen, select Expression.
  5. Enter the expression in the Configure Expression Binding section. In the example, we entered the URL plus the expression function, "urlEncode ()". We entered the oath to the Text Field's text property as the string.

    Code Snippet
    "https://inductiveuniversity.com/" + urlEncode({Root Container.Text Field 1.text})



  6. Alternatively, you can get the path for the text field by putting the cursor inside the parentheses, clicking the Property Value icon, then selecting the text property from the Text Field component.
  7. Click OK to save the binding.The encoded URL is now displayed in the Label component.

Example

Perspective Example

  1. Drag a Text Field component and a Label component onto a view.
  2. In the Perspective Property Editor, enter a parameter for the URL you'll use. For this example, we used 'Hello World.'
  3. Select the Label component, then click on the Binding  icon for the label's Text property.
  4. On the Property Binding screen, select Expression.
  5. Enter the expression in the Configure Expression Binding section. In the example, we entered the URL plus the expression function, "urlEncode ()". We entered the oath to the Text Field's text property as the string and the parameter "True" to use URI fragment style escaping.

    Code Snippet
    "https://inductiveuniversity.com/" + urlEncode({../TextField_0.props.text}, True)



  6. Alternatively, you can get the path for the text field by putting the cursor inside the parentheses, clicking the Property Value icon, then selecting the text property from the Text Field component.

  7. Click OK to save the binding.The encoded URL is now displayed in the Label component.


  • No labels