[ htmlunit-Bugs-1587962 ] setChecked outside <form> element

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ htmlunit-Bugs-1587962 ] setChecked outside <form> element

SourceForge.net
Bugs item #1587962, was opened at 2006-10-31 15:12
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1587962&group_id=47038

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: 1.8
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Martin Jansa (jamae)
Assigned to: Nobody/Anonymous (nobody)
Summary: setChecked outside <form> element

Initial Comment:
If <input type="radio"... appears outside any <form>
element and some javascript code wants to set checked
property, it leads to code:

public void setChecked( final boolean isChecked ) {
  final HtmlForm form = getEnclosingForm();
  final boolean changed = isChecked() != isChecked;

  if( isChecked ) {
    try {
      form.setCheckedRadioButton( getNameAttribute(),
getValueAttribute() );
    }
    catch( final ElementNotFoundException e ) {
      // Shouldn't be possible
      throw new IllegalStateException("Can't find this
element when going up to the form and back down.");
    }
  }

And "final HtmlForm form = getEnclosingForm();"
returns null, than whole javascript ends with
NullPointerException.

At least there should be used getEnclosingFormOrDie
function. And maybe input fields outside form could be
allowed.

Thanks

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1587962&group_id=47038

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop