ajax4jsf

Cannot click hidden button by JavaScript

与世无争的帅哥 提交于 2019-12-10 00:47:34
问题 function openEditDialog(){ window.showModalDialog('/atmew/pages/asset/searchInclude/assetEdit.mew'); document.getElementById('reData').click(); alert('after rerender'); } then there is a button: <a4j:commandLink id="edit" action="#{searchController.openAssetEdit}" oncomplete="openEditDialog()" immediate="true" ajaxSingle="true"> <h:graphicImage url="/images/edit_icon.png" </h:graphicImage> <f:param name="arId" id="arId" value="#{vo.assetReceiving.id}"/> </a4j:commandLink> The Other button

How to pass a parameter value to a4j:jsFunction

左心房为你撑大大i 提交于 2019-12-08 21:57:49
问题 On my page I have a button that opens a list of items in a popup. When I select 1 item in the list, I want to pass the id of the item to the backingbean of my first page. Is it possible? It tried to do it with a4j:jsFunction and a4j:param but it does'nt work. This is my code: page 1: <a4j:jsFunction name="renderGuarantor" render="guarantor" actionListener="#{prospectDetail.setNewGuarantor}"> <a4j:param name="param1" assignTo="#{prospectDetail.newGuarantorId}" /> </a4j:jsFunction> popuppage:

JSF - Richfaces, process submitted form data and then confirm to continue or cancel

試著忘記壹切 提交于 2019-12-08 08:59:47
问题 I want to show a confirmation dialog to continiue or cancel a save operation when a form is submitted. I have a form with a save button which is calling an action methode to persist data in the form. When save button is clicked, a file will be readed on serverside before the form data is persisted. Data from the file will be joined into form data and then te form data will be persisted. I need some values from the form to define which file will be readed. There is no problem so far. When a

How to pass an argument to method from rendered h:outputText?

匆匆过客 提交于 2019-12-08 07:27:27
I am displaying a table of data from an sql query and want to render a section of code based on one of the field values from this sql query. View: records.xthml <table> <thead> <tr> <td>#{messages['table.header.id']}</td> <td>#{messages['table.header.name']}</td> <td>#{messages['table.header.date.added']}</td> <td> </td> </tr> </thead> <tbody> <a4j:repeat value="recordListBean.records" var="listedRecord" rowKeyVar="index"> <tr> <td><h:outputText value="#{listedRecord.id}</td> <td><h:outputText value="#{listedRecord.name}</td> <td> <h:outputText value="#{listedRecord.dateAdded}" rendered="#

How to pass an argument to method from rendered h:outputText?

扶醉桌前 提交于 2019-12-08 04:26:15
问题 I am displaying a table of data from an sql query and want to render a section of code based on one of the field values from this sql query. View: records.xthml <table> <thead> <tr> <td>#{messages['table.header.id']}</td> <td>#{messages['table.header.name']}</td> <td>#{messages['table.header.date.added']}</td> <td> </td> </tr> </thead> <tbody> <a4j:repeat value="recordListBean.records" var="listedRecord" rowKeyVar="index"> <tr> <td><h:outputText value="#{listedRecord.id}</td> <td><h

ReRender an uploaded image (a4j:mediaOutput)

一世执手 提交于 2019-12-08 03:30:38
问题 I would like to display an uploaded image via ajax (in a a4j:mediaOuput tag) after uploading but I can't rerender the a4j:mediaOutput tag: <h:form enctype="multipart/form-data"> <a4j:jsFunction name="refreshPic" reRender="picHolder" /> <p:fileUpload mode="advanced" fileLimit="1" multiple="false" allowTypes="/(\.|\/)(gif|jpe?g|png)$/" auto="true" fileUploadListener="#{createSopController.fileChanged}" oncomplete="refreshPic()" /> <a4j:outputPanel id="picHolder"> <a4j:mediaOutput id="pic"

JQuery, JSF and a4j:commandLink

强颜欢笑 提交于 2019-12-08 01:01:56
问题 I have a problem with using jQuery Dialog and Ajax submit in JSF. I have the following code for displaying Dialog windows: <script type="text/javascript"> jQuery(function(){ // Dialog jQuery('#dialog').dialog({ dialogClass: 'alert', autoOpen: false, width: 300, height: 150, modal: true, resizable: false, overlay: { backgroundColor: '#000', opacity: 0.5 }, buttons: { "Ok": function() { jQuery(this).dialog("close"); return true; }, "Cancel": function() { jQuery(this).dialog("close"); return

How can I call a JavaScript function after every a4j AJAX response?

 ̄綄美尐妖づ 提交于 2019-12-07 07:54:49
问题 I am working on a web app using JSF w/Seam. I want to be able to call a JavaScript function after every ajax response. I'm looking for a way to do this without putting an oncomplete attribute on every commandLink/commandButton on every page. I think there's a way to set up a servlet filter (interceptor? I get the terms confused) to inject the JS call into each response. I'm going to look into that. In the meantime, if anyone has any other suggestions, I'm all ears. EDIT: I think the jQuery

Passing action in <rich:modalPanel>

跟風遠走 提交于 2019-12-06 22:01:38
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="message" assignTo="#{popupBean.message}" value="#{myBean.message}" /> </a4j:commandButton> But is

JSF field highlighting with ajax posts?

北慕城南 提交于 2019-12-06 20:03:27
I'm building on BalusC's solution to highlight and focus fields in JSF. My plan is to output a JSON array with ids and then have a method be called which will process this array. This works fine when I don't use <f:ajax/> Here is my phase listener solution: public void beforePhase(PhaseEvent event) { FacesContext facesContext = event.getFacesContext(); List<String> highlightFields = new ArrayList<String>(); Iterator<String> highlightFieldsItr = facesContext .getClientIdsWithMessages(); while (highlightFieldsItr.hasNext()) { StringBuilder sb = new StringBuilder(); sb.append("#"); sb.append