richfaces

JSF/RichFaces: conditional text styling

女生的网名这么多〃 提交于 2019-12-03 16:27:03
问题 I have a string which can be yes or no, instantiated in an object in a Java backing bean. I can't seem to find the best way to conditionally style the text red or green dependent on whether the JSF gets yes or no from the bean respectively. I'm using richfaces, but should I be using <c:if> tags? 回答1: (in order of preference): style="color: #{yourVar == 'yes' ? 'green' : 'red'};" make two <h:outputText> components with different styles, each with a different rendered attribute (one #{yourVar =

How to rerender part of page with form in JSF 2.0?

戏子无情 提交于 2019-12-03 14:57:01
Currently we're trying to move to JSF 2.0 from JSF 1.2 and one of the problem we've faced is that it's impossible to rerender part of the page that contains form. Like this (rerender outerDiv or forms themselves): <h:panelGroup id="outerDiv"> <h:form id="form1">...</h:form> <h:form id="form2">...</h:form> </h:panelGroup> I mean that if i update outerDiv everything is updated but the form (or forms) itself becomes broken and behaves strangely, at least ajax calls either don't work when first time triggered or instead of calling some bean's method they create new instance of that bean and do

File upload using RichFaces

巧了我就是萌 提交于 2019-12-03 13:58:46
问题 I am currently looking in to some file uploading using Java Server Faces. I've found this great introduction to it using RichFaces. However, I have some troubles understanding the process here. First the user selects a file and if the immediate upload is set to true the file is processed using ajax, so far so good. When it comes to the next step however, the listener on the Bean-side the following confuses me: public void listener(UploadEvent event) throws Exception{ UploadItem item = event

How to mix annotations with faces-config.xml

爷,独闯天下 提交于 2019-12-03 13:55:24
问题 Using JBoss 6.0.0.Final, Richfaces 3.3.3.Final, MyFaces 2.0.6, facelets 1.1.15.B1 (a limitation of RF 3). I'm on a legacy project which contains hundreds of beans defined in faces-config.xml . I'd like to keep those defined in faces-config.xml but use annotations for new beans. However, when I've tried this I've not had success. The beans defined by annotation i.e. @ManagedBean @ViewScoped public class Foobar implements Serializable { // ... } The bean is not accessible from my JSF page. I

Is rich:fileUpload component in (RC 4.3.4) working on Apache Tomcat7 and JSF 2.2 ? : “Request prolog cannot be read”

大憨熊 提交于 2019-12-03 13:53:11
问题 I'm trying to upload a file with richfaces fileupload component. My bean is in a viewscoped. My code extracted from the showcase. <rich:fileUpload id="upload" immediateUpload="true" fileUploadListener="#{analyse.listener}" acceptedTypes="png" ontyperejected="alert('Seulement les fichiers avec l'extension bam et pdf sont acceptés.');" maxFilesQuantity="3"> <a4j:ajax event="uploadcomplete" execute="@none" /> </rich:fileUpload> The bean function called : public void listener(FileUploadEvent

Server-side DataTable Sorting in RichFaces

混江龙づ霸主 提交于 2019-12-03 13:06:59
I have a data table with a variable number of columns and a data scroller. How can I enable server side sorting? I prefer that it be fired by the user clicking the column header. <rich:datascroller for="instanceList" actionListener="#{pageDataModel.pageChange}"/> <rich:dataTable id="instanceList" rows="10" value="#{pageDataModel}" var="fieldValues" rowKeyVar="rowKey"> <rich:columns value="#{pageDataModel.columnNames}" var="column" index="idx"> <f:facet name="header"> <h:outputText value="#{column}"/> </f:facet> <h:outputText value="#{classFieldValues[idx]}" /> </rich:columns> </rich:dataTable>

rich:datatable rowspan issue

∥☆過路亽.° 提交于 2019-12-03 12:38:53
I need to create a rich:dataTable (or even extended) with the following features: I have a class Company having a collection of Product objects. I want to show the following table: I still have not figured out how to do this with a subtable (in all the examples I found the subTable has the exact same columns as the master table). Presumably, I need to play with rowspans in the first two columns, but I still have not found the way. Could someone provide a pseudo-code for this? Cheers! UPDATE 1: I tried set the rowspan of the columns in the left as the size of the list or products, and then : if

Richfaces collapsiblePanel randomly causes javascript error in Chrome

我是研究僧i 提交于 2019-12-03 09:13:37
I'm working on a complex web application with RichFaces 4.5.13.Final and JSF 2.1 on JBoss EAP 6.4. Some pages containing a collapsiblePanel like this <h:form id="myForm"> <rich:collapsiblePanel id="myPanel" header="Header" switchType="client"> <h:outputText value="Test" /> </rich:collapsiblePanel> </h:form> In Google Chrome (tested with Version 57.0.2987.110 (64-bit)) we've noticed a strange javascript error after page load. This error occurs randomly but not always: Uncaught TypeError: Cannot read property 'getItems' of undefined at init (togglePanelItem.js:43) at new init

Absolute reRendering using RichFaces

和自甴很熟 提交于 2019-12-03 08:57:29
My problem is that RichFaces reRender does not work 'under' the current element in the element tree; only upper elements get rerendered. Is there any way to access lower elements with AJAX? Any help would be appreciated! Daniel EDIT I edited this question to a more general one. See revisions if interested in the original question. reRender works with providing an the id of the target object you want to reRender (inside the same naming container - form most often) the id should be a unique string, according to html spec reRender allows dynamic value - i.e. reRender="#{myBean

How to conditionally style a row in a rich:dataTable

心不动则不痛 提交于 2019-12-03 05:43:11
How can I change the style of a particular row based on a condition? I can use JSF EL in rich:column style class attribute, but I have to write for each column. I want to change the entire row. Thanks I do as you've already mentioned and put the style on the column. However you could always try wrapping all of your columns in a <rich:columnGroup> which is supposed to output a <tr> and place your conditional style on that. EDIT: (in response to comment): if the header facets in your columns are being broken then you can separate them into a column group as well. Should work - you may not even