1
0
-1

I have a fairly large group of checkboxes that I want to display in 2 columns, sorted alphabetically from top to bottom.

The checkboxes are in a mandatory block.

I didn't want to change the layout for each checkbox and drag them across manually. So I wrapped the first and second half of checkboxes in blocks, gave those a width of 6 and then put them side by side.

But now I cannot get past the mandatory error? Keeps telling me the [block name] is required even when I check all of them?

    CommentAdd your comment...

    3 answers

    1.  
      3
      2
      1

      Hi Lin,

      I think there is a way you can achieve what you want.

      1. Add a Mandatory Block to your form.  Un-check it's Mandatory checkbox.
      2. Add child blocks (not Mandatory Blocks) to the Mandatory Block, and add checkboxes to the child blocks until you get the layout you want.
      3. Add a Mandatory If... rule to the Mandatory block.  In the rule, put something like this:

             !(data.checkbox1 || data.checkbox2 || data.checkbox3 || data.checkbox4 || data.checkbox5 || data.checkbox6)

      This code is just a simple demo checking that at least one of the group has been clicked at least once.  You will want to use different logic depending on whether you show your checkboxes dynamically or not.


      1. Lin VanOevelen

        Thanks Bill. I'll get someone to try that out.

        It is still a shame it doesn't work without having to edit the mandatory rule because it does in Composer.

      2. Lin VanOevelen

        We tested this and that workaround does work.

      CommentAdd your comment...
    2.  
      1
      0
      -1

      Thanks Bill

      Your solution worked. It is time consuming with a significant number of check boxes in a container though and would be great to see a feature to set the number of columns and rows to the items appearance.

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi,

        I was able to reproduce this by having an outer mandatory block wrapping two inner non-mandatory blocks, with each inner block wrapping the checkbox columns.

        If I changed the two inner non-mandatory blocks to mandatory blocks, it worked, but enforced the mandatory rule for each column independently.  i.e. each mandatory block column needed to have one checkbox checked.

        To make it function correctly, I set all checkboxes to width 6, positioned them where I wanted in columns, and wrapped them in a single mandatory block.

        I'll check with the Maestro team to see if this behavior is as expected.

        1. Lin VanOevelen

          Hi Bill,

          I know I can manually drag them across, but it would be really nice if there was an easier way to do this because occasionally forms may have a large number of checkboxes in a mandatory group. So setting all of them to width 6 is time consuming and you then also have to figure out their new order if you want them alphabetically sorted from top to bottom in each column (as opposed to zig-zag sorting).

          Cheers,

          Lin

        2. Lin VanOevelen

          Can this possibly be logged as a feature request?

          In the meantime we will have to write our own business rules for some of these scenarios as sometimes we have to add other fields to mandatory checkbox blocks (when selecting a checkbox triggers showing another checkbox group for example) and we cannot avoid using blocks inside them.

        CommentAdd your comment...