by Joget, Inc.
FREE
280
DESCRIPTION

A Beanshell Hash Variable Plugin provides a way to add an "if-else" condition when using hash variables to display in a form or userview.

This plugin is for Joget Enterprise v5 users only. Joget v6 & higher already have this feature built-in.

For example, if you type this:

        "Welcome #currentUser.username#",

in a Form CustomHTML or Userview, it works fine if  the user is logged in to Joget.

However, if he is not logged in, it will display as:

        "Welcome ,"

 

Here are the steps to use the Beanshell Hash Variable:

  1. Create a new environment variable, example "welcome".
  2. Paste this script into the "welcome" value field:

    if (username != null && username.length == 1 && !username[0].isEmpty()) {
           return "Welcome " + username[0] + ",";
    } else {
           return "";
    }

  3. Save the environment variable record.
  4. Add this into the userview header field:
    "#beanshell.welcome[username={currentUser.username?url}]?html#"
  5. Save the userview, publish your app and run the userview to view.
  6. If you are logged in, your userview will display the welcome and your username. If you are not logged in, it will not display anything in the userview header.

 

Steps To Import This Plugin

  1. Click "Download" on this plugin screen (It will be a .jar file).
  2. Go to your Joget localhost or server, in Joget Console navigate to "Admin Bar>Systems Settings>Manage Plugins" and click "Upload Plugins" button.
  3. In "Upload Plugin", select the plugin .jar file you just downloaded, then click "Upload".
  4. Depending on the plugin type, you can now view your new plugin in your form or datalist or userview.
  5. Remember to always uninstall the old plugin before uploading a new version.
  6. The Joget Knowledge Base has more information on managing and developing plugins.

 

Additional Plugin Information

November 4, 2015
FREE
265
v5.0.0
Developer Info
Joget, Inc.
Write a review
Reviews
Print