Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Components are re-usable so you can have many instances of the same component with different settings for the custom fields each one has. You can add/remove and change custom fields for each component:

 Step1 - In the translator click on config.json to open and edit the custom fields.
 Step 2 - Add a test field and save.
 Step 3 - Commit these changes by pressing the commit button.

NOTE: If you do not want to commit these changes, you can change the Using Commit: to DEVELOPER, in the next step, so it will use the changes made in the translator without a commit.

 Step 4 - Exit the translator and change the commit to the new one or select Development mode

NOTE: If you do not want to commit these changes, you can change the Using Commit: to DEVELOPER so it will use the changes made in the translator without a commit.

Some more information:

 How does the Lua script get access to the fields

To get programatic access of the values of the custom fields, there is this api call:

local Fields = component.fields();

This returns a Lua table with the custom fields and their values for the component.

 Where are the custom field values defined for each component

<instance root>/IguanaX/configurations/fields/<component guid>.json

For example:

{
    "fields": {
        "Folder": "/Folder/",
        "Number": "1e3",
        "Password": "4E4D90C9F91E21FCD59F9F31D88F71FB",
        "Port": "64000",
        "String": "A String"
    }
}

 What is the format of config.json the definition for for the fields in each component

This is what the format looks like:

{
    "fields": [
        {
            "default": "/ff/",
            "name": "Folder",
            "type": "folder"
        },
        {
            "default": "fdsf",
            "name": "File",
            "type": "file"
        },
        {
            "default": "",
            "name": "String",
            "type": "string"
        },
        {
            "default": "1",
            "name": "Number",
            "type": "number"
        },
        {
            "default": "true",
            "name": "Boolean",
            "type": "bool"
        },
        {
            "default": "",
            "name": "Password",
            "type": "password"
        },
        {
            "default": "",
            "name": "Port",
            "type": "port"
        }
    ]
}

  • No labels