jsf-2

dynamically editing property file

独自空忆成欢 提交于 2019-12-11 04:28:51
问题 I have a property files message_en.properties message_de.properties in my project and I have entry InfoBox_description=welcome to the this application and corresponding value in German. Now user should be allowed to change the description dynamically and same should reflect in other property file also with right conversion.how should I do this? I am using JSF2 and prime faces Thanks in advance 回答1: Assuming you have your properties file inside your war, in a package in the source folder, this

h:selectManyChexkbox`s <f:ajax event=“click” listener doesn't fire and gives an error

时光怂恿深爱的人放手 提交于 2019-12-11 04:22:51
问题 I want to fire an event change listener when the user selects / deselects something in the h:selectManyCheckbox, if it leaves it alone nothing should happen. My xhtml: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en" 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/jsp

action method is not called in <a4j:commandLink> tag

故事扮演 提交于 2019-12-11 04:22:08
问题 <a4j:commandLink onclick="return call();" action="#{bean.deleteUser(all_user.userID)}" reRender="viewUserGrid"> <h:graphicImage style="border-style:none;" url="/images/delete.jpg" height="10px" /> </a4j:commandLink> The problem is deleteUser method is not getting invoked in the backing bean why is it so.But it is invoking the javascript function Please help me. 回答1: The problem is that you're returning a value in your "onclick" method. Assumming that your call js method returns a true or

After showing / hiding a JSF element with AJAX how to hide the triggering element?

好久不见. 提交于 2019-12-11 04:22:01
问题 I followed the intructions given by BalusC in [this answer][1] [1]: JSF and f:ajax for hiding/showing div and it worked. But I want to hide the element when the command button is pressed and the element with the id="incorrectQuestion" is shown. I did it almost like in the example. I have tried a lot of combinations but I couldn't hide the command button. <h:panelGroup rendered="#{not answerResultBean.showIncorrectQuestions}"> <div id="loginDiv" style="width: 400px; text-align: left;"> <center

jsf2 ajax update parts based on request parameters

一曲冷凌霜 提交于 2019-12-11 04:20:24
问题 this example is kind of extreme, and what im trying to do is not exactly this, but its more simple to demonstrate my problem with this i have a page, with a simple index.xhtml: <html xmlns:h="http://java.sun.com/jsf/html" xmlns:mc="http://java.sun.com/jsf/composite/mc"> ... <h:panelGroup id="u1" styleClass="unique_container"> <mc:component1></mc:component1> </h:panelGroup> <h:panelGroup id="u2" styleClass="unique_container"> <mc:component2></mc:component2> </h:panelGroup> <h:panelGroup id="u3

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

<p:blockUI> does not respond on <h:commandButton><f:ajax>

感情迁移 提交于 2019-12-11 04:12:36
问题 I got a <h:commandButton like: <h:commandButton id="login" actionListener="#{bean.login}" value="Login" styleClass="btn btn-primary btn-sm"> <f:ajax execute="@form" render="@form"/> </h:commandButton> and a <p:blockUI id="block" block=":form" trigger="login" /> It is not working. The block is never shown up. It does work with a <p:commandButton> . How can I achieve it with a <h:commandbutton> . If that is not possible: Is there any workaround? 回答1: The <p:blockUI> listens on PrimeFaces/jQuery

Primefaces datatable's p:columns not iterating over Map

六眼飞鱼酱① 提交于 2019-12-11 04:06:18
问题 I am having a two level map Map<String,HashMap<String,String>> which i need to display using a <p:dataTable> . The code of managed bean is as follows: @ManagedBean(name="MyBean") public class MyBean{ private Map<String,HashMap<String,String>> twoDimentionalMap; public void getMapData(){ twoDimentionalMap=getDataFromDataStore(); } } Now I am using this map in my view.xhtml file as follows: <p:dataTable var="entrySet1" value="#{MyBean.twoDimentionalMap.entrySet()}"> <p:columns var="entrySet2"

Two primefaces calendar component validation

倾然丶 夕夏残阳落幕 提交于 2019-12-11 04:04:54
问题 I've a form in JSF 2 where I'm using a double field to specify a range of dates. The aim of that is not to let the user to pick a first date which is before the second one. So I want to perform a validation before the form is sent, using p:calendar components. What I do is to tie a validator to the second calendar input in order to access the first component internally and compare dates. Here it is my xhtml page: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html

Target Unreachable, identifier 'demoBean' resolved to null [duplicate]

旧巷老猫 提交于 2019-12-11 04:03:22
问题 This question already has answers here : Identifying and solving javax.el.PropertyNotFoundException: Target Unreachable (14 answers) Closed 4 years ago . I am developing a web application using JSF on Netbeans 7.0. I have created 2 pages: one for entering persons name and other to display that name. I am using a java bean with get and set methods. I get an error when I submit my form on first page the code. This is my first page index.xhtml to accept name: <h:form> Enter your Name : <h