Closed codylerum closed 1 year ago
The <a>
element indeed requires an additional "identifying attribute" because there are multiple components available for it and it's with solely rendered
attribute not clear which one should be used. This is specified behavior. See also among others https://docs.oracle.com/javaee/7/tutorial/jsf-facelets009.htm#BABJADGH
I do however agree that it should at least default to a h:link with an empty outcome.
This is in turn not a Mojarra bug. This is a Faces feature. Move issue to https://github.com/jakartaee/faces/issues
@BalusC Could it not be treated as a simple html element (same as a div) if there is no identifying attributes which would make it an h:commandLink or h:link?
Wondering if it should be treated as just a standard html element if it can't determine which it should be. I think that would be less surprising behavior rather than potentially having an <a>
elemented rendered when it has a jsf:rendered="#{false}"
But maybe better discussed at https://github.com/jakartaee/faces/issues
Could it not be treated as a simple html element (same as a div) if there is no identifying attributes which would make it an h:commandLink or h:link?
<a>
cannot be an instance of UIPanel
. Among others, that wouldn't allow you to modify the outcome (or even the action .. just saying).
The following works fine in JSF 2.3
However if the element is an
<a>
then the jsf:rendered is not applied if the element does not have something like anjsf:outcome
orjsf:action
for example:Expected behavior
Would expect that the
jsf:rendered
attribute is applied to any html element. It appears that the<a>
element is being treated differently.<button>
which I would expect to be handle similarly as it also supports outcome and action, but is handled properly so this seems to only be an issue with the<a>
element.Environment JSF 2.3.17 Wildfly 26.0.1.Final
Additional context
I have not had a chance to test this on 4.0 as of yet.