Exemplo n.º 1
0
 // returns the current value pair contained in the panelgroup
 public String getCurrentPanelChildValue(int childIndex) {
   Object obj = currentPanel.getChildren().get(childIndex);
   String returnStr = "";
   if (obj instanceof HtmlSelectOneMenu) {
     HtmlSelectOneMenu menu = (HtmlSelectOneMenu) obj;
     returnStr = menu.getValue().toString();
   } else if (obj instanceof HtmlInputText) {
     HtmlInputText text = (HtmlInputText) obj;
     returnStr = text.getValue().toString();
   } else if (obj instanceof HtmlOutputText) {
     HtmlOutputText text = (HtmlOutputText) obj;
     returnStr = text.getValue().toString();
   }
   return returnStr;
 }
Exemplo n.º 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;
 }