richfaces

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:

Why PostConstruct method is called several times inside an RichFaces 4.3 component with a ViewScoped?

倖福魔咒の 提交于 2019-12-08 13:34:41
问题 I 'm facing a problem with JSF 2.2, richfaces 4.3.2 on Tomcat 7 . My page is annoted ViewScoped . I display a first form. When i change the value and select a specific one , i display by ajax a rich:panel element inside an a4j:outputPanel . Inside this a4j:outputPanel and rich:panel component, i have a h:commandButton who execute the forms. I want to retrieve messages error for the form if the fields are empty for example (or other stuffs) But when i click h:commandButton , the view is re

How to display message about maximum file size restriction in RichFaces 4 fileUpload component

泪湿孤枕 提交于 2019-12-08 13:13:04
问题 I have implemented a file upload using RichFaces 4.3. File upload works fine, alert about file types works fine, but alert about max file size restriction doesn't. File upload code: <rich:fileUpload id="bannerUpload" fileUploadListener="#{bean.bannerListener}" acceptedTypes="png, gif, jpg, jpeg" ontyperejected="alert('#{msg.bannerFormatRestriction}');" maxFilesQuantity="1" sizeExceededLabel="File size is restricted. Max allowed size is 1 MB." serverErrorLabel="File was not uploaded. Please

Highlight current week in RichFaces calendar

我怕爱的太早我们不能终老 提交于 2019-12-08 12:39:20
问题 Is there a way to highlight the current or selected week in a RichFaces calendar? <rich:calendar value="#{oc.overtimeDate}" requiredMessage="Date 1 is required." id="#{oc.overtimeDateId}" isDayEnabled="isDayEnabled" dayStyleClass="getDisabledStyle" datePattern="MM-dd-yyyy" required="true" firstWeekDay="0"/> 回答1: <rich:calendar> has @dayClassFunction (see the docs) It can look like this: <h:outputStylesheet> .highlightWeek { color: red; background-color: black; } </h:outputStylesheet> <h

JSF 1.2 app not working with GlassFish v3

与世无争的帅哥 提交于 2019-12-08 11:50:29
问题 Migrating to GlassFish v3 / JDK6u18 / NB6.8 makes me a lot of headscratching, and I'm quite confused now. My project (JSF, RichFaces, Spring) works fine with GlassFish v2 + JDK6u17. I'm using the same JAR's, and the same JSF version. One of my JSP's contains a <rich:tree> , this renders just fine, but if I post the values on this page I get: WARNING: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception java.lang.IllegalArgumentException: In

Creating dynamic inputs in jsf2

大城市里の小女人 提交于 2019-12-08 11:48:18
问题 i want to create dynamic textbox in jsf2 in datatable having textboxes based on clicking add row button. Iam a newbie for jsf programming.Can someone tell me a basic example for dynamic for generation . I have read ui:repeat and c:foreach but i need some practical example. 回答1: For your sample, xhtml code: <?xml version='1.0' encoding='UTF-8' ?> <!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

Richfaces Datatable - Sort specific column on load

泄露秘密 提交于 2019-12-08 10:26:23
问题 Is it possible to sort a datatable by a specific column when it first loads? Or does it need to be done using the DAO? When I put on ORDER BY in my SQL in my DAO, no data at all is returned in the datatable 回答1: Solved it used sortOrder="DESCENDING" or sortOrder="ASCENDING" on the column you wish to have sorted when datatable first loads 回答2: Just need to add this to options: "aaSorting": [[ 5, "desc" ]] 来源: https://stackoverflow.com/questions/3787778/richfaces-datatable-sort-specific-column

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

RichFaces fileUpload not reRendering

 ̄綄美尐妖づ 提交于 2019-12-08 07:53:22
问题 I'm trying to rerender a couple of components following the upload of a file (a photo) but for some reason, upon completion of the upload, the components are not being rerendered. Could anyone please help? I'm using Java 1.6 JSF 1.2 Richfaces 3.3.3 Seam 2.2GA on a 64 bit Windows 7 machine running the app in Tomcat 6; <h:panelGrid columns="2" id="photoGrid" rendered="#{not signUpAction.fileUpRendered}" styleClass="standard"> <h:graphicImage value="#{signUpAction.imageUrl}" width="150" height=

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="#