primefaces

Ajax component updates before actionListener called?

China☆狼群 提交于 2019-12-25 04:05:08
问题 I am using PrimeFaces <p:dialog> to launch a popup html page and <p:commandButton> to close it: This is what I do when Ok button is pressed: <p:commandButton id="submitButton" value="OK" actionListener="#{MultiFileSelectMgmtBean.actionOk}" update=":formID:fileTreeID" oncomplete="dlg1.hide();"/> Problem is that fileTreeID is updated before action listener is done. How do I force actionOk() to be called first, and then fileTreeID to be updated? Edit : The problem is that popup page B (

How to customize the terminal component in Primefaces 2.2.1 for JSF2?

痞子三分冷 提交于 2019-12-25 03:57:09
问题 Hi guys I'd like to ask if there is a way to customize the terminal component in primefaces 2.2.1 ? Id like to change the default prompt which is "prime $" into something else. Also what are the other options for the "cursor" aside from "pointer". Other customization tips regarding the terminal component will be very much appreciated. Thanks in advance. 回答1: change the default prompt which is "prime $" into something else. Read the User Guide or use the IDE autocompletion to see all available

PrimeFaces dialog not working in Chrome browser

谁说我不能喝 提交于 2019-12-25 03:50:17
问题 As you can see I am trying to display a dialog box on click on the command link, the dialog is displayed in IE and Firefox, but not in Google Chrome v23, please suggest. <h:form id="myForm"> <p:tabView id="tabView"> <p:tab id="tab1" title="Tab 1"> <h:panelGrid columns="1" cellpadding="10"> <h:dataTable value="#{testBean.dataList}" var="data"> <h:column> <h:outputText value="#{data}" /> </h:column> <h:column> <p:commandLink action="#{testBean.loadCommentHistory(data)}" update=":myForm:tabView

Submit custom data/inputfield while `p:autocomplete` sends a query for fetching suggestions

一世执手 提交于 2019-12-25 03:39:13
问题 How do I submit some h:inputText field/send custom data while p:autocomplete sends a query for fetching suggestions from server. I tried doing like this: <p:autoComplete completeMethod="..." > <p:ajax event="query" onstart="method1()" process="@this, field1"/> </p:autoComplete> <h:inputHidden id="field1" value="#{search.value2}"/> The field seems to be submitted along with the sent data to the server however the value is not set in managed bean. Probably the process attribute of above p:ajax

Values of h:inputText inside p:treeTable are not processed

只谈情不闲聊 提交于 2019-12-25 03:11:08
问题 I want to process this form (valueChangueListener is not valid in real case). This is the back bean: @Component @Scope("request") public class TestBean extends PrivateBaseBean implements Serializable { protected static final Logger logger = Utils.loggerForThisClass(); private TreeNode root; @PostConstruct public void init() { root = new DefaultTreeNode("root", null); TreeNode child1 = new DefaultTreeNode(new Element("Total"), root); new DefaultTreeNode(new Element("Office"), child1); } public

Primefaces fileUpload only works firts time

早过忘川 提交于 2019-12-25 03:05:07
问题 When I upload a file, I need to update some componentes. It only works first time I do it. XHTML: <p:fileUpload id="Uploader" fileUploadListener="#{cc.attrs.updateImageAction}" mode="advanced" update="#{cc.id}:updatableElements #{cc.attrs.ajaxRender} #{cc.attrs.ajaxRenderCropDialog}" auto="true" multiple="false" sizeLimit="#{cc.attrs.sizeLimit}" allowTypes="#{imageManagerServiceBean.imageFileAllowedTypesRegEx}" label="#{messages['generic.images.select']}" uploadLabel="#{messages['generic

PrimeFaces can't get boolean value from dataTable's selected row

我的未来我决定 提交于 2019-12-25 03:01:32
问题 I have PrimeFaces 3.5, JSF 2.2, Hibernate 4 web app. home.xhtml contains a tabview with nested dataTables for 3 entities (Users, Computer, Applications) and add/edit/delete buttons. Each button is supposed to call a dialog with a form and submit/cancel buttons. The problem is that I can't display correctly boolean value (licenseRequired) from selectedApplication when trying to edit it in the same way as it was set, I get the message: /pages/home.xhtml @424,149 value="#{homeBean

PrimeFaces can't get boolean value from dataTable's selected row

大憨熊 提交于 2019-12-25 03:01:32
问题 I have PrimeFaces 3.5, JSF 2.2, Hibernate 4 web app. home.xhtml contains a tabview with nested dataTables for 3 entities (Users, Computer, Applications) and add/edit/delete buttons. Each button is supposed to call a dialog with a form and submit/cancel buttons. The problem is that I can't display correctly boolean value (licenseRequired) from selectedApplication when trying to edit it in the same way as it was set, I get the message: /pages/home.xhtml @424,149 value="#{homeBean

Calling a JavaScript function from managed bean

烂漫一生 提交于 2019-12-25 02:59:34
问题 Is there a way to call (execute) a JavaScript function from managed bean in JSF? If that's relevant, I'm also using PrimeFaces. 回答1: In PrimeFaces pre 6.2, you can use RequestContext#execute() for this. public void submit() { // ... RequestContext.getCurrentInstance().execute("alert('peek-a-boo');"); } In PrimeFaces 6.2 and up: public void submit() { // ... PrimeFaces.current().executeScript("alert('peek-a-boo');"); } In standard JSF, there is no direct public API for that. Best what you can

Update component in a different window/tab without manually refreshing it

非 Y 不嫁゛ 提交于 2019-12-25 02:57:08
问题 I have different pages with different layouts, for example index.xhtml and user.xhtml, each page has it's own template. If I make a change in user.xhtml I want to update a datatable in index.xhtml. index.xhtml: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:p="http://primefaces.org/ui"> <ui:composition template="/template.xhtml"> <ui:define name="body"> <h:form id=