HtmlCheckBoxInput checkbox = (HtmlCheckBoxInput) page.getElementById("cb4"); checkbox.setAttribute("checked", "checked"); checkbox.fireEvent(Event.TYPE_CHANGE); page.refresh(); System.out.println(page.asXml());
/** * {@inheritDoc} */ @Override public Page setChecked(final boolean isChecked) { if (isChecked) { setAttribute("checked", "checked"); } else { removeAttribute("checked"); } return executeOnChangeHandlerIfAppropriate(this); }
/** * {@inheritDoc} */ @Override public Page setChecked(final boolean isChecked) { if (isChecked) { setAttribute("checked", "checked"); } else { removeAttribute("checked"); } return executeOnChangeHandlerIfAppropriate(this); }
/** * {@inheritDoc} */ @Override public Page setChecked(final boolean isChecked) { if (isChecked) { setAttribute("checked", "checked"); } else { removeAttribute("checked"); } return executeOnChangeHandlerIfAppropriate(this); }
/** * Creates an instance. * If no value is specified, it is set to "on" as browsers do (e.g. IE6 and Mozilla 1.7) * even if spec says that it is not allowed * (<a href="http://www.w3.org/TR/REC-html40/interact/forms.html#adef-value-INPUT">W3C</a>). * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes the initial attributes */ HtmlCheckBoxInput(final String namespaceURI, final String qualifiedName, final SgmlPage page, final Map<String, DomAttr> attributes) { super(namespaceURI, qualifiedName, page, attributes); //From the checkbox creator defaultCheckedState_ = hasAttribute("checked"); // default value for both IE6 and Mozilla 1.7 even if spec says it is unspecified if (getAttribute("value") == ATTRIBUTE_NOT_DEFINED) { setAttribute("value", "on"); } }
/** * Creates an instance. * If no value is specified, it is set to "on" as browsers do (e.g. IE6 and Mozilla 1.7) * even if spec says that it is not allowed * (<a href="http://www.w3.org/TR/REC-html40/interact/forms.html#adef-value-INPUT">W3C</a>). * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes the initial attributes */ HtmlCheckBoxInput(final String namespaceURI, final String qualifiedName, final SgmlPage page, final Map<String, DomAttr> attributes) { super(namespaceURI, qualifiedName, page, attributes); //From the checkbox creator defaultCheckedState_ = hasAttribute("checked"); // default value for both IE6 and Mozilla 1.7 even if spec says it is unspecified if (getAttribute("value") == ATTRIBUTE_NOT_DEFINED) { setAttribute("value", "on"); } }
/** * Creates an instance. * If no value is specified, it is set to "on" as browsers do (e.g. IE6 and Mozilla 1.7) * even if spec says that it is not allowed * (<a href="http://www.w3.org/TR/REC-html40/interact/forms.html#adef-value-INPUT">W3C</a>). * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes the initial attributes */ HtmlCheckBoxInput(final String namespaceURI, final String qualifiedName, final SgmlPage page, final Map<String, DomAttr> attributes) { super(namespaceURI, qualifiedName, page, attributes); //From the checkbox creator defaultCheckedState_ = hasAttribute("checked"); // default value for both IE6 and Mozilla 1.7 even if spec says it is unspecified if (getAttribute("value") == ATTRIBUTE_NOT_DEFINED) { setAttribute("value", "on"); } }