Which tag to use to hide content in JSF

When I want to hide some content in JSF, which tag is created for this purpose? There are several tags that can do this work:

<f:subview rendered="#{...condition...}" />

and

<c:when test="#{...conditon...}" />

What is the right option to use?

+3
source share
2 answers
<ui:remove>

Have a look here: http://www.jsftoolbox.com/documentation/facelets/10-TagReference/facelets-ui-remove.html

UPDATE

If you want to conditionally hide some content, you can use

<h:panelGroup rendered="#{...condition...}">

It is displayed as <span>, you can also add an attributelayout="block"

<h:panelGroup rendered="#{...condition...}" layout="block">

to make it like that <div>.

0
source

in JSF, use renderedis the best approach.

JSTL, <c:when>, , JSF, , ViewScope. JSF (, ui:repeat c:forEach)

+2

Source: https://habr.com/ru/post/1760734/


All Articles