jsf-2

JSF f:event preRenderView is triggered by f:ajax calls and partial renders, something else?

不羁的心 提交于 2019-12-17 15:36:02
问题 So we have an f:event: <f:metadata> <f:event type="preRenderView" listener="#{dashboardBacking.loadProjectListFromDB}"/> </f:metadata> Which is triggered as desired on initial page load (render). However this preRenderView event is also triggered by an ajax partial page render, which re-renders an h:panelgroup with the id projectListing, as below. <h:commandButton action="#{mrBean.addProject}" value="Create Project" title="Start a new project"> <f:ajax render="projectListing" /> </h

List of <p:ajax> events

南楼画角 提交于 2019-12-17 15:33:54
问题 I've searched the Internet and I cannot find a list of <p:ajax> events. Can anyone provide a complete list of events for the <p:ajax> tag? I'm particularly interested if there is an onblur event or something similar. 回答1: You can search for "Ajax Behavior Events" in PrimeFaces User's Guide, and you will find plenty of them for all supported components. That's also what PrimeFaces lead Optimus Prime suggest to do in this related question at the PrimeFaces forum <p:ajax> event list? There is no

Primefaces datatable frozen columns misallignment

末鹿安然 提交于 2019-12-17 14:14:28
问题 We have a data table as shown in the image. There are 3 frozen columns and rest scrollable. The frozen columns are misalligned as shown. If frozen columns attribute is removed, the table looks properly. Any suggestions to solve the problem. 回答1: I have had similar issues in the past with frozen datatable and using many different scripts across different posts I have found the below script works in ALL browsers and does not require you to set a height it will calculate it. As an added bonus it

Primefaces datatable frozen columns misallignment

烂漫一生 提交于 2019-12-17 14:13:59
问题 We have a data table as shown in the image. There are 3 frozen columns and rest scrollable. The frozen columns are misalligned as shown. If frozen columns attribute is removed, the table looks properly. Any suggestions to solve the problem. 回答1: I have had similar issues in the past with frozen datatable and using many different scripts across different posts I have found the below script works in ALL browsers and does not require you to set a height it will calculate it. As an added bonus it

How to use Parameterized MessageFormat with non-Value attributes of JSF components

被刻印的时光 ゝ 提交于 2019-12-17 13:59:54
问题 I have use case in which I have to use resource bundle to display various texts on UI. Some of these resource bundle entries take paramets (e.g. {0}), for these I use h:outputFormat but sometimes that isn't enough. e.g. someMessage=Display this message with param {0} in a resource bundle. To display it on xhtml I normally do: <h:outputFormat value="#{msg['someMessage']}"><f:param value="#{someBean.value}"/></h:outputFormat> That works well when it's a simple case, but for more complex use

java.lang.IllegalStateException : Could not find backup for factory javax.faces.context.FacesContextFactory

柔情痞子 提交于 2019-12-17 12:43:51
问题 I created my hello world JSF project, but when I deploy to Tomcat 7, I get this exception: java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory. at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1135) at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:379) at javax.faces.webapp.FacesServlet.init(FacesServlet.java:350) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284) at org

JSF resource versioning

旧城冷巷雨未停 提交于 2019-12-17 12:09:28
问题 I am trying to put versioning around the resources in an application. If I do like this resources/js/1_0_0/mainscript.js It does not work. It says RESOURCE_NOT_FOUND but when I do like this resources/js/mainscript.js/1_0_0.js It works. I do not like the way it is organized in the second way. First one looks cool. Any Idea? I am using Tomcat 7.0, JSF 2.0.9 Update: I was checking primefaces-2-2.1.jar. Since when I checked the page source, I saw this /javax.faces.resource/jquery/jquery.js.xhtml

Refer to JSF dynamically generated ids based on iteration index

拥有回忆 提交于 2019-12-17 11:03:24
问题 In JSF, <ui:repeat/> and similar components such as PrimeFaces <p:dataTable/> generate dynamic ids for sub-components based on the iteration index, i.e.: <p:dataTable id="table" var="item" value="#{itemList}"> <h:outputText id="name" value="#{item.name}"/> </p:dataTable> will generate something like this: <table id="table"> <span id="table:0:name">name0</span> <span id="table:1:name">name1</span> <span id="table:2:name">name2</span> ... <span id="table:n:name">nameN</span> </table> so all the

Render multiple components with f:ajax

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 10:58:41
问题 The wrong codes are: <h:form id="search_form"> <h:commandButton class="button" value="View" action="#{InfoBean.search}"> <f:ajax execute="search_form" render="linear1"></f:ajax> <f:ajax execute="search_form" render="linear2"></f:ajax> </h:commandButton> <p:lineChart id="linear1" value="#{InfoBean.linearModel1}" legendPosition="e"/> <p:lineChart id="linear2" value="#{InfoBean.linearModel2}" legendPosition="e"/> </h:form> What I want to do is when I click on the commandButton , I want to

JSF 2: how to pass an action including an argument to be invoked to a Facelets sub view (using ui:include and ui:param)?

自作多情 提交于 2019-12-17 10:57:32
问题 This is basically an extension to this answer. I am trying to get an argument into a method/action call (for a delete button in a list/data table). Client: <ui:include src="..."> <ui:param name="acceptButtonBean" value="#{repoHome}" /> <ui:param name="acceptButtonAction" value="removeIndividualDocument(#{doc.id})" /> </ui:include> Sub view: <h:commandButton value="Continue" action="#{acceptButtonBean[acceptButtonAction]}" /> ... </h:commandButton> However, JSF fails with an exception saying: