jsf-2

Primefaces update component after <p:ajax listener> [duplicate]

折月煮酒 提交于 2019-12-13 01:37:13
问题 This question already has an answer here : Ajax update/render does not work on a component which has rendered attribute (1 answer) Closed 4 years ago . I have a selectOneMenu that changes a value in the backing bean and based on that value, another component is being displayed or not. What I would like is to update that certain component after the value in the backing bean is changed by the selectOneMenu <h:selectOneMenu value="#{backingBean.id.value}" > <f:selectItem itemLabel="Choose"

Download link encodedKeyStore

倖福魔咒の 提交于 2019-12-13 01:35:13
问题 I've been generated a PKCS12 keystore through a API, but the return of the process is a KeyStore object. I need to send it, directly to the browser to be downloaded when the client send the requisition. How can I do that? I'm using java and jboss 5AS. 回答1: You can use KeyStore#store() to write it out to an OutputStream . keyStore.store(outputStream, password); That's basically it. The OutputStream could be the one of the HTTP response. For a generic kickoff example of how to provide a file

OptionGroup-support for SelectOneMenu in Primefaces

纵然是瞬间 提交于 2019-12-13 01:29:40
问题 I've overwritten the SelectOneMenuRenderer to add OptionGroup-Support for this component. Now option-groups are displayed. Great! But when I have a select with option-groups and I click on an item in this menu: - the SelectItem below is selected (after the first option-group) - the SelectItem two below is selected (after the second option-group) - ... Some javascript is messing things up here, but I can't figure out which and where excactly. Code: package org.primefaces.component

JSF - Why setter is not called this time?

青春壹個敷衍的年華 提交于 2019-12-13 01:28:30
问题 As usual, i've some trouble by using some ajax call on a requested scoped bean. I've this Bean : @ManagedBean @RequestScoped public class ArticlesSelector implements Serializable { @ManagedProperty(value="#{param.type}") private String type; private String zone; private String order; @PostConstruct public void init() { if(type==null || type.trim().isEmpty()) { this.type="1"; } if(zone==null || zone.trim().isEmpty()) { this.zone="list"; } if(order==null || order.trim().isEmpty()) { this.order=

Redeploy application after jsf managed bean modification

﹥>﹥吖頭↗ 提交于 2019-12-13 01:23:09
问题 Why is an application redeployment is needed for jsf managed bean modifications to take effect? Development environment: Eclipse Indigo. JBoss as 7. JBossAS Tools. Further explanation: If I modify a jsf page, I can visualize the modification after simply refreshing the page. But this is not the case for jsf managed bean modifications where I have to redeploy the application to visualize them. 回答1: Eclipse/JBoss cannot handle new classes, methods, nor fields during hotpublish/hotdeploy. They

Get real path of a file on JSF application startup

纵饮孤独 提交于 2019-12-13 01:12:44
问题 I'm trying to get the real path of a file in a JSF application scoped Bean using : FacesContext.getCurrentInstance().getExternalContext().getRealPath(file) The problem is that getCurrentInstance() is throwing a NullPointerException when the bean is initialized at application startup: @ManagedBean(eager = true) @ApplicationScoped public class EnvoiPeriodiqueApp implements Serializable { @PostConstruct public void initBean() { FacesContext.getCurrentInstance().getExternalContext().getRealPath("

Evaluation of EL during view build time in c:forEach

半腔热情 提交于 2019-12-13 00:55:57
问题 What happens with EL statements in a view build time in c:forEach loop. <c:forEach var="v" values="#{bean.values}"> <p:inputText value="#{v.name}" /> </c:forEach> class Bean { public List<Pojo> getValues(); } class Pojo { public void setName (String); public String getName(); } How will be this code evaluated for render? To: <p:inputText value="John Smith"> or <p:inputText value="#{pojo.name}" > 回答1: For UI components, only id and binding attributes are immediately evaluated during view build

Need to integrate jQuery validation plugin with jsf

大憨熊 提交于 2019-12-13 00:43:23
问题 I have been trying to do client validation using jQuery validation plugin with a form built with jsf.I need client validation basically to help reduce the number of request/response round trips between server and browsers for obvious reasons. i know that jsf "h:commandlink" tag is not like a regular submit button,like the "h:commandButton" which i have gotten to work successfully with JQuery form validation with the code below: <script type = "text/javascript"> $(document).ready(function(){ $

p:selectOneMenu doesn't receive focus on tab key navigation

隐身守侯 提交于 2019-12-13 00:40:38
问题 I have a form with <p:inputText> and <p:selectOneMenu> components next to each other. When the focus is on the input text and I press the tab key in order to navigate to select one menu by keyboard, then the focus is lost. I don't see which component is focused. How can I get the focus on the select one menu when I tab into it? 回答1: You need to use the tabindex property of <p:inputText> and <p:selectOneMenu> , as explained in the documentation. 回答2: Using the tabindex property makes it

Trying to get JSF(Faces) working within Spring WebFlow

不问归期 提交于 2019-12-13 00:34:26
问题 I been trying to add some JSF(Face) code into my Spring Webflow project but I am getting the following error: java.lang.IllegalStateException: FacesContext has not been initialized within the current Web Flow request. Check the configuration for your <webflow:flow-executor>. For JSF you will need FlowFacesContextLifecycleListener configured as one of its flow execution listeners. Here is my flow.xml file <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org