I have a login composite component that looks like this:

<composite:interface>...</composite:interface>
...
<composite:implementation>
              <script type="text/javascript">
                function checkForm(form) {
                  var name = form['#{cc.clientId}:name'].value;
                  var pwd = form['#{cc.clientId}:password'].value;
                      
                  if (name == "" || pwd == "") {
                    alert("Please enter name and password.");
                    return false;
                  }
                  return true;
                }
            </script>
  ...
</composite:implementation>

I have components with "name" and "password" component ids in a form in the ... part of the implementation. That works fine.

However, if I pull the JS out into its own file, and do this:

<composite:interface>...</composite:interface>
..
<composite:implementation>
  <h:outputScript library="components/login" name="login.js"/>
  ...
</composite:implementation>

h:outputScript puts the JS in the page, but the JS no longer works because the expression cc.clientId evaluates to an empty string.

That's a bug, is it not?


david