jsf-2

Updating text component via selectOneMenu from inside a JSF2/Facelets subview

北战南征 提交于 2019-12-24 07:54:21
问题 I have a Facelets subview called basedata-cpanel.xhtml , which gets its parameters passed via <ui:param> s: <ui:define name="content-top"> <h:form> <ui:include src="/subviews/basedata-cpanel.xhtml"> <ui:param name="customerId" value="#{pqHome.pq.customer.id}" /> <ui:param name="customerName" value="#{pqHome.pq.customer.name}" /> <ui:param name="customers" value="#{organizationManager.allCustomers}" /> <ui:include /> </h:form> </ui:define> In the subview, I simply want a panel below to show

JSF 2: Facelets composition (template) not rendered for error-page

老子叫甜甜 提交于 2019-12-24 07:38:50
问题 I'm using JSF 2.0 with Facelets in a Java EE 6 application server (GlassFish v3). I have configured an error page for exceptions, in web.xml: <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/error-all.xhtml</location> </error-page> This is the /error-all.xhtml test page: <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http:

ViewExpiredException - why different behaviour?

Deadly 提交于 2019-12-24 06:45:51
问题 I have a JSF 2 application and configured the following in web.xml : <error-page> <exception-type>javax.faces.application.ViewExpiredException</exception-type> <location>/error.html</location> </error-page> For testing purposes I have the following code in a @SessionScoped class within an init Method annotated with @PostConstruct in order to let the session quickly expire: ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext(); HttpSession session = (HttpSession) ec

OmniFaces validateOrder disabling

末鹿安然 提交于 2019-12-24 06:45:07
问题 I'm trying to use validateOrder component to validate two java.util.Date objects. It is similar to showcase example on this link (PrimeFaces example). Everything works perfect, but i have one question: What if 2nd date field is not required? In that case i'm getting nullpointer exception, and since validateOrder has "disabled" attribute, i was wondering is it worth/possible enabling/disabling it via ajax every time the 2nd date is inserted/removed. If not, i guess i'll stick to Balus'

primefaces calender: how to set dynamically mindate

…衆ロ難τιáo~ 提交于 2019-12-24 06:38:02
问题 I have two primefaces calender controls.I want that when I select a date from the first calender then next calender mindate should be start from 1st calender's selected date.For instance, I have selected 7/5/2013 then next calender should disable all dates before 8/5/2013 This is what I have tried so far but it is not working <p:calendar id="fromD" value="#{requestController.from}" yearRange="2013:2015" pattern="dd/MM/yyyy" mindate="#{requestController.today}"/> <p:calendar id="toD" value="#

WebSphere 7, JSF 2.0 and classloaders

跟風遠走 提交于 2019-12-24 06:03:30
问题 On a WAS 7, I deployed my EAR with a single WAR in it. The EAR classloading mode is set to PARENT_LAST , and the WAR classloading mode is also set to PARENT_LAST . The WAR's /WEB-INF/lib has the Mojarra JSF 2 RI, and the Unified EL 2.1 jars. Despite all this, when the application starts, it tries to load some MyFaces stuff, from the inbuilt MyFaces 1.2. The class loader viewer for the WAR class loader clearly shows "org.apache.myfaces.webapp.StartupServletContextListener" getting loaded at

Upgrade JSF / Mojarra in JBoss AS / EAP / WildFly

◇◆丶佛笑我妖孽 提交于 2019-12-24 05:12:27
问题 How do I upgrade Mojarra in JBoss server and tell it use the given Mojarra 2.x JARs instead of JBoss own jboss-jsf-api_2.1_spec-2.0.1.Final.jar as indicated in startup log? If that's relevant, I am currently using JBoss AS 7.1. 回答1: The below procedure applies to JBoss AS 7.2+ , JBoss EAP 6.1+ , and JBoss WildFly 8+ and assumes that you've full control over the server installation and configuration. This upgrades the server-wide default JSF version: Download the individual Mojarra API and

Upgrade JSF / Mojarra in JBoss AS / EAP / WildFly

爱⌒轻易说出口 提交于 2019-12-24 05:12:09
问题 How do I upgrade Mojarra in JBoss server and tell it use the given Mojarra 2.x JARs instead of JBoss own jboss-jsf-api_2.1_spec-2.0.1.Final.jar as indicated in startup log? If that's relevant, I am currently using JBoss AS 7.1. 回答1: The below procedure applies to JBoss AS 7.2+ , JBoss EAP 6.1+ , and JBoss WildFly 8+ and assumes that you've full control over the server installation and configuration. This upgrades the server-wide default JSF version: Download the individual Mojarra API and

jsf dynamic change of managedbean

限于喜欢 提交于 2019-12-24 05:04:14
问题 How can I dynamically change managed bean of "value" attribute? For example, I have h:inputText and, depending on typed-in text, managed bean must be #{studentBean.login} or #{lecturerBean.login}. In a simplified form: <h:inputText id="loginField" value="#{'nameofbean'.login}" /> I tried to embed another el-expression instead of 'nameofbean': value="#{{userBean.specifyLogin()}.login}" but it doesn't worked out. 回答1: Polymorphism should rather be done in the model, not in the view. E.g. <h

Setting id for a dynamic menu element in primefaces does not work

送分小仙女□ 提交于 2019-12-24 04:55:11
问题 Am using primefaces 5.3. I am generating a primefaces menu dynamically. I want to set the id on the menu elements so that I can display a tooltip based on that id. My code is: DefaultMenuModel menuModel = new DefaultMenuModel(); DefaultMenuItem homeMenuItem = new DefaultMenuItem( "Hello"); homeMenuItem.setIcon("fa fa-home"); homeMenuItem.setTitle("halloo"); //Setting the id here homeMenuItem.setId("homeId"); menuModel.addElement(homeMenuItem); However when I view the page source or inspect