initForm(this.flc, this, ureq);
}
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FormLayoutContainer mainLayout = FormLayoutContainer.createHorizontalFormLayout("mainLayout", getTranslator());
formLayout.add(mainLayout);
int size = lstGroups.size();
String[] keys = new String[size+2];
String[] values = new String[size+2];
// all option
keys[0] = CHOICE_ALL;
values[0] = translate(CHOICE_ALL);
// others option
int count = 1;
if(isAdmin) {
keys[1] = CHOICE_OTHERS;
values[1] = translate(CHOICE_OTHERS);
count++;
}
// the groups
for(int i = 0; i < size; i++) {
keys[i+count] = lstGroups.get(i).getName();
values[i+count] = lstGroups.get(i).getName();
}
groupChoice = new SingleSelectionImpl("cl.choice.groups", SingleSelectionImpl.createSelectboxLayouter("cl.choice.groups"));
groupChoice = uifactory.addDropdownSingleselect("cl.choice.groups", "cl.choice.groups", mainLayout, keys, values, null);
groupChoice.addActionListener(this, FormEvent.ONCHANGE);
groupChoice.select(CHOICE_ALL, true);
exportButton = new FormLinkImpl(EXPORT_TABLE, EXPORT_TABLE, EXPORT_TABLE, Link.BUTTON);
mainLayout.add(exportButton);
}