Search in sources :

Example 1 with Select

use of org.akaza.openclinica.web.pform.dto.Select in project OpenClinica by OpenClinica.

the class SelectWidget method getUserControl.

@Override
public UserControl getUserControl() {
    Select select = new Select();
    Label label = new Label();
    label.setLabel(itemFormMetadataBean.getLeftItemText());
    select.setLabel(label);
    // Hint hint = new Hint();
    // hint.setHint(item.getItemMeta().getLeftItemText());
    // select.setHint(hint);
    select.setRef("/" + version.getOid() + "/" + itemGroupBean.getOid() + "/" + item.getOid());
    select.setAppearance(appearance);
    ArrayList<Item> itemList = new ArrayList<Item>();
    select.setItem(itemList);
    ArrayList<ResponseOptionBean> options = itemFormMetadataBean.getResponseSet().getOptions();
    for (ResponseOptionBean option : options) {
        Item item = new Item();
        Label itemLabel = new Label();
        itemLabel.setLabel(option.getText());
        item.setValue(option.getValue());
        item.setLabel(itemLabel);
        itemList.add(item);
    }
    return select;
}
Also used : Item(org.akaza.openclinica.web.pform.dto.Item) Select(org.akaza.openclinica.web.pform.dto.Select) Label(org.akaza.openclinica.web.pform.dto.Label) ArrayList(java.util.ArrayList) ResponseOptionBean(org.akaza.openclinica.bean.submit.ResponseOptionBean)

Aggregations

ArrayList (java.util.ArrayList)1 ResponseOptionBean (org.akaza.openclinica.bean.submit.ResponseOptionBean)1 Item (org.akaza.openclinica.web.pform.dto.Item)1 Label (org.akaza.openclinica.web.pform.dto.Label)1 Select (org.akaza.openclinica.web.pform.dto.Select)1