Example #1
0
 static void assignDataIfNull(Object selectItem) {
   UISelectItem uiSelectItem = (UISelectItem) selectItem;
   if (uiSelectItem.getItemValue() == null) {
     if (uiSelectItem.getItemLabel() != null) {
       uiSelectItem.setItemValue(uiSelectItem.getItemLabel());
     }
   }
   if (uiSelectItem.getItemLabel() == null) {
     if (uiSelectItem.getItemValue() != null) {
       uiSelectItem.setItemLabel(uiSelectItem.getItemValue().toString());
     }
   }
 }
Example #2
0
 private HtmlSelectOneMenu buildSelectBox(String[] opts, CustomButtonNode parent) {
   HtmlSelectOneMenu newMenu = new HtmlSelectOneMenu();
   for (int a = 0; a < opts.length; a++) {
     UISelectItem item = new UISelectItem();
     item.setItemValue(opts[a]);
     newMenu.getChildren().add(item);
   }
   newMenu.setStyle("margin-left:" + (parent.getOffset() + 5) + "px;");
   newMenu.addValueChangeListener(
       new ValueChangeListener() {
         public void processValueChange(ValueChangeEvent e) throws AbortProcessingException {
           valueChanged(e);
         }
       });
   newMenu.setPartialSubmit(true);
   return newMenu;
 }
Example #3
0
 private static UISelectItem newUISelectItem(Object value) {
   UISelectItem item = new UISelectItem();
   item.setItemValue(value);
   item.setItemLabel(value.toString());
   return item;
 }