I'm trying to implement a composite component which either displays the information details of a user in plain text or displays them through editable input texts fields if the desired details are those of the user currently connected.
I know that al UI Components can be rendered via the rendered attribute but what about the ones which are not UI Components (for example divs)
<div class = "userDetails" rendered = "#{cc.attrs.value.id != sessionController.authUser.id}">
Name: #{cc.attrs.value.name}
Details: #{cc.attrs.value.details}
</div>
<div class = "userDetails" rendered = "#{cc.attrs.value.id == sessionController.authUser.id}">
<h:form>
...
</h:form>
</div>
I know that the div doesn't have the rendered attribute and probably I'm not taknig the right approach at all. I could very easily use an JSTL tag but I want to avoid that.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…