ajax4jsf

JSF ReRender support with selectBooleanCheckbox

泄露秘密 提交于 2019-12-03 20:52:16
I have a JSF page on which I want to have a checkbox that, when clicked, will add/remove certain other form fields from the page. Here is the (simplified) code I currently have for the checkbox: <h:selectBooleanCheckbox title="showComponentToReRender" value="#{backingBean.showComponentToReRender}"> <a4j:support event="onsubmit" reRender="componentToReRender" /> </h:selectBooleanCheckbox> Here is the code for the component I want to hide: <h:selectOneMenu id="componentToReRender" value="#{backingBean.value}" rendered="#{valuesList.rowCount>1 && backingBean.showComponentToReRender}"> <s

a4j:mediaOutput not rendering PDF

风流意气都作罢 提交于 2019-12-02 17:29:01
问题 I have a task of displaying a PDF fetched from the database as a pop up in my JSF application upon clicking a link. However my modal panel isn't rendering the PDF. Instead I get a small dark grey box at the top left corner of the panel. Here's my XHTML code: <rich:column styleClass="viewUserTable"> <f:facet name="header"> <h:outputText value="Pdf" /> </f:facet> <h:outputLink value="#" id="link" style="color:blue;margin: 0 auto;"> Proof <rich:componentControl for="panel" attachTo="link"

a4j:mediaOutput not rendering PDF

落爺英雄遲暮 提交于 2019-12-02 09:07:31
I have a task of displaying a PDF fetched from the database as a pop up in my JSF application upon clicking a link. However my modal panel isn't rendering the PDF. Instead I get a small dark grey box at the top left corner of the panel. Here's my XHTML code: <rich:column styleClass="viewUserTable"> <f:facet name="header"> <h:outputText value="Pdf" /> </f:facet> <h:outputLink value="#" id="link" style="color:blue;margin: 0 auto;"> Proof <rich:componentControl for="panel" attachTo="link" operation="show" event="onclick" /> </h:outputLink> <rich:modalPanel id="panel" width="350" height="100"> <f

facelets: passing bean name with ui:param to action attribute

偶尔善良 提交于 2019-12-01 01:20:36
Due to some custom components which expect a bean name (NOT the bean instance) in their attributes I need to pass the actual bean name between pages. As the bean itself is also used by non-custom components, I would like to avoid using additional ui:param (like described here Passing action in <rich:modalPanel> ) since it will essentially specify the same bean. Is it possible to specify component's action using bean name provided with ui:param ? Basically I am trying to achieve the following: <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"

a4j:support tag not found using JSF 2

陌路散爱 提交于 2019-11-30 20:14:47
just trying to integrate this commandLink <a4j:commandLink reRender="results-view" actionListener="#{myaction}" oncomplete="return false;" value="#{msg1.advanced_search}"> <a4j:support event="onclick"> <f:setPropertyActionListener value="./page.xhtml" target="#{changeViews['new-view'].value}" /> </a4j:support> </a4j:commandLink> On an applicacion which is using JSF2. If I leave it, I get this error Tag Library supports namespace: http://richfaces.org/a4j , but no tag was defined for name: support I was trying to find something on the net, but I couldn't figure out. Some help would be great.

Disable `<h:commandButton>` after clicked, but action should be fired

倖福魔咒の 提交于 2019-11-30 15:21:40
问题 I have a <h:commandButton> in my XHTML page. I want the button to be disabled as soon as I click the button. Then the button should call the action. My button gets disabled as I expect but the problem is that the action is not fired. <h:commandButton value="Go" onclick="this.disabled=true" action="#{bean.go()}"/> But if I remove the onclick attribute the action is fired. Or if I used an <a4j:commandButton> it works. Following a4j button works. <a4j:commandButton value="Go" onclick="this

Disable `<h:commandButton>` after clicked, but action should be fired

落爺英雄遲暮 提交于 2019-11-30 13:54:35
I have a <h:commandButton> in my XHTML page. I want the button to be disabled as soon as I click the button. Then the button should call the action. My button gets disabled as I expect but the problem is that the action is not fired. <h:commandButton value="Go" onclick="this.disabled=true" action="#{bean.go()}"/> But if I remove the onclick attribute the action is fired. Or if I used an <a4j:commandButton> it works. Following a4j button works. <a4j:commandButton value="Go" onclick="this.disabled=true" action="#{bean.go()}"/> How can I disable a <h:commandButton> after being clicked, so that

Migrating JSF 1.1 with Ajax4jsf 1.x to JSF 2

末鹿安然 提交于 2019-11-27 14:51:09
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 request has been completed at org.apache.myfaces.application.ApplicationImpl.setViewHandler(ApplicationImpl

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

怎甘沉沦 提交于 2019-11-27 08:06:47
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.systemUserDetailDataBeansList.size() gt 0}"> <h:column> <f:facet name="header"> Name </f:facet> <h:outputText value=

Input fields hold previous values only if validation failed

五迷三道 提交于 2019-11-27 04:07:21
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 getSelectedData() { return selectedData; } public class Data { String name; Integer age; Data(String name, Integer age)