code: protected void nameHtmlControl(AbstractHtmlControlState state, ByRef javaScript)
              throws JspException
      {
          assert (javaScript != null) : "paramater 'javaScript' may not be null";
          assert (state != null) : "parameter 'state' may not be null";
          assert (_dataSource != null) : "dataSource is Null";
  
          // create the expression (name)
          String datasource = "{" + _dataSource + "}";
          state.name = applyNamingChain(datasource);
  
          Form parentForm = getNearestForm();
          String idScript = renderNameAndId((HttpServletRequest) pageContext.getRequest(), state, parentForm);
          if (idScript != null)
              javaScript.setRef(idScript);
      }
docs: This method will create the name of the form element (HTML Control) that has a name. The
  <b>name</b> attribute represent the "control name" for the control.  This name is scoped
  into the form element.  In addition, a control may have a <b>id</b> attribute which is
  specified by setting the <b>tagId</b>.  These two value are set in this routine.  The name
  is always the expression mapping the data to it's backing element and is conotrolled
  by the optional naming chain provided by the tag.  The <b>tagId</b> specifies the <b>id</b>
  attribute.  If this is present then we write out a JavaScript that allows mapping
  the tagId set on the tag to both the real <b>id</b> value and also the <b>name</b> value.
  The <b>id</b> is formed by passing the <b>tagId</b> to the URL rewritter service.
  @param state      The tag state structure.  This contains both the name and id attributes.  The
  id attribute should be set with the initial value from the tagId.
  @param javaScript A ByRef element that will contain any JavaScript that should be written out
  by the calling tag.  A value is returned only if tagId is set and there is not IScriptReporter
  found.
  @throws JspException Pass through the exception from applyNamingChain.