uiinclude

Jsf 2.0-<ui:include>xhtml included always even if rendered is false

烂漫一生 提交于 2019-11-30 10:33:55
I have a home page xhtml where i am including 3 child xhtml based on conditions. The issue i am facing is , whatever be the scenario,Book.xhtml always gets invoked. I changed the rendered condition to false or move out to another condition, but the file always gets invoked Due to which its backing bean also is invoked causing unwanted overhead. Please provide me a solution <ui:composition template="/xhtml/baseLayout.xhtml"> <ui:define name="browserTitle"> <h:outputText value="HOME PAGE" /> </ui:define> <ui:define name="header"> <ui:include src="/xhtml/header.xhtml" /> </ui:define> <ui:define

Jsf 2.0-<ui:include>xhtml included always even if rendered is false

心已入冬 提交于 2019-11-29 15:44:01
问题 I have a home page xhtml where i am including 3 child xhtml based on conditions. The issue i am facing is , whatever be the scenario,Book.xhtml always gets invoked. I changed the rendered condition to false or move out to another condition, but the file always gets invoked Due to which its backing bean also is invoked causing unwanted overhead. Please provide me a solution <ui:composition template="/xhtml/baseLayout.xhtml"> <ui:define name="browserTitle"> <h:outputText value="HOME PAGE" /> <

Dynamic ajax navigation with <ui:include>

谁都会走 提交于 2019-11-28 10:36:15
Suppose I want to navigate in my application, and include different facelet pages dynamically. I have a commandLink like this: <h:commandLink value="Link" action="#{navigation.goTo('someTest')}"> <f:ajax render=":content" /> </h:commandLink> And this is where I include the facelet: <h:form id="content"> <ui:include src="#{navigation.includePath}" /> </h:form> The Navigation class: public class Navigation { private String viewName; public void goTo(String viewName) { this.viewName = viewName; } public String getIncludePath() { return resolvePath(viewName); } } I have seen similar examples, but

JSF Conditional includes, cause Component ID has already been found in the view

别说谁变了你拦得住时间么 提交于 2019-11-28 09:41:27
I know we can't repeat the ID of any component we have in the same view tree. I have a page which includes another pages by certain condition Like this... <h:panelGroup rendered="#{bean.insertMode == 'SINGLE'}"> <ui:include src="_single.xhtml" /> </h:panelGroup> <h:panelGroup rendered="#{bean.insertMode == 'DOUBLE'}"> <ui:include src="_double.xhtml" /> </h:panelGroup> Now In these pages I have "Almost" the same components hierarchy (Complex) with different actions behaviour (Not only method calls, also view), for example: _single.xhtml <p:inputText id="fieldID" value="#{bean.value}" /> <p

Dynamic <ui:include src> depending on <ui:repeat var> doesn't include anything

只谈情不闲聊 提交于 2019-11-27 08:05:57
问题 I am new to JSF and I am struggling with dynamicaly rendering included pages. My code looks like this: MenuBean @ViewScoped public class MenuBean implements Serializable { private MenuItem[] menuItems = new MenuItem[] { new MenuItem("page_1", "/page_1.xhtml"), new MenuItem("page_2", "/page_2.xhtml"), }; private String selectedItemLabel; //... } MenuItem public class MenuItem implements Serializable { private String label; private String page; //... } index.xhtml <ui:repeat var="menuItem"

Dynamic ui include and commandButton

无人久伴 提交于 2019-11-27 07:56:11
问题 I have a page which includes content from another page dynamically (this is done by a method in the bean) firstPage.xhtml <ui:include src="#{managedBean.pageView}"> <ui:param name="method" value="#{managedBean.someAction}"/> </ui:include> This redirects to a secondPage which is within <ui:composition> which has commandButton. secondPage.xhtml <ui:composition> .. .. <p:commandButton actionListener=#{method} value="Submit"/> </ui:composition> ManagedBean public String pageView(){ return

JSF dynamically include src in “ui:include src=”#{bean.pagePath}\"

倖福魔咒の 提交于 2019-11-27 05:30:20
I tried to include multiple source page path using ui:include tag in different tabs. The problem is when i gave the source page path as static one means that page will be shown but if give the source page path from backing bean mean it won't include the page. Here is my code template.xhtml : <p:layoutUnit position="center" id="layoutCenter"> <h:form id="tempFormId"> <p:tabView value="#{multiTabBean.tabsList}" var="useCase" activeIndex="#{multiTabBean.activeTabIndex}"> <p:tab title="#{useCase.title}" closable="true"> <f:subview> <h:panelGroup id="mainTempPanelGroupId" layout="block"> <ui

Dynamic ajax navigation with <ui:include>

此生再无相见时 提交于 2019-11-27 03:40:50
问题 Suppose I want to navigate in my application, and include different facelet pages dynamically. I have a commandLink like this: <h:commandLink value="Link" action="#{navigation.goTo('someTest')}"> <f:ajax render=":content" /> </h:commandLink> And this is where I include the facelet: <h:form id="content"> <ui:include src="#{navigation.includePath}" /> </h:form> The Navigation class: public class Navigation { private String viewName; public void goTo(String viewName) { this.viewName = viewName;

JSF dynamically include src in “ui:include src=”#{bean.pagePath}"

时间秒杀一切 提交于 2019-11-26 11:36:26
问题 I tried to include multiple source page path using ui:include tag in different tabs. The problem is when i gave the source page path as static one means that page will be shown but if give the source page path from backing bean mean it won\'t include the page. Here is my code template.xhtml : <p:layoutUnit position=\"center\" id=\"layoutCenter\"> <h:form id=\"tempFormId\"> <p:tabView value=\"#{multiTabBean.tabsList}\" var=\"useCase\" activeIndex=\"#{multiTabBean.activeTabIndex}\"> <p:tab

How to ajax-refresh dynamic include content by navigation menu? (JSF SPA)

≯℡__Kan透↙ 提交于 2019-11-25 21:47:09
问题 I\'m just learning JSF 2 thanks to this site I had learned a lot in such a short time. My question is regarding how to implement a common layout to all my JSF 2 pages and have only the content part of the page refresh not the whole page whenever I click a link/menu from a different panel. I am using the Facelets approach it does what I want except that each time I click a link from a panel (e.g. menu items from left panel) the whole page is refreshed. What I am looking for is a way to refresh