primefaces

Updating ui:defined form content from Master template (JSF & Primefaces)

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-14 03:15:14
问题 I am having a little trouble with my web-app, essentially I keep getting an warning message: INFO: Cannot find component with identifier "formName" in view. I know why this is happening, but I just need to determine if their is a fix/better solution. Basically I have a master template file that contains a number of <p:dialog> components, which have various CRUD capabilities. When a user interacts with these components I use the inbuilt primefaces 'update' function to ajaxically update the

AsyncSupportListenerAdapter primefaces exception

一笑奈何 提交于 2020-01-13 18:14:20
问题 I am new at jsf , and i am trying to do some examples usinf primefaces and when i try to run this one , http://www.primefaces.org/showcase-labs/push/chat.jsf i am getting an exception like this. SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/primefaces] threw exception [org/atmosphere/cpr/AsyncSupportListenerAdapter] with root cause java.lang.ClassNotFoundException: org.atmosphere.cpr.AsyncSupportListenerAdapter I think i have to have an atmosphere jar file but i

PrimeFaces Theme does not apply (maven)

ぃ、小莉子 提交于 2020-01-13 18:09:13
问题 I am trying to change the default theme (aristo) of my web application to "cupertino". I followed several tutorials without any success. I used the following instruction from https://www.primefaces.org/documentation/ : Picture of instruction but the theme did not change I am using - Spring Framework - Maven - Eclipse - Primefaces 5.3 Here is my whole web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema

PrimeFaces Extensions CKEditor: attempts to set encoding to UTF-8 unsuccessful

北城以北 提交于 2020-01-13 13:31:30
问题 Why I am using this editor: In the past I used PrimeFaces p:editor which is however deprecated and lacks functions that the users desperately want. I cannot use the new PrimeFaces p:textEditor because of this: Primefaces textEditor: converting text to HTML with JavaScript not working. What is it used for: I am using pe:ckEditor from PrimeFaces Extensions in my program, in which the editor is used by the user to create an e-mail message content. Then by click on a send button, the HTML from

Can I add/remove Primefaces components dynamically?

安稳与你 提交于 2020-01-13 13:14:12
问题 How can I add/ remove the primefaces inputText dynamically? 回答1: To add/remove textboxes, try the following snippets. <h:panelGrid columns="1" cellpadding="10"> <h:commandButton value="+" action="#{contactBean.addPhone}" image="../images/addbtn.png" /> <p:dataTable border="0" value="#{contactBean.phoneNos}" var="p" rowIndexVar="rowIndex" emptyMessage="No phone numbers entered"> <p:column> <h:selectOneMenu id="extraTask1" value="#{p.phoneType}"> <f:selectItem itemLabel="Select" itemValue="" />

Can I add/remove Primefaces components dynamically?

最后都变了- 提交于 2020-01-13 13:13:45
问题 How can I add/ remove the primefaces inputText dynamically? 回答1: To add/remove textboxes, try the following snippets. <h:panelGrid columns="1" cellpadding="10"> <h:commandButton value="+" action="#{contactBean.addPhone}" image="../images/addbtn.png" /> <p:dataTable border="0" value="#{contactBean.phoneNos}" var="p" rowIndexVar="rowIndex" emptyMessage="No phone numbers entered"> <p:column> <h:selectOneMenu id="extraTask1" value="#{p.phoneType}"> <f:selectItem itemLabel="Select" itemValue="" />

Mocking type-casting objects

核能气质少年 提交于 2020-01-13 10:13:11
问题 I have a simple method in my bean to handle cell edit event in primefaces datatable. Method looks like this: public void onCellEdit(CellEditEvent event) { Object oldValue = event.getOldValue(); Object newValue = event.getNewValue(); User user = (User) ((DataTable) event.getComponent()).getRowData(); if (!newValue.equals(oldValue)) user.setUsername(oldValue.toString()); .... } How do I mock this: User user = (User) ((DataTable) event.getComponent()).getRowData(); 回答1: CellEditEvent mockEvent =

Command buttons invokes actions on second push (jsf)

核能气质少年 提交于 2020-01-13 09:23:13
问题 I came to strange behaviour of my application. Command buttons start to invoke actions on second hit. On first - nothing happens. It takes effect on firefox and chromium, but in epiphany works as usual. My environment: - ubuntu 11.04 - glassfish 3.1.1 - jsf 2.X - primefaces 3.2 - firefox 12.0 - epiphany 2.30.6 Code example: <ui:define name="content"> <h:form id="form"> <h:panelGrid id="panelGrid" columns="3"> <h:outputText value="#{msg.fieUserName}:"/> <h:inputText id="name" value="#{userBb

How to position a p:dialog in Prime Faces after its resizing

为君一笑 提交于 2020-01-13 08:35:51
问题 I have a Prime Faces p:dialog that has been resized while new components are inserted when opened ('show' state). However its position doesn't change and it's size is increasing from the down left corner until the page bottom. I need to reposition it every time I render new components dynamically. Is there any JavaScript function I can call to its widget to reposition? I'm using PrimeFaces 3.5 with Mojarra 2.1.13. 回答1: This is a method that should work in your case : Bean code : @ManagedBean

p:commandButton does not perform the operation with a single click

寵の児 提交于 2020-01-13 06:50:07
问题 p:commandButton does not perform the operation with a single click I have the following table <p:dataTable id="firmasTabla" var="car" editable="true" editMode="cell" value="#{clientesMB.itemsPersonaFirmanUtil}" widgetVar="carsTable"> <p:ajax event="cellEdit" listener="#{clientesMB.modiCellPersonaFirma}" update=":form2:growl" /> <p:column headerText="Nro CI" style="width:30%"> <p:cellEditor> <f:facet name="output"><h:outputText value="#{car.ci}" /></f:facet> <f:facet name="input"><p:inputText