name
to <h:commandButton />
and NetBeans correctly was identifying that there is an issue with that.Fortunately, some of these attributes were passing through to the underlying page without needing
p:passthrough
. However, you should not rely on such functionality to work. If the VDL Document does not show it as an attribute, you shouldn't expect it to work.
Alright, so how do we do it correctly?
There is no magic here. It is simply a matter of adding the attribute with a prefix of
p:
, for example p:name="someName"
for the name
attribute. This will result in the attribute being passed through the rendered and added to the resulting output.So I have an example, and the resulting output.
The resulting output will run the JavaScript associated with the passed through attributes, or set the CSS styling. Very simple and easy to implement.