jsf-2

JSF2: Form ajax action makes another form's view state to be lost

ぐ巨炮叔叔 提交于 2019-12-11 04:57:36
问题 I have a simple page consisting of two forms. They cannot be displayed simultaneously (one toggles the other). Here is the code: <h:body> <ui:composition template="/elements/templateWithMenu.xhtml"> <ui:define name="content"> <p:dialog id="question1DialogId" widgetVar="question1Dialog" resizable="false" closable="false" visible="true"> <h:panelGroup id="questionStep1Group"> <h:form id="questionStep1Form" rendered="#{newPoll2.displayQuestionStep1}"> <h:commandLink value="next" action="#

PrimeFaces and JQuery: resource ordering

房东的猫 提交于 2019-12-11 04:57:23
问题 I have a problem with the order of JQuery imports. In the head section I do: <h:head> <f:facet name="first"> <h:outputScript library="primefaces" name="jquery/jquery.js" target="head" /> </f:facet> <f:facet name="middle"> <h:outputScript library="primefaces" name="jquery/jquery-plugins.js" target="head" /> </f:facet> ... The first time my page is loaded everything seems correct, especially the jquery/jquery-plugins order: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"><head id="j

JSF: /index.xhtml @12,80 value=“#{LoginBean.username}”: Target Unreachable, identifier 'LoginBean' resolved to null [duplicate]

ぃ、小莉子 提交于 2019-12-11 04:54:09
问题 This question already has answers here : Identifying and solving javax.el.PropertyNotFoundException: Target Unreachable (14 answers) Closed 4 years ago . I'm new to JSF and can't figure out what's going on. I keep getting this error: /index.xhtml @12,80 value="#{LoginBean.username}": Target Unreachable, identifier 'LoginBean' resolved to null I've isolated the problem down to this... index.xhtml <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"> <h:head> <title

JSF Error page not shown when ViewExpiredException occurs

泪湿孤枕 提交于 2019-12-11 04:53:39
问题 I have the following error when view within a page is expired. The message says that the Error page '/home.xhtml' will be shown. but actually nothing is shown, the page remains the same, and it is just frozen. I am using FullAjaxExceptionHandler from Omnifaces , described by balusC. I am using Primefaces 3.5 and Mojarra 2.1.17. Mär 11, 2013 1:40:30 PM org.apache.catalina.core.ApplicationContext log SEVERE: FullAjaxExceptionHandlerx: An exception occurred during processing JSF ajax request.

JSF validator method results in duplicate FacesMessage shown in p:messages

我的未来我决定 提交于 2019-12-11 04:49:21
问题 I have two PrimeFaces p:calendar components, one representing a begin and the other representing an end date. I want to run a validator method now whenever one of them changes. Here's the end date component: <p:calendar id="end-date" widgetVar="testEndDate" value="#{testManager.endDate}" mindate="#{testManager.minEndDate}" maxdate="#{testManager.maxEndDate}" validator="#{testManager.validateEndDate}"> <p:ajax event="dateSelect" update="begin-date msgs" global="false" /> </p:calendar> Here's

why growl message not dispalying left side of screen using common layout

穿精又带淫゛_ 提交于 2019-12-11 04:49:21
问题 In my project there is a requirement that when we change language from Engish to Arabic all layout will be displayed in right to left position. growl message working fine when i didn't use common layout but when i add this thing in common layout of my page then its still showing right side only.. source code: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns

Execute JavaScript on client side within an non ajax call

旧城冷巷雨未停 提交于 2019-12-11 04:46:16
问题 In my application the user is able to push a button to create and download a file. The process takes some time, so I want to block the UI during this process until the download window appears. The action method were I am handling the response looks basically like this: public void download() { FacesContext facesContext = FacesContext.getCurrentInstance(); ExternalContext externalContext = facesContext.getExternalContext(); // set content disposition etc. XSSFWorkbook wb = getWorkbook(); wb

Why is primefaces Fileupload not Visible?

不想你离开。 提交于 2019-12-11 04:44:10
问题 The fileupload Control for is not visible in the browser(rendered though). When I viewed the source code from the browser, it was rendered like this.. <script type="text/javascript"> jQuery(function() {widget_exeupload1 = new PrimeFaces.widget.Uploader('exeupload1', {uploader:'/jsfscrb/javax.faces.resource/fileupload/uploadify.swf.xhtml?ln=primefaces&v=2.2.1',script:'/jsfscrb/home.xhtml',cancelImg:'/jsfscrb/javax.faces.resource/fileupload/cancel.png.xhtml?ln=primefaces&v=2.2.1',formId:'j

Strategy for mapping entity relationships and converting entities

不打扰是莪最后的温柔 提交于 2019-12-11 04:42:38
问题 I am just learning java ee 6. My goal is having a simple crud application which let me create edit list and delete one trivial entity made simply by the id, a name string and a description string. I followed this just to see some code http://netbeans.org/kb/docs/web/jsf20-crud.html I used eclipse instead of netbeans and jboss 7 instead of glass fish. Well.... It works. Now think my entity is a "User": id, username, Password. I want to add a "UserRole" entity and here it is: id, rolename. Then

FacesServlet Servlet 3.0 Async Support

柔情痞子 提交于 2019-12-11 04:39:10
问题 Does the FacesServlet in JSF 2.0 support the servlet 3.0 async features? 回答1: No, with the simple reason that JSF 2.0 is designed with Servlet 2.5 in mind. JSF 2.1 in turn is however designed with Servlet 3.0 in mind, but it does not utilize the new async features, perhaps with the simple reason being that there's just no need for it. The closest what you can get is ajax poll/push provided by 3rd party component libraries like RichFaces, PrimeFaces or IceFaces. 来源: https://stackoverflow.com