myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Graeme Steyn (JIRA)" <>
Subject [jira] Created: (TRINIDAD-123) Client side validation: <tr:selectOneRadio>
Date Wed, 25 Jul 2007 10:42:32 GMT
Client side validation: <tr:selectOneRadio>

                 Key: TRINIDAD-123
             Project: MyFaces Trinidad
          Issue Type: Bug
          Components: Components
    Affects Versions: 1.2.1-core
         Environment: Facelets 1.1.12 or JSP 2.1; SUn Java System Application Server 9.0 Ur
1 Patch 03; JDK 1.6.0_01; JSF RI 1.2_04-b16-p02
            Reporter: Graeme Steyn
            Priority: Minor

Clientside validation does not work for the tr:selectOneRadio component. If the component
is marked as required and no selection is made, then you do not get an error when attempting
to navigate to the next page. No validation message occurs and as the post back is aborted
due to the JavaScript error. There is no visual indication for the problem other than simple
remaining on the same page when clicking the next button. The problem is reproducable using
the following jspx: 

<?xml version='1.0' encoding='windows-1252'?> <jsp:root
xmlns:jsp="" version="2.1"
  <jsp:output omit-xml-declaration="true" doctype-root-element="html"
              doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
  < contentType="text/html;charset=windows-1252"/>
      <trh:head title="Dialog">
        <meta http-equiv="Content-Type"
              content="text/html; charset=windows-1252"/>

                label="Yes" />
                label="No" />


          <tr:panelButtonBar id="pageNav">
              text="continue" />


Issue appears to be related to the function _multiValidate in common-1.2.1.js.  In particular,
the ID for the radio button does not appear to be set correctly in the failureArray.  In the
code below value ="" and on 4743 is undefined.  The required error string in
4744 is however, correct.  Later manipulate of the error message then fails as the id does
not match "undefined".  This is based on initial observation using FireBug and could well
be wrong.

4734  var value=_getValue(currInput);
4735  var required=validators[i+1];
4736  if(required&&((value=="")||(value==null)))
4737  {
4738  requiredFormatIndex=validators[i+2];
4739  var requiredErrorString=_getErrorString(currInput,
4740  requiredFormatIndex);
4741  if(requiredErrorString)
4742  {
4743  failureArray[failureArray.length];
4744  failureArray[failureArray.length]=requiredErrorString;
4745  requiredErrorString=_getGlobalErrorString(currInput,
4746  globalMessageIndex,
4747  requiredErrorString,
4748  label);
4749  failures+='\n'+requiredErrorString;
4750  }

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message