How to fill a select/combobox, radiolist, checkboxlist

Last updated 9 days ago

3 ways to fill a dropdown, radiolist or checkboxlist using java, query or a setup page for adding items

Fig. 1 of the Select

1. Java

Combo snippet
/*----#start-code(packages_import)----*/
import java.util.LinkedHashMap;
import static nosi.core.i18n.Translator.gt;
/*----#end-code----*/
/*----#start-code(index)----*/
LinkedHashMap<String, String> targets = new LinkedHashMap<>();
targets.put(null, gt("-- Selecionar --"));
targets.put("_self", gt("Mesma página"));
targets.put("_blank", gt("Popup"));
targets.put("_newtab", gt("New tab"));
view.tag.setValue(targets);
/*----#end-code----*/

2. SQL

Combo query fill snippet
2 example
#1 EXAMPLE:
/*----#start-code(index)----*/
view.clients.setQuery(Core.query(null,"SELECT id as ID, name as NAME")
.from("tbl_customer0")
.union()
.select(" 'id' as ID, 'designationName' as NAME ")
.from("tbl_customer1")
.unionAll()
.select(" 'id' as ID, 'firstName' as NAME")
.from("tbl_customer2")
);
/*----#end-code----*/
#2 EXAMPLE:
/*----#start-code(index)----*/
view.tag.setQuery(Core.query(null,
"SELECT '' as ID, '-- Selecionar --' as NAME union
SELECT '_self' as ID, 'Mesma contpágina' as NAME union
SELECT '_blank' as ID,'Popup' as NAME union
SELECT '_newtab' as ID, 'New tab' as NAME"));
/*----#end-code----*/

3. Domain manager page

Domain manager in IGRP studio:

  1. Add domain

  2. Select the domain

  3. Edit name/value