Search code examples
orbeonxforms

Orbeon - how to get or set checkboxes


I have a simple questio: how to get/set checkbox from checkboxes in orbeon?

Something like this: /myCheckboxes[value="itemVal"].isChecked()


Solution

  • That's right, the values are space-separated. To extract them, instead of contains() use this to check if value 42 is included:

    tokenize(../myCheckboxGroup, '\s+') = '42'
    

    This splits the value on spaces with the \s+ regexp and returns a string sequence.

    By the way you don't need to write:

    if (condition) true() else false()
    

    You can always just write:

    condition