Dear Support,

When i am using a checkboxes and code was ran. I would like to see a checked checkbox, not a empty checkbox by default.

How can i set the checkbox Checked.true ?

I used this code: 

FormRowSet f = new FormRowSet();

f.setMultiRow(true);

FormRow r1 = new FormRow();

r1.put(FormUtil.PROPERTY_VALUE, "OK");

r1.put(FormUtil.PROPERTY_LABEL, "OK");

f.add(r1);

Thx.

  • No labels

9 Comments

  1. Hi Miklos Daru,

    You can set your default value from the property called "Value" which you can find it under "Label" of check box's properties. Separate your value with (;) if multiple value need to be set.

    Regards,

    Owen

    1. Dear Owen Ong,

      Thank you reply but i don't want to use a multi value, it was not my problem but thx for your answer.

      My probelem is: 

      I look this checkbox list default:

      I want to see this check box list( I would like to the program checked automaticaly the checkbox list when the list comes up):

      I using beanshell plugin only with checkbox because i select the labels and values from database. What is a command which i can set this property?

      Thx.

      1. Hi Miklos Daru,

        Thank you pointing this out. We feel that this is a quite important feature needed in production as well. We will add it to the public repository shortly.

        But, just for your information, we have no plan for any new release in the near future due to some other considerations. So, what you can do is to grab the source from the public repository after it is available instead of waiting for a new release.

        Will update you later.

        Regards,

        Owen

  2. Hi Miklos Daru,

    After you grab the latest source code from public repo, you should be able to set the checked by following

    FormRowSet f = new FormRowSet();
    f.setMultiRow(true);
    FormRow r1 = new FormRow();
    r1.put(FormUtil.PROPERTY_VALUE, "OK");
    r1.put(FormUtil.PROPERTY_LABEL, "OK");
    r1.put(FormUtil.PROPERTY_SELECTED, "true");
    f.add(r1);
    1. Owen Ong,

      Thank you very much.

    2. Dear Owen Ong,

      Sorry, but not working this code. I copy the code what i would like to use.

      import org.joget.apps.form.model.*;
      import org.joget.apps.form.service.*;
      import java.sql.*;
      import org.apache.commons.collections.SequencedHashMap;
      import java.util.*;
          FormRowSet f = new FormRowSet();
          f.setMultiRow(true);
                  FormRow r1 = new FormRow();
                  r1.put(FormUtil.PROPERTY_VALUE, "OK");
                  r1.put(FormUtil.PROPERTY_LABEL, "OK");
                  r1.put(FormUtil.PROPERTY_SELECTED, "true");
                  f.add(r1);
      return f;
      Can i wrong something or not import something? i wrote this code to the beanshell form binder. I'm using Joget v3 beta and full version but not working this PROPERTY :(

      If I delete this row: r1.put(FormUtil.PROPERTY_SELECTED, "true");

      I see a good label but the box is empty not checked :(

      Thank you. I waiting for your help.

      1. Hi Miklos Daru,

        You required to update your copy of Joget Workflow to get that feature to work correctly. Because we no release any new version yet. The fastest way that you can get this feature working is to grab the source code from our public repository and build it by your own.

        Please refer to this V3 Building From Source on how to done it.

        Hope it's help.

        Regards,

        Owen

        1. Dear Owen Ong,

          Sorry a lot of question but is very important for us.

          We are making V3 Building From Source step by step. The system is running correctly, but the PROPERTY_SELECTED not working yet. 

          We would like to know we are making well the process and the joget will updated.

          What change we can see in the joget? (If we were making well.)

          How can we check? ex. "log file" or "system settings" or "file.sys"?

          What feature we can see?

          We are using LINUX.

          Regards,

          Miklós

          1. Hi there,

            This might have something to your cache in your tomcat. Please try to clear all the cache first after deploying the newly built war file. I have just tried it with the exact code you gave and it works.

            Hope this helps.