jsf-2

Primefaces Dialog Framework - Open dialog - close it - open another dialog

久未见 提交于 2019-12-23 14:51:31
问题 Primefaces 5.0, JSF 2.2, Wildfly 8.1 The following use case: Click a command button in a view (with some parameters) The bean method looks something up in the database - if necessary dialog1 is shown. In dialog1 there is a form and a command button. The command button in dialog1 is clicked, the bean method looks something up in the database. Dialog1 is closed and dialog2 , depending on the result of the bean method, is shown. bean1.java: public void buttonClicked() { Map<String, Object>

Primefaces Dialog Framework - Open dialog - close it - open another dialog

那年仲夏 提交于 2019-12-23 14:51:19
问题 Primefaces 5.0, JSF 2.2, Wildfly 8.1 The following use case: Click a command button in a view (with some parameters) The bean method looks something up in the database - if necessary dialog1 is shown. In dialog1 there is a form and a command button. The command button in dialog1 is clicked, the bean method looks something up in the database. Dialog1 is closed and dialog2 , depending on the result of the bean method, is shown. bean1.java: public void buttonClicked() { Map<String, Object>

How to add Method Expression to a custom JSF component

大兔子大兔子 提交于 2019-12-23 14:40:25
问题 I'm trying to create a custom JSF component and add to it a method expression. This is the code of my custom component: @FacesComponent(AjaxCommand2.COMPONENT_TYPE) public class AjaxCommand2 extends UIComponentBase { public static final String COMPONENT_TYPE = "local.test.component.AjaxCommand2"; public static final String COMPONENT_FAMILY = "local.test.component.AjaxCommand2"; private MethodExpression listener; public MethodExpression getListener() { return listener; } public void

PrimeFaces Mobile requests undefined/undefined.css and undefined/undefined.js, causing JSF1064 warning and 404 error

自闭症网瘾萝莉.ら 提交于 2019-12-23 13:16:36
问题 When I add a <p:selectBooleanButton> to my PrimeFaces Mobile page, then I get the following warning in server log WARNING: JSF1064: Unable to find or serve resource, undefined/undefined.css, from library, primefaces. Jan 11, 2015 3:00:36 PM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource and the following error in browser console: 404 (Not Found) http://localhost:8080/ewpmob/javax.faces.resource/undefined/undefined.js.xhtml?ln=primefaces&v=5.1.7 How is this caused

PrimeFaces Mobile requests undefined/undefined.css and undefined/undefined.js, causing JSF1064 warning and 404 error

大憨熊 提交于 2019-12-23 13:16:14
问题 When I add a <p:selectBooleanButton> to my PrimeFaces Mobile page, then I get the following warning in server log WARNING: JSF1064: Unable to find or serve resource, undefined/undefined.css, from library, primefaces. Jan 11, 2015 3:00:36 PM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource and the following error in browser console: 404 (Not Found) http://localhost:8080/ewpmob/javax.faces.resource/undefined/undefined.js.xhtml?ln=primefaces&v=5.1.7 How is this caused

How to get validation status from JSF component

北城以北 提交于 2019-12-23 12:45:57
问题 I want set a special error class to div block into my custom component for JSF. I want set errorClass to "error" if this field failed the validation. <c:if test="${?????}"> <c:set var="errorClass" value="error" /> </c:if> <div class="input ${errorClass}"> <label for="#{rich:clientId('input')}:input">#{cc.attrs.label}</label> <h:inputText id="input" value="#{cc.attrs.value}" <cc:insertChildren /> </h:inputText> </div> 回答1: You can use component.valid inside the style or styleClass attribute of

JSF ajax event delay

主宰稳场 提交于 2019-12-23 12:42:09
问题 I want to implement a live filter for a list with JSF 2 but when using keyup event so many requests are being sent to the server. The code looks like: <h:inputText id="filter_input" value="#{bean.filterText}"> <f:ajax event="keyup" listener="#{bean.filter}" render="@form:list" execute="@this" /> </h:inputText> 回答1: f:ajax has added support for ajax event delay starting from JSF 2.2. Just include it as an attribute with its value in miliseconds: <f:ajax event="keyup" delay="1000" listener="#

DataTable row Selection not working

▼魔方 西西 提交于 2019-12-23 12:19:40
问题 I have a datatable <p:dataTable id="db" value="#{notificationBox.notificationsList}" var="notificationForm" rows="15" emptyMessage="${msgs.getMessage('table.empty.message')}" paginator="true" paginatorPosition="bottom" rowKey="#{notificationForm}" selection="#{notificationBox.notification}" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} ( ${notificationBox.notificationsList.size()} ${msgs.getMessage('table.records')} )"

why getQueryString() does not work in jsf backing bean with h:commandButton

回眸只為那壹抹淺笑 提交于 2019-12-23 12:17:04
问题 I have build a login snippet of code that is on the top of menu bar. If a user is in any of the page by navigating and presses all of sudden the login button, I'll like to see that person authenticated and at the same time stay on the page where he originally comes from. so I used this on the backing bean: HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest(); then if there is let say mypage.htm?a=2&b=2 get a=2&b=2 with the

ICEfaces/Seam file upload component not uploading files

大兔子大兔子 提交于 2019-12-23 12:16:18
问题 Update I'm currently over at the ICEfaces forums to get my problem solved - sadly, none of the provided options led to a solution now, but they indeed gave me some more insight into the whole JSF topic (credits go to BalusC for that, as often :-)). I will try to keep this thread up to date and post an answer if the problem is finally solved to help others which may encounter it. My findings so far are: Disabling the Seam Multipart Filter is required because it prevents the fileEntry-component