Joget DX Beta Available for Download

Check out Joget DX, the next generation successor to Joget Workflow for faster, simpler digital transformation.

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: grid design, as it was really unclear


Code Block
import org.joget.apps.form.model.*;
import org.joget.apps.form.lib.*;
import org.joget.apps.form.service.*;
import java.sql.*;
import org.apache.commons.collections.SequencedHashMap;
import java.util.*;
import org.joget.commons.util.UuidGenerator;

public FormRowSet getGridRows() {
	return rows ; // this will return the grid rows

public saveGridRows(FormRowSet rows) {
	con = DriverManager.getConnection("jdbc:mysql://localhost:3307/jwdb?characterEncoding=UTF-8", "database username", "database password");

		String recordId = "";

		// If you need to query data from different table(s) and process it before saving it to database,
		// you can do it here

		UuidGenerator uuid = UuidGenerator.getInstance();

		Iterator i= rows.iterator(); // Iterating grid rows
		while (i.hasNext()) {
			FormRow row = (FormRow);
			String gridColumn1 = row.get("gridColumn1"); // reading grid column value
			String gridColumn2 = row.get("gridColumn2");
			String gridColumn3 = row.get("gridColumn3");
			String pId = uuid.getUuid(); // generating Primary Key
			String insertSql = "INSERT INTO table(id,col1,col2,col3) VALUES(?,?,?,?)";
			PreparedStatement stmtInsert = con.prepareStatement(insertSql);
			stmtInsert.setString(1, pId);
			stmtInsert.setString(2, gridColumn1);
			stmtInsert.setString(3, gridColumn2);
			stmtInsert.setString(4, gridColumn3);
	} else {
		System.out.println("Connection Problem");

FormRowSet rows = getGridRows(); // getting the grid rows
saveGridRows(rows); // processing & storing the grid rows

Grid Design

Correct Grid design should look like this:

Image Added


part of load binder beanshell script :

Code Block
FormRowSet f = new FormRowSet();
FormRow r1 = new FormRow();
r1.put("gridColumn1", your_value);
r1.put("gridColumn2", your_value);
r1.put("gridColumn3", your_value);