1
0
-1

Hi Joget Team,

Currently in a form, I am using a multi page element.

The configuration is 1 main table for the main form, and different child tables for each of the multi page.

I enabled the "Partially Store Form When Page Changed?" and "Validate When Change Page" in the multi page properties.


In page 1 (Event Details), there is a select box for Package ID.

In page 2 (Package Details), there is a non-editable form grid where I am supposed to auto-populate it based on value of the Package ID using the form grid load bean shell.


The problem now is I am unable to get the value of Package ID in the form grid load bean shell.

I have tried the following:

  1. Copy the Package ID value to a hidden field to the main table using JavaScript.
  2. Upon clicking to page 2, I've copied the Package ID value from the main hidden field to another hidden field in page 2 using JavaScript.
  3. In the form grid load bean shell, I've used the following code to get the Package ID value from the hidden field in page 2 but the log remains blank.

        //get field 1 value from form data object
        String field1Id = "package_id";
        Form form = FormUtil.findRootForm(element);
        Element field1 = FormUtil.findElement(field1Id, form, formData);
    
        if (field1 != null) {
            //get value of field 1
            String packageId = FormUtil.getElementPropertyValue(field1, formData);
            LogUtil.info("Package ID", packageId);
        }
  4. I tried to put a default value in the hidden field in page 2 and I am able to get value in the log. So I am suspecting that the Form Grid loads the same time or before step 2 hidden field copy is completed.

I'm not sure if I can use hash variables as I have no idea how to tie the main id to get the Package ID.

The reason for user selecting Package ID in Page 1 is due to it's business logic with some other fields.

I did entertain the idea to combine both page 1 and page 2 but I need to do a date validation against an existing table before proceeding to add other Package details.

Can anyone please advice me how to solve this problem?

Your help is greatly appreciated.

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi, if you already enabled the "Partially Store Form When Page Changed?" option, then the value of the Package ID should already be in the database once you submit the first page. Try to validate this by checking the database after submission. If this is the case, then the second form should be able to directly access that value since it's already there.

        CommentAdd your comment...