uiinclude

Is it ok to use a ui:repeat inside a ui:include

允我心安 提交于 2020-01-06 15:18:18
问题 We all know the difference between build time and render time. It is definitely not a great idea to put a <ui:include> tag (build time) inside a <ui:repeat> (render time), but is the opposite okay to do? Can we use <ui:repeat> inside a <ui:include> ? 回答1: Both ways are OK. It is definitely not a great idea to put a <ui:include> tag (build time) inside a <ui:repeat> (render time) This is not true. You can safely do so. The only limitation is that you can't use the var of <ui:repeat> inside src

Display dynamic editors in JSF with ui:include

◇◆丶佛笑我妖孽 提交于 2019-12-24 07:11:53
问题 I want to display a group of editors in a tabview. Each editor has a property called component , that stores the rendered editor. Simple editors use HTML tags to render the editor, whereas complex ones use editors defined in another pages. I have found out that I cannot use editor.component with ui:include because the value is not available when the tree is build. How can I solve this issue? Are there any alternatives to ui:include that don't have this limitation?. <ui:composition xmlns="http

How to use <ui:include> inside a <h:dataTable>?

心已入冬 提交于 2019-12-23 12:54:08
问题 I want to inlude <ui:include> one page dynamically several times. Code: <h:dataTable ..> <h:column> <ui:include src="#{create_page}"> <h:column> <h:dataTable> Now when I submit it persists only the last inlude. It remembers only the values for the last included page. I want unique entity object in each create_page. How can I do that? 回答1: The <ui:include> is as being a tag handler executed during view build time, while the <h:dataTable> is as being an UI component executed during view render

Using dynamic ui:include inside ui:repeat results in NullPointerException

前提是你 提交于 2019-12-23 03:39:13
问题 I want to create dynamic dialog windows by using <ui:repeat> and <p:dialog> with <ui:include> . But there's an exception when I tried like below. main.xhtml <p:outputPanel id="windowsPanel" layout="block" style="width:100%;"> <p:outputPanel rendered="#{mainView.dynamicWindows ne null}"> <ui:repeat var="item" value="#{mainView.dynamicWindows}"> <p:dialog binding="#{item.dialog}"> <ui:include src="#{item.includedWindowPath}" /> </p:dialog> </ui:repeat> </p:outputPanel> </p:outputPanel> MainView

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

岁酱吖の 提交于 2019-12-17 19:08:02
问题 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

Customize ui:include rendering to add prefix/postfix

这一生的挚爱 提交于 2019-12-10 22:43:00
问题 I need to customize the ui:include renderer in a way that when it generates the HTML output also adds a comment stating the starting and the ending of the included file. Example, supposing a blank file.xhtml : Input <ui:include src="file.xhtml" /> Output <!-- START file.xhtml --> <!-- END file.xhtml --> At the moment I'm using JSF2.2 with MyFaces, any idea on how I could do that? 回答1: I would suggest to define following facelet tag : <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html

The class behind ui:include JSF tag

安稳与你 提交于 2019-12-10 15:38:14
问题 How is the ui:include tag implemented? Where can I find its implementation(source code)? 回答1: That's implementation dependent. In Mojarra, it's the com.sun.faces.facelets.tag.ui.IncludeHandler. In MyFaces, it's the org.apache.myfaces.view.facelets.tag.ui.IncludeHandler. 来源: https://stackoverflow.com/questions/10789373/the-class-behind-uiinclude-jsf-tag

How to access ui:param value in the managed bean

折月煮酒 提交于 2019-12-04 03:19:07
问题 I have seen this question ask around a lots, however, none was properly answered so I decided to ask again. So if I have this: if I am in A.xhtml and I <ui:include src="B.xhtml"> <ui:param name="formId" value="awesome Id"/> </ui:include> so in B.xhtml , I can do this <h:outputText value="#{formId}"/> when I run A.xhtml , I would see awesome Id get printed on the screen. However how do I access the value of formId in the backing bean. I look inside FacesContext.getCurrentInstance()

How to access ui:param value in the managed bean

◇◆丶佛笑我妖孽 提交于 2019-12-01 18:06:41
I have seen this question ask around a lots, however, none was properly answered so I decided to ask again. So if I have this: if I am in A.xhtml and I <ui:include src="B.xhtml"> <ui:param name="formId" value="awesome Id"/> </ui:include> so in B.xhtml , I can do this <h:outputText value="#{formId}"/> when I run A.xhtml , I would see awesome Id get printed on the screen. However how do I access the value of formId in the backing bean. I look inside FacesContext.getCurrentInstance().getAttributes() and FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap() and I just

Use <ui:param> in a listener into a tag <p:ajax>

别等时光非礼了梦想. 提交于 2019-12-01 06:21:31
I'm using <ui:include> to load a data table (I'm using Primefaces). I want use <ui:param> in the listener into the tag <p:ajax> . I tested the code that is down, but not trigger the event onRowEdit or onRowCancel . This is my page: ... <ui:include src="../Componentes/tablaEditable.xhtml"> <ui:param name="columnas" value="#{tabla2FuentesHL7.dataTableColumns}" /> <ui:param name="bean" value="#{tabla2FuentesHL7.listTabla2FuenteDTO}" /> <ui:param name="aceptarEdicion" value="#{tabla2FuentesHL7.onRowEdit}" /> <ui:param name="cancelarEdicion" value="#{tabla2FuentesHL7.onRowCancel}" /> </ui:include>