ajax4jsf

Calling another a4j:jsFunction in an a4j:jsFunction oncomplete event

故事扮演 提交于 2019-12-24 19:13:33
问题 I define some java script function which will call the back-end functions using a4j:jsFunction.For example : <a4j:jsFunction name="function1" action="#{Bean1.action1}" oncomplete="function2();"/> <a4j:jsFunction name="function2" action="#{Bean1.action2}" oncomplete="SomeJSFunc2();"/> Then in the a4j:commandButton , I set the onclick property to call my defined function like it: <a4j:commandButton onclick="function1" oncomplete="SomeJSFunc3();"> When the a4j:commandButton is clicked , #{Bean1

How to get component value from ActionEvent object?

拈花ヽ惹草 提交于 2019-12-24 14:26:19
问题 i am using ajax4jsf with jsf 1.1 and i have code like: <h:selectOneMenu id="INPUT_PO_DocCategory" binding="#{PrinceOfficeBean.PO_DocCategory}" style="width:200px;"> <f:selectItem itemLabel="test" itemValue="123"/> <f:selectItem itemLabel="test2" itemValue="456"/> <a4j:support event="onchange" actionListener="#{PrinceOfficeBean.processDocumentCategoryValueChange}" reRender="INPUT_PO_DocType" /> </h:selectOneMenu> this code is static and i can get selectOne value through PO_DocCategory binded

a4j:repeat - Dynamically appending a new element

自闭症网瘾萝莉.ら 提交于 2019-12-24 13:52:17
问题 I'm trying to implement (as part of a larger system) a feature where a user is able to post a message. When the user clicks the post button, I'm using RichFaces and a4j to retrieve the generated post using ajax. I'd rather not have the post show up automatically as soon as the response is returned. Rather, I'd like to add an output panel inside a hidden div. When the user clicks on the post button, that output panel will be populated but obviously hidden from the user. What I would like to do

Passing action in <rich:modalPanel>

僤鯓⒐⒋嵵緔 提交于 2019-12-23 03:13:19
问题 There is some way to pass action in <rich:modalPanel> . I want to write simple popup with "Yes" and "No" button, and I want to reuse this popup in different pages, that's why I need that different action was invoked when "Yes" button pressed. There is a way to pass some value in <rich:modalPanel> with <a4j:actionparam> : <a4j:commandButton value="See details…" id="det" reRender="popup_dataIdField, …"> <rich:componentControl for="popup" operation="show" event="onclick" /> <a4j:actionparam name

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

老子叫甜甜 提交于 2019-12-19 04:21:52
问题 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:

a4j:support tag not found using JSF 2

旧城冷巷雨未停 提交于 2019-12-19 02:06:31
问题 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:

#{…} is not allowed in template text

自作多情 提交于 2019-12-17 05:11:31
问题 <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? 回答1: 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

Ajax not working JSF 2.2

孤人 提交于 2019-12-13 06:28:27
问题 I'm using JSF 2.2 with TomCat 6. When I execute an ajax function the fields are not updated. I created a new project with just one controller and page even so, the ajax calls doesn't work. It calls the method but doesn't update the page. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html 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:/

Using JSF AJAX methods to keep JavaScript module scope

梦想与她 提交于 2019-12-12 23:39:03
问题 I am working with the application, which has JSF2 framework. The idea of that framework is to manage connection between Backend (Java) and Frontend. I know, that JSF version we are using creates jsf.ajax object in a DOM, which holds several methods for performing passing and getting data. And so, as I am building Frontend architecture based on modules pattern which has private scope each. Inside several modules I need to make AJAX call to get some data from Backend, but if I am using standart

Is it possible to use <c:if> inside <a4j:repeat>

雨燕双飞 提交于 2019-12-12 20:59:34
问题 Is it possible to use <c:if> inside <a4j:repeat> ? I need to render a <br /> each 4 elements. I tried the following approach: <a4j:repeat value="#{MBean.sucursal.events}" var="item" rowKeyVar="idx" > <h:outputText value="#{item.eventDescription}" id="item1" /> <c: if test=#{idx % 4 == 0}> <br /> </c:if> </a4j:repeat> However, it does not render the <br /> elements at all. How can I achieve the requirement anyway? 回答1: Note: I'll ignore the careless formulation of the code which causes that it