}
List fl = idiv.addList("choicesList", "form", "choices-lookup");
fl.setHead(T_results);
// the <select> tag, and param values
Item selectItem = fl.addItem("select", "choices-lookup");
Select s = selectItem.addSelect("chooser", "choices-lookup");
s.setSize(ConfigurationManager.getIntProperty("xmlui.lookup.select.size", 12));
// parameters for javascript
Hidden h = selectItem.addHidden("paramField");
h.setValue(field);
h = selectItem.addHidden("paramValue");
h.setValue(value);
h = selectItem.addHidden("paramIsName");
h.setValue(String.valueOf(isName));
h = selectItem.addHidden("paramIsRepeating");
h.setValue(String.valueOf(isRepeating));
h = selectItem.addHidden("paramValueInput");
h.setValue(valueInput);
h = selectItem.addHidden("paramAuthorityInput");
h.setValue(authorityInput);
h = selectItem.addHidden("paramStart");
h.setValue(String.valueOf(start));
h = selectItem.addHidden("paramLimit");
h.setValue(String.valueOf(limit));
h = selectItem.addHidden("paramFormID");
h.setValue(formID);
h = selectItem.addHidden("paramConfIndicatorID");
h.setValue(confIndicatorID);
h = selectItem.addHidden("paramFail");
h.setValue(T_fail);
boolean isClosed = ChoiceAuthorityManager.getManager().isClosed(field);
h = selectItem.addHidden("paramIsClosed");
h.setValue(String.valueOf(isClosed));
h = selectItem.addHidden("paramCollection");
h.setValue(String.valueOf(collection));
if (!isClosed)
{
h = selectItem.addHidden("paramNonAuthority");
if (isFieldMessage(field, "nonauthority"))
{
h.setValue(getFieldMessage(field, "nonauthority"));
}
else
{
h.setValue(getFieldLabel(field, "nonauthority"));
}
}
h = selectItem.addHidden("contextPath");
h.setValue(contextPath);
// NOTE: the "spinner" indicator image gets added in the XSLT.
// the text input(s)
Item ti = fl.addItem("textFields", "choices-lookup");
Composite textItem = ti.addComposite("textFieldsComp", "choices-lookup");
Text t1 = textItem.addText("text1", "choices-lookup");
if (isName)
{
Text t2 = textItem.addText("text2", "choices-lookup");
DCPersonName dp = new DCPersonName(value);
t1.setValue(dp.getLastName());
t2.setValue(dp.getFirstNames());
if (isFieldMessage(field, "help.last"))
{
Message m = getFieldMessage(field, "help.last");
t1.setLabel(m);
t1.setHelp(m);
}
else
{
String m = getFieldLabel(field, "help.last");
t1.setLabel(m);
t1.setHelp(m);
}
if (isFieldMessage(field, "help.first"))
{
Message m = getFieldMessage(field, "help.first");
t2.setLabel(m);
t2.setHelp(m);
}
else
{
String m = getFieldLabel(field, "help.first");
t2.setLabel(m);
t2.setHelp(m);
}
}
else
{
t1.setValue(value);
if (isFieldMessage(field, "help"))
{
Message m = getFieldMessage(field, "help");
t1.setLabel(m);
t1.setHelp(m);
}
else
{
String m = getFieldLabel(field, "help");
t1.setLabel(m);
t1.setHelp(m);
}
}
// confirmation buttons
Item buttItem = fl.addItem("confirmation", "choices-lookup");
Button accept = buttItem.addButton("accept", "choices-lookup");
accept.setValue(isRepeating ? T_add : T_accept);
Button more = buttItem.addButton("more", "choices-lookup");
more.setValue(T_more);
Button cancel = buttItem.addButton("cancel", "choices-lookup");
cancel.setValue(T_cancel);
}