Hello,
I would like for my rendered <input> tag to have the "name" attribute explicitly set to some value for example: "email" without any colon of course.
I understand the clientID is rendered as the "name" attribute. My question is then: how do I set the clientID of my inputText (preferably from the facelets code)?
Thanks in advance for your help,
Julien.
The name of the component is composed for the form_name:component_name, if for some reason this does not work for you, you can remove the form name and the colon setting the prependId attribute of the form to false like this:
Regards
Cesar
When a dream is ending because to come true - OCPJP 6,7. OCE JPA EE6. MCTS
The internal name (seen by JavaScript) of a JSF component ID is always going to contain those colons and higher-level qualifiers.
That's because certain JSF components act as naming containers which simply means that IDs within the naming container - for example, the form - must be unique, but the ID itself does not need to be unique globally in the view. JSF knows how to find the appropriate component using a simple ID, but JavaScript (client-side code) doesn't, which is why JavaScript must reference the fully-qualified ID, which includes the IDs of its surrounding naming container(s).
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.