0

When I try to put more values into a checkboxgroup. It looks like in the picture. I would like to devide this all values two by two.

First 2 at the first line. Second 2 at the next line...up to how many values I have.

I tried dojo and all css then I couldn't find the way out :(

`

Screenshot of checkboxgroup

Regards
Cumhur Ata

MSU_Bulldog
  • 3,501
  • 5
  • 37
  • 73
Cumhur Ata
  • 809
  • 6
  • 18

3 Answers3

2

The answer is similar to changing the layout for Radio Button Groups or Combo Boxes. See this question for using individual components rather than the group component.

The other option is to use a custom renderer. That question has a link to another StackOverflow question covering it, or you can look at the answer by Tim Tripcony to this question or this XSnippet which uses a custom renderer to remove table tags from Radio Button Groups. All will give you the basics, then it's a case of identifying the correct Java class for the component (the Java code for your XPage in the Local folder in Package Explorer may tell you that) and creating the relevant HTML output, inserting the using a for loop to create a new table cell and row where appropriate.

Although the renderer for the core CheckBox is not open sourced yet, the renderer for the DojoCheckbox and DojoFormWidget (which it extends) are open source.

Community
  • 1
  • 1
Paul Stephen Withers
  • 15,699
  • 1
  • 15
  • 33
  • not quite, at least AFAIK: radios and combos are much easier to handle as they only store single / exclusive values; checkbox groups however need to be able to store multiple values in a single Notes field which I think cannot be done with seperate checkbox controls; see my related question here: http://stackoverflow.com/questions/35700091/can-we-bind-multiple-checkbox-controls-to-a-single-domino-data-field - I'd be more than happy though if you could prove me wrong ;) – Lothar Mueller Mar 02 '16 at 16:56
2

This OpenNTF project may provide what you need (Lothar as well!). I came across it via Stephan's blog post. I've not tried and, because GBS are no longer providing hosting for BleedYellow, the original blog post by Brian (I think "Moore") is no longer available.

If it works, it may be a candidate for someone to include in XPages Extension Library.

Paul Stephen Withers
  • 15,699
  • 1
  • 15
  • 33
  • many thanks, looks very promising ;) - Nevertheless I'll try to find a solution going the custom renderer way, as soon as I'll find the time – Lothar Mueller Mar 03 '16 at 09:48
  • The custom renderer way would be the best practice. Feel free to post to XSnippets if you make progress and, longer term, once the ComboBoxGroup and other core components are open sourced later this year, it would be a great addition to the Extension Library. – Paul Stephen Withers Mar 03 '16 at 10:28
0

You won't be able to do that straight away as this control is rendered as a static <table>; if you choose horizontal layout you'll end up with a single <tr> containing as many <td> elements as there are select items in your control; with vertical layout it'll be many <tr> elements with a single <td> each. AFAIK there's no direct means of influencing the number of <tr> and <td> elements.

Only solution I'm aware of is creating a custom renderer as is mentioned here or here

Community
  • 1
  • 1
Lothar Mueller
  • 2,528
  • 1
  • 16
  • 29