/** * {@inheritDoc} * @see SubmittableElement#reset() */ @Override public void reset() { if (defaultCheckedState_) { setAttribute("checked", "checked"); } else { removeAttribute("checked"); } }
/** * {@inheritDoc} * @see SubmittableElement#reset() */ @Override public void reset() { if (defaultCheckedState_) { setAttribute("checked", "checked"); } else { removeAttribute("checked"); } }
/** * {@inheritDoc} * @see SubmittableElement#reset() */ @Override public void reset() { if (defaultCheckedState_) { setAttribute("checked", "checked"); } else { removeAttribute("checked"); } }
/** * Selects the specified radio button in the form. Only a radio button that is actually contained * in the form can be selected. * * @param radioButtonInput the radio button to select */ void setCheckedRadioButton(final HtmlRadioButtonInput radioButtonInput) { if (!isAncestorOf(radioButtonInput) && !lostChildren_.contains(radioButtonInput)) { throw new IllegalArgumentException("HtmlRadioButtonInput is not child of this HtmlForm"); } final List<HtmlRadioButtonInput> radios = getRadioButtonsByName(radioButtonInput.getNameAttribute()); for (final HtmlRadioButtonInput input : radios) { if (input == radioButtonInput) { input.setAttribute("checked", "checked"); } else { input.removeAttribute("checked"); } } }
/** * Selects the specified radio button in the form. Only a radio button that is actually contained * in the form can be selected. * * @param radioButtonInput the radio button to select */ void setCheckedRadioButton(final HtmlRadioButtonInput radioButtonInput) { if (!isAncestorOf(radioButtonInput) && !lostChildren_.contains(radioButtonInput)) { throw new IllegalArgumentException("HtmlRadioButtonInput is not child of this HtmlForm"); } final List<HtmlRadioButtonInput> radios = getRadioButtonsByName(radioButtonInput.getNameAttribute()); for (final HtmlRadioButtonInput input : radios) { if (input == radioButtonInput) { input.setAttribute("checked", "checked"); } else { input.removeAttribute("checked"); } } }
/** * Selects the specified radio button in the form. Only a radio button that is actually contained * in the form can be selected. * * @param radioButtonInput the radio button to select */ void setCheckedRadioButton(final HtmlRadioButtonInput radioButtonInput) { if (!isAncestorOf(radioButtonInput) && !lostChildren_.contains(radioButtonInput)) { throw new IllegalArgumentException("HtmlRadioButtonInput is not child of this HtmlForm"); } final List<HtmlRadioButtonInput> radios = getRadioButtonsByName(radioButtonInput.getNameAttribute()); for (final HtmlRadioButtonInput input : radios) { if (input == radioButtonInput) { input.setAttribute("checked", "checked"); } else { input.removeAttribute("checked"); } } }
/** * Select the specified radio button in the page (outside any <form>). * * @param radioButtonInput the radio Button */ @SuppressWarnings("unchecked") void setCheckedRadioButton(final HtmlRadioButtonInput radioButtonInput) { // May be done in single XPath search? final List<HtmlRadioButtonInput> pageInputs = getByXPath("//input[lower-case(@type)='radio' " + "and @name='" + radioButtonInput.getNameAttribute() + "']"); final List<HtmlRadioButtonInput> formInputs = getByXPath("//form//input[lower-case(@type)='radio' " + "and @name='" + radioButtonInput.getNameAttribute() + "']"); pageInputs.removeAll(formInputs); for (final HtmlRadioButtonInput input : pageInputs) { if (input == radioButtonInput) { input.setAttribute("checked", "checked"); } else { input.removeAttribute("checked"); } } }
/** * Select the specified radio button in the page (outside any <form>). * * @param radioButtonInput the radio Button */ @SuppressWarnings("unchecked") void setCheckedRadioButton(final HtmlRadioButtonInput radioButtonInput) { // May be done in single XPath search? final List<HtmlRadioButtonInput> pageInputs = getByXPath("//input[lower-case(@type)='radio' " + "and @name='" + radioButtonInput.getNameAttribute() + "']"); final List<HtmlRadioButtonInput> formInputs = getByXPath("//form//input[lower-case(@type)='radio' " + "and @name='" + radioButtonInput.getNameAttribute() + "']"); pageInputs.removeAll(formInputs); for (final HtmlRadioButtonInput input : pageInputs) { if (input == radioButtonInput) { input.setAttribute("checked", "checked"); } else { input.removeAttribute("checked"); } } }
/** * Select the specified radio button in the page (outside any <form>). * * @param radioButtonInput the radio Button */ @SuppressWarnings("unchecked") void setCheckedRadioButton(final HtmlRadioButtonInput radioButtonInput) { // May be done in single XPath search? final List<HtmlRadioButtonInput> pageInputs = (List<HtmlRadioButtonInput>) getByXPath("//input[lower-case(@type)='radio' " + "and @name='" + radioButtonInput.getNameAttribute() + "']"); final List<HtmlRadioButtonInput> formInputs = (List<HtmlRadioButtonInput>) getByXPath("//form//input[lower-case(@type)='radio' " + "and @name='" + radioButtonInput.getNameAttribute() + "']"); pageInputs.removeAll(formInputs); for (final HtmlRadioButtonInput input : pageInputs) { if (input == radioButtonInput) { input.setAttribute("checked", "checked"); } else { input.removeAttribute("checked"); } } }
removeAttribute("checked");
removeAttribute("checked");