Font Size:
Ask Joget AI

BeanShell Display Column

Introduction

BeanShell Display Column allows BeanShell integration in a List, which allows you to write custom Java code to create custom displays.

How does it work?

To add a BeanShell Display Column in a List follow the steps below:

  1. It can be found in a List labeled BeanShell under the Display Column


    Not to be confused with BeanShell Action.
  2. Drag and drop into the List, and click on it to configure it.

Configure Settings

Configure BeanShell Display Column

When configuring the Beanshell Display Column, you will see the following menu on the right side.

Configure the following properties:

  • Label: A custom label for the BeanShell Display Column element. The default value is "BeanShell".
  • ID: The ID of the BeanShell Display Column element.
  • Script: Custom script in Java. Contains Injected Variables - DataListDisplayColumn column, DataList datalist, Object row & int index

Usage examples

You can use the BeanShell Display Column for different cases. such as:

  1. Display a custom string: Input return "flower"; in the Script field.

    The runtime will show the following.

  2. Display Number Row in Roman Numerals: Input the code block below in the Script field.

    int decimalNumber = index + 1;
     
    int[] values = {1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1};
    String[] romanLetters = {"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"};
     
    StringBuilder romanNumber = new StringBuilder();
     
    for(int i = 0; i < values.length; i++){ 
        while(decimalNumber >= values[i]){
            decimalNumber = decimalNumber - values[i];
            romanNumber.append(romanLetters[i]);
        }
    }
     
    return romanNumber;

    The runtime will show the following.

  3. Display Number Row with Conditional Prefix: Input the code block below in the Script field.

    int rowNumber = index + 1;
     
    int determinant = rowNumber % 2;
     
    if (determinant == 0){
        return "Even " + rowNumber;
    }
    else if (determinant != 0){
        return "Odd " + rowNumber;
    }
    else{
        return "Error";
    }

    The runtime will show the following.

Created by Aadrian Last modified by Debanraj Ravindran on Apr 24, 2026