ajax4jsf

#{…} is not allowed in template text

自古美人都是妖i 提交于 2019-11-26 21:01:54
<a4j:ajax event="click" render="tempval" listener="#{question.setParameters}" /> When we are using this code, the server throws an exception with the message #{...} is not allowed in template text How is this caused and how can I solve it? BalusC You will get this error when you're using JSP as view technology and you're using #{...} in template text such as (the <p> is just examplary, it can be any plain HTML element): <p>#{bean.property}</p> It's namely not supported in JSP, but it is supported in its successor Facelets. In JSP, you would need to explicitly use <h:outputText> : <p><h

Migrating JSF 1.1 with Ajax4jsf 1.x to JSF 2

风格不统一 提交于 2019-11-26 18:27:13
问题 We are migrating JSF 1.1 (MyFaces) project to JSF 2. The idea is to migrate periodically by keeping both JSP and XHTML together for some time. We use many ajax4jsf-1.1.1 tags in JSP pages. We don't use RichFaces. After configuring the system to JSF 2 (with all config changes mentioned in tutorial by Balusc) When tried to access the JSP page with ajax4jsf.jar in classpath, we get an exception: Caused by: java.lang.IllegalStateException: setViewHandler may not be executed after a lifecycle

<a4j:commandbutton> action is only invoked on second click

风流意气都作罢 提交于 2019-11-26 14:00:01
问题 I want to submit a data table on a button click, but that action is not called on the first click. Here is my code: <h:panelGrid id="addToThisDepartmentPanel"> <h:outputText value="#{messageDataBean.message}" rendered="#{messageDataBean.isSuccess eq false}" style="color:red" id="addToThisDepartmentMessage"/> <h:form> <h:dataTable value="#{systemResultViewUtil.systemUserDetailDataBeansList}" var="departmentdetail" id="addToThisDepartmentDataTable" rendered="#{systemResultViewUtil

Input fields hold previous values only if validation failed

随声附和 提交于 2019-11-26 11:03:27
问题 I came up with a strange problem. I tried to isolate the problem so following is my simplified code. public class MyBean { private List<Data> dataList; Data selectedData; public MyBean() { dataList = new ArrayList<Data>(); dataList.add(new Data(\"John\", 16)); dataList.add(new Data(\"William\", 25)); } public List<Data> getDataList() { return dataList; } public void edit(Data data) { selectedData = data; } public void newData() { selectedData = new Data(null, null); } public Data