public Object coerceToBean(Object val, Component comp) { //save return val != null ? ((Radio) val).getValue() : null; } }
private boolean checkInOut(String data) { String inout = piece(data, ";", 2); String opt = (String) rgInOut.getSelectedItem().getValue(); return opt.contains(inout); }
public Object coerceToUi(Object val, Component comp) { //load if (val != null) { //iterate to find the selected radio via the value for (Iterator it = comp.getChildren().iterator(); it.hasNext();) { final Component child = (Component) it.next(); if (child instanceof Radio) { if (val.equals(((Radio) child).getValue())) { return child; } } else if (!(child instanceof Radiogroup)) { //skip nested radiogroup //bug 2464484 final Object value = coerceToUi(val, child); //recursive if (value != null) { return value; } } } } return null; }
public Object coerceToBean(Object val, Component comp, BindContext ctx) { if (val != null) { final ListModel<?> model = ((Radio) val).getRadiogroup().getModel(); if (model != null && !(model instanceof Selectable)) { throw new UiException("model doesn't implement Selectable"); } if (model != null) { Set<?> selection = ((Selectable<?>) model).getSelection(); if (selection == null || selection.size() == 0) return null; return selection.iterator().next(); } else { //no model return ((Radio) val).getValue(); } } return null; } }
if (val.equals(radio.getValue())) { return radio;
public void onClick$btnOK() { clearMessages(); Radio radio = rgReason.getSelectedItem(); String reasonCode = radio == null ? null : (String) radio.getValue(); if (reasonCode == null) { Clients.wrongValue(rgReason, "You must select a reason for the deletion."); return; } String reasonText = "3".equals(reasonCode) ? txtOther.getText().trim() : null; if (reasonText != null && reasonText.isEmpty()) { Clients.wrongValue(txtOther, "Please enter text describing the reason for the deletion."); return; } try { service.delete(record, reasonCode, reasonText); } catch (Exception e) { PromptDialog.showError(e.getMessage()); return; } root.setAttribute("ok", true); root.detach(); } }
public void onClick$btnSearch() { String text = txtSearch.getValue().trim(); boolean synonym = rgrpLookupMode.getSelectedIndex() == 1; FMDate date = new FMDate(datSearch.getValue()); Long max = (Long) rgrpMaxResults.getSelectedItem().getValue(); String[] filters = getSelectedSubsets(); List<TermMatch> matches = TermUtil.lookupSCT(text, synonym, date, max, filters); TreeNode<Object> rootNode = new DefaultTreeNode<>(null, null, false); buildModel(rootNode, matches); DefaultTreeModel<Object> model = new DefaultTreeModel<>(rootNode); treeSearch.setModel(model); }
if (nci.getValue() == null) //template might set it nci.setValue(data); item.setAttribute(Attributes.MODEL_RENDERAS, nci);
if (nr.getValue() == null) //template might set it nr.setValue(data);