private String[] getSelectedOptions(HtmlSelect sel) { String[] result = new String[sel.getSelectedOptions().size()]; int i = 0; for (HtmlOption opt : sel.getSelectedOptions()) { result[i++] = opt.getValueAttribute(); } return result; }
/** * {@inheritDoc} * @see SubmittableElement#setDefaultValue(String) */ @Override public String getDefaultValue() { final List<HtmlOption> options = getSelectedOptions(); if (options.size() > 0) { return options.get(0).getValueAttribute(); } return ""; }
/** * Returns the value of the {@code selectedIndex} property. * @return the selectedIndex property */ public int getSelectedIndex() { final List<HtmlOption> selectedOptions = getSelectedOptions(); if (selectedOptions.isEmpty()) { return -1; } final List<HtmlOption> allOptions = getOptions(); return allOptions.indexOf(selectedOptions.get(0)); }
/** * {@inheritDoc} * @see SubmittableElement#setDefaultValue(String) */ public String getDefaultValue() { final List<HtmlOption> options = getSelectedOptions(); if (options.size() > 0) { return options.get(0).getValueAttribute(); } return ""; }
/** * {@inheritDoc} * @see SubmittableElement#setDefaultValue(String) */ public String getDefaultValue() { final List<HtmlOption> options = getSelectedOptions(); if (options.size() > 0) { return options.get(0).getValueAttribute(); } return ""; }
/** * {@inheritDoc} * @see SubmittableElement#setDefaultValue(String) */ public String getDefaultValue() { final List<HtmlOption> options = getSelectedOptions(); if (options.size() > 0) { return options.get(0).getValueAttribute(); } return ""; }
/** * {@inheritDoc} * @see SubmittableElement#setDefaultValue(String) */ @Override public String getDefaultValue() { final List<HtmlOption> options = getSelectedOptions(); if (options.size() > 0) { return options.get(0).getValueAttribute(); } return ""; }
/** * Returns the value of the {@code selectedIndex} property. * @return the selectedIndex property */ public int getSelectedIndex() { final List<HtmlOption> selectedOptions = getSelectedOptions(); if (selectedOptions.isEmpty()) { return -1; } final List<HtmlOption> allOptions = getOptions(); return allOptions.indexOf(selectedOptions.get(0)); }
/** * Returns the value of the "selectedIndex" property. * @return the selectedIndex property */ public int jsxGet_selectedIndex() { final HtmlSelect htmlSelect = getHtmlSelect(); final List<HtmlOption> selectedOptions = htmlSelect.getSelectedOptions(); if (selectedOptions.isEmpty()) { return -1; } final List<HtmlOption> allOptions = htmlSelect.getOptions(); return allOptions.indexOf(selectedOptions.get(0)); }
/** * Returns the value of the "selectedIndex" property. * @return the selectedIndex property */ public int jsxGet_selectedIndex() { final HtmlSelect htmlSelect = getHtmlSelect(); final List<HtmlOption> selectedOptions = htmlSelect.getSelectedOptions(); if (selectedOptions.isEmpty()) { return -1; } final List<HtmlOption> allOptions = htmlSelect.getOptions(); return allOptions.indexOf(selectedOptions.get(0)); }
/** * Returns the value of the "selectedIndex" property. * @return the selectedIndex property */ public int jsxGet_selectedIndex() { final HtmlSelect htmlSelect = getHtmlSelect(); final List<HtmlOption> selectedOptions = htmlSelect.getSelectedOptions(); if (selectedOptions.isEmpty()) { return -1; } final List<HtmlOption> allOptions = htmlSelect.getOptions(); return allOptions.indexOf(selectedOptions.get(0)); }
/** * Returns the actual value of the selected Option. * @return the value */ @Override public String getValue() { final HtmlSelect htmlSelect = getHtmlSelect(); final List<HtmlOption> selectedOptions = htmlSelect.getSelectedOptions(); if (selectedOptions.isEmpty()) { return ""; } return ((HTMLOptionElement) selectedOptions.get(0).getScriptableObject()).getValue(); }
/** * Returns the actual value of the selected Option. * @return the value */ @Override public String jsxGet_value() { final HtmlSelect htmlSelect = getHtmlSelect(); final List<HtmlOption> selectedOptions = htmlSelect.getSelectedOptions(); if (selectedOptions.isEmpty()) { return ""; } return ((HTMLOptionElement) selectedOptions.get(0).getScriptObject()).jsxGet_value(); }
/** * Returns the actual value of the selected Option. * @return the value */ @Override public String jsxGet_value() { final HtmlSelect htmlSelect = getHtmlSelect(); final List<HtmlOption> selectedOptions = htmlSelect.getSelectedOptions(); if (selectedOptions.isEmpty()) { return ""; } return ((HTMLOptionElement) selectedOptions.get(0).getScriptObject()).jsxGet_value(); }
/** * Returns the actual value of the selected Option. * @return the value */ @Override public String getValue() { final HtmlSelect htmlSelect = getHtmlSelect(); final List<HtmlOption> selectedOptions = htmlSelect.getSelectedOptions(); if (selectedOptions.isEmpty()) { return ""; } return ((HTMLOptionElement) selectedOptions.get(0).getScriptableObject()).getValue(); }
/** * Returns the actual value of the selected Option. * @return the value */ @Override public String jsxGet_value() { final HtmlSelect htmlSelect = getHtmlSelect(); final List<HtmlOption> selectedOptions = htmlSelect.getSelectedOptions(); if (selectedOptions.isEmpty()) { return ""; } return ((HTMLOptionElement) selectedOptions.get(0).getScriptObject()).jsxGet_value(); }
/** * {@inheritDoc} */ public NameValuePair[] getSubmitKeyValuePairs() { final String name = getNameAttribute(); final List<HtmlOption> selectedOptions = getSelectedOptions(); final NameValuePair[] pairs = new NameValuePair[selectedOptions.size()]; int i = 0; for (final HtmlOption option : selectedOptions) { pairs[i++] = new NameValuePair(name, option.getValueAttribute()); } return pairs; }
/** * {@inheritDoc} */ @Override public NameValuePair[] getSubmitNameValuePairs() { final String name = getNameAttribute(); final List<HtmlOption> selectedOptions = getSelectedOptions(); final NameValuePair[] pairs = new NameValuePair[selectedOptions.size()]; int i = 0; for (final HtmlOption option : selectedOptions) { pairs[i++] = new NameValuePair(name, option.getValueAttribute()); } return pairs; }
/** * {@inheritDoc} */ public NameValuePair[] getSubmitKeyValuePairs() { final String name = getNameAttribute(); final List<HtmlOption> selectedOptions = getSelectedOptions(); final NameValuePair[] pairs = new NameValuePair[selectedOptions.size()]; int i = 0; for (final HtmlOption option : selectedOptions) { pairs[i++] = new NameValuePair(name, option.getValueAttribute()); } return pairs; }
/** * {@inheritDoc} */ public NameValuePair[] getSubmitKeyValuePairs() { final String name = getNameAttribute(); final List<HtmlOption> selectedOptions = getSelectedOptions(); final NameValuePair[] pairs = new NameValuePair[selectedOptions.size()]; int i = 0; for (final HtmlOption option : selectedOptions) { pairs[i++] = new NameValuePair(name, option.getValueAttribute()); } return pairs; }