I know this question got ask over and over. I did like suggested in all the issues regarding this and I did what BalusC in this question that I put
told me and I haven`t succeeded yet. So the flow of the web app is:
I login, when successful the boolean loggedIn becomes true and the page gets redirected to home.xhtml. (The beans TestBean and EnterView are instantiated and SessionScoped). In this page I got 4 links if the loggedIn boolean is true.
To not use the JSTL c:choose tags (because of the JSTL and JSF "one runs during view build time, the other runs during view render time." - BalusC) I used the rendered attribute.
The list with the links appear but I have to click them twice to do the action it should.
The snippet:
<h:form rendered="#{enterView.userBean.loggedIn}">
<ul id="grileList">
<li><h:commandLink action="#{menuView.showTestsPage(1)}"
value="label1" rendered="#{enterView.userBean.loggedIn}"/></li>
<li><h:commandLink action="#{menuView.showTestsPage(2)}"
value="label2" rendered="#{enterView.userBean.loggedIn}"/></li>
<li><h:commandLink action="#{menuView.showTestsPage(3)}"
value="label3" rendered="#{enterView.userBean.loggedIn}"/></li>
<li><h:commandLink action="#{menView.showTestsPage(4)}"
value="label4" rendered="#{enterView.userBean.loggedIn}"/></li>
</ul>
</h:form>
The h:form it is rendered correctly so it has gone through the view rendered phase, but it doesn't do the actions when I click the links (just when I click them twice) so it is the view build time??? I read about both of them , I thought I understood...
I have put the rendered attribute in the commandLinks to try to render them, but I haven't succeeed.