]> git.mxchange.org Git - jjobs-war.git/commitdiff
I know, I miss-use ui:fragment here but it seems to do what I want:
authorRoland Haeder <roland@mxchange.org>
Tue, 11 Apr 2017 09:13:48 +0000 (11:13 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 11 Apr 2017 09:13:48 +0000 (11:13 +0200)
- when "rendered" is false, don't show content of the whole tag
- when "rendered" is true, show content of the whole tag

So far, other tags did not work and not even with ui:define and then rendered="#{featureController.isFeatureEnaled('some_feature')#}"
on ui:define.

As long as there is no other tag that has the same behavior, I stick
with ui:fragment.

web/guest/user/user_register.xhtml
web/index.xhtml

index f15aed72dc5bbc22f4d1cfcc9e901d17b86fee23..17c6ad479d36ca6cda9e01e326af687162fc3ef9 100644 (file)
@@ -16,8 +16,8 @@
                        <h:outputText value="#{msg.CONTENT_TITLE_USER_REGISTER}" />
                </ui:define>
 
-               <ui:define name="content" rendered="#{not featureController.isFeatureEnabled('user_registration_in_index')}">
-                       <ui:fragment rendered="#{featureController.isFeatureEnabled('user_registration')}">
+               <ui:define name="content">
+                       <ui:fragment rendered="#{not featureController.isFeatureEnabled('user_registration_in_index') and featureController.isFeatureEnabled('user_registration')}">
                                <ui:fragment rendered="#{featureController.isFeatureEnabled('user_name_required')}">
                                        <div class="para">
                                                <h:outputText value="#{msg.GUEST_ALREADY_USER_CONTINUE_LOGIN_1}" />
                                        <ui:param name="styleClass" value="errors" />
                                </ui:include>
                        </ui:fragment>
-               </ui:define>
 
-               <ui:define name="content" rendered="#{featureController.isFeatureEnabled('user_registration_in_index')}">
+                       <ui:fragment rendered="#{featureController.isFeatureEnabled('user_registration_in_index')}">
                                <ui:include src="/WEB-INF/templates/generic/message_box.tpl">
                                        <ui:param name="message" value="#{msg.ERROR_GUEST_REGISTRATION_IN_INDEX_ENABLED}" />
                                        <ui:param name="styleClass" value="errors" />
                                </ui:include>
+                       </ui:fragment>
                </ui:define>
        </ui:composition>
 </html>
index 07457c26c396ea74ad06974126ffcc529cee80be..8273fa14895a7b804ed5a421965ab835a3ad2814 100644 (file)
                        <h:outputText value="#{msg.CONTENT_TITLE_INDEX_WELCOME}" />
                </ui:define>
 
-               <ui:define name="content" rendered="#{featureController.isFeatureEnabled('user_registration_in_index')}">
-                       <div class="registration_form">
-                               <ui:fragment rendered="#{featureController.isFeatureEnabled('user_register_multiple_page')}">
-                                       <ui:include src="/WEB-INF/templates/guest/user/register/guest_form_register_page1.tpl" />
-                               </ui:fragment>
-                       </div>
+               <ui:define name="content">
+                       <ui:fragment rendered="#{featureController.isFeatureEnabled('user_registration_in_index')}">
+                               <div class="registration_form">
+                                       <ui:fragment rendered="#{featureController.isFeatureEnabled('user_register_multiple_page')}">
+                                               <ui:include src="/WEB-INF/templates/guest/user/register/guest_form_register_page1.tpl" />
+                                       </ui:fragment>
+                               </div>
 
-                       <div class="para">
-                               <h:outputText value="#{msg.CONTENT_PAGE_INDEX_PARA3}" />
-                       </div>
-               </ui:define>
+                               <div class="para">
+                                       <h:outputText value="#{msg.CONTENT_PAGE_INDEX_PARA3}" />
+                               </div>
+                       </ui:fragment>
 
-               <ui:define name="content" rendered="#{not featureController.isFeatureEnabled('user_registration_in_index')}">
-                       <ui:include src="/WEB-INF/templates/guest/guest_index.tpl" />
+                       <ui:fragment rendered="#{not featureController.isFeatureEnabled('user_registration_in_index')}">
+                               <ui:include src="/WEB-INF/templates/guest/guest_index.tpl" />
+                       </ui:fragment>
                </ui:define>
        </ui:composition>
 </html>