facelets

Conditional image rendering using JSTL <c:choose>

雨燕双飞 提交于 2019-12-11 06:32:29
问题 I`m developing a JSF application and I have a question regarding a Facelets page with JSTL. I want to display in an ui:repeat a number of question, a question and 3 answers (formated conditionally) and in front of the answers a tick (tickSmall.png) or an X (xSmall.png) if the questions are right or wrong. The answers are formated correctly, but the tick / X is not put correctly (I checked the booleans are correct, some are true, some are false). EVERY time it puts an X, even if there should

JSF execute Ajax before a onClick Event

爷,独闯天下 提交于 2019-12-11 06:24:46
问题 I have a Javascript function which changes the position of some elements according to some hiddenfields in the document, which are updated regularly with ajax. Problem: Since the javascript function (onclick) is executed before the Ajax (which reloads the element in which the hiddenfields are) the elements which should change position are always one turn behind. What I want to achive: The Problem would be solved if the ajax reload is executed before the onclick Event, so the reference to the

Facelets custom function not found

我只是一个虾纸丫 提交于 2019-12-11 06:17:36
问题 I'm writing a simple custom function in Facelets with a sample method. The problem is that the JSF 2 application fails to locate that function. The error message is: /test.xhtml @15,73 rendered="#{test:isGranted('ONE_ROLE')}" Function 'test:isGranted' not found. I've been checking and rechecking and can't find the problem. Any comment here would be really appreciated as it's clear that I'm missing something (but it seems that the steps involved are really simple). Do you know if there are

RichFaces rich:clientId within facelets

[亡魂溺海] 提交于 2019-12-11 06:04:42
问题 I'm trying to something like this: <?xml version="1.0"/> <ui:composition ....> <h:inputText id="#{id}InputText" value="#{value}"/> <rich:calendar id="#{id}Shevron" popup="true" datePattern="ddMMyy" showInput="false" todayControlMode="hidden" enableManualInput="false" showApplyButton="false" updateDays="14" ondateselected="alert('#{rich:clientId('#{id}Shevron')}');" inputClass="xwingml-input"/> </ui:composition> The problem I'm facing here is that the actual client id is generated for my

How to load JSF / facelets library from a common directory? [duplicate]

佐手、 提交于 2019-12-11 04:57:44
问题 This question already has an answer here : Obtaining Facelets templates/files from an external filesystem or database (1 answer) Closed 3 years ago . We have a number of webapps that all use a certain JSF library. We'd like to place the library in a common location or on the main classpath. The trouble is that the system expects the library to be in WEB-INF/lib so the webapp classloader can scan it and load it. We are the creators of this particular library, and during development it's way

Ajax not working right in JSF with a jquery slide

两盒软妹~` 提交于 2019-12-11 04:52:22
问题 I have this application written in JSF 2.0 facelets and it has the following code that supposed to display some content in an area which a jQuery slide controls , meaning that you press a button that displays that area and press it again to hide it <f:ajax render="messageID"> <h:form id="myform" styleClass="form1" > <h:message id="messageID" for="signinemail" class="messageforlogin"/> <h:panelGrid styleClass="loginpanel" columns="2" cellspacing="4"> <h:outputText value="Email: "/> <h

Facelet Custom Component - prevent rendering ui:insert content in custom component

五迷三道 提交于 2019-12-11 04:18:22
问题 this is my custom component definition: <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions"> <c:if test="${empty required}"> <c:set var="required" value="false" /> </c:if> <c:if test="${empty disabled}"> <c:set var="disabled" value="false" /> </c:if> <c:if test="${not disabled}">

Conditional render in tagfile depending on whether the attribute is specified or not

丶灬走出姿态 提交于 2019-12-11 04:17:03
问题 I have a Facelet tagfile and need to render different components depending on whether the attribute is specified or not. I tried it as below, <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:pe="http://primefaces.org/ui/extensions" xmlns:c="http://java.sun.com/jsp/jstl/core"> <h:panelGrid columns="1"> <p:outputLabel value="test1

Check for validation errors in part of a form in JSF

霸气de小男生 提交于 2019-12-11 04:12:16
问题 I'm building a Seam application, which is basically a huge form divided into different parts, or modules. I need a way to figure out when a module is "complete", meaning all validation for the fields in that module passes. I then need to do something in the view, setting a css-class or whatever. Something like: <a:region id="region1"> <s:div styleClass="#{invalid ? 'errors' : ''}"> <h:inputText required="true" id="input1" /> <h:inputText required="true" id="input2" /> <h:commandButton value=

PrimeFaces dialog refer to parent

耗尽温柔 提交于 2019-12-11 03:57:26
问题 I have an xhtml page that display a Datatable with entries. I also have a button to insert a new entry, that displays a dialog that has a form. The insertion form is used as <ui:include> in the parent .xhtml as follows: Parent file <h:form id="mainForm"> <p:commandButton process="@form" update=":dlgGrp" oncomplete="dlg.show()"/> <p:datatable id = "datatable"> various columns ..... ..... </p:datatable> </h:form> <p:dialog widgetVar="dlg" > <h:panelGroup id="dlgGrp"> <ui:include src="include