Skip to main content
1-Visitor
August 23, 2016
Question

Multiple-selection list box

  • August 23, 2016
  • 1 reply
  • 5983 views

Hello,

In my ACL script, I need to create a dialog box to include multiple check boxes so users can select either one or more items from it.  Unfortunately I wouldn't be able to know those items ahead of time.  I'll have to open a SGML/XML file and collect all the possible selections, then create multiple check boxes for it.  Because of that, I went back to Arbortext online help to see if any other alternatives could fit my needs.  So the list_response() command was found.  But it seems to support single-selection list box only, not multiple-selection one.  Could anyone help me on it?

Sincerely,

Jing

1 reply

18-Opal
August 23, 2016

Hi Jing--

If there will only a few items in your list, you might be able to get by with a readvar command, something like this:

function test() {

  local foo, bar, baz;

  # for readvar, the -choice option with only one choice gives a checkbox

  readvar -prompt "Choose" -choice "foo" foo -choice "bar" bar -choice "baz" baz;

  # checked items will return 1, unchecked will return 0

  response("foo: $foo; bar: $bar; baz: $baz");

}

The readvar command above will display a dialog like this:

readvar.png

Of course, in your case you would need to construct the "readvar" command string dynamically based on what you find in your document. If it's a long list, the command might end up being too long, or your list might make a dialog too big to fit on the screen.

In that case, you will probably need to resort to making a simple XUI dialog, for example with a combobox, where the listitems in the combobox are dynamically generated using ACL code. (Comboboxes can be configured to be multi-select, where users choose multiple entries by ctrl-clicking.) You could also make a XUI dialog that is basically empty, and have your ACL code dynamically add separate checkboxes for each of the choices you found in the document.

--Clay

jchang-21-VisitorAuthor
1-Visitor
August 23, 2016

Hello Clay,

Thank you very much for your prompt help!

In my other ACL script, I used XUI dialog box for the items that had been determined ahead of time.  But for the dynamic items (e.g. file #1 could have "A", "B", and "C" items and file #2 could have "D", and "E"), it seems to be a little challenging!  That's why I'd like to find other alternatives.  BTW, I always used readvar() for radio button, and didn't realize that it could be used for check box too!   Thanks again for the tip you sent to me.  I really appreciate it.

Best,

Jing