richfaces

JSF/RichFaces: conditional text styling

妖精的绣舞 提交于 2019-12-03 05:40:13
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? (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 == 'yes'} and the other #{yourVar == 'no'} ) define a (jstl/facelets/jsf 2.0) function that takes the var as

File upload using RichFaces

偶尔善良 提交于 2019-12-03 03:09:17
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.getUploadItem(); File f = item.getFile(); System.out.println(f.getAbsolutePath()); } The Absolute path

JSF/Hibernate NotBlank validation

只谈情不闲聊 提交于 2019-12-02 17:59:52
问题 I have a simple JSF+RichFaces form with some fields and obviously a backing bean to store them. In that bean all the necessary properties have validation annotations (jsr303/hibernate), but I can't seem to find an annotation which would check if the property (String) is blank. I know there's a @NotBlank annotation in spring modules, but JSF doesn't support spring validation. Is there any easy way to check it or should I write my own annotation? @Edit: I already tried @NotNull and @NotEmpty

JSF RichTable merging rows / columns in a header

人盡茶涼 提交于 2019-12-02 17:59:29
问题 What I want to do is do this layout with RichTable in its header to have 3 columns: +---+---+-------+ | | | 3 5 | | 1 | 2 |-------+ | | | 4 6 | +---+---+-------+ I got used this (8.2) resource to get it done. Rich-faces 4.0.0 But instead I end up having plain table-row with no any merging. Could you please shed a light on this? Update: About the answer from Vasil Lukach . In my case (if I do copy paste of those code), I have this result (I use hard coded values to keep it simple): My code

change background color of a row in rich:dataTable

ぐ巨炮叔叔 提交于 2019-12-02 17:38:44
问题 i have a row in rich:datatable, which has a link in one of its column. Onclick of this click i need to change the background color of the selected row. how can i achieve this? 回答1: You can do this with the following code: <a4j:form id="myfrm"> <rich:dataTable id="myTbl" value="#{myBean.tblData}" var="tblData"> <rich:column> <f:facet name="header">Col1</f:facet> <h:outputText value="#{tblData}" /> </rich:column> <rich:column> <f:facet name="header">Col2</f:facet> <h:outputText value="#{tblData

difference between JSF, RichFaces, PrimeFaces and IceFaces

家住魔仙堡 提交于 2019-12-02 17:33:47
I am new to jsf and want to know about the clear difference between JSF, Rich-/Prime-/IceFaces. In JSF we create pages with .jsp extension and write java code in the backing beans. But how exactly all "faces" are different and related to jsf. I think if you put it very simply . ref : Source JSF is a request-driven MVC web framework for constructing user interfaces using components. And PrimeFaces/RichFaces/IceFaces are components/JSF libraries that you can use on top of JSF RichFaces : is an open source Ajax-enabled component library for JavaServer Faces ICEfaces , open-source, Java JSF

a4j:mediaOutput not rendering PDF

风流意气都作罢 提交于 2019-12-02 17:29:01
问题 I have a task of displaying a PDF fetched from the database as a pop up in my JSF application upon clicking a link. However my modal panel isn't rendering the PDF. Instead I get a small dark grey box at the top left corner of the panel. Here's my XHTML code: <rich:column styleClass="viewUserTable"> <f:facet name="header"> <h:outputText value="Pdf" /> </f:facet> <h:outputLink value="#" id="link" style="color:blue;margin: 0 auto;"> Proof <rich:componentControl for="panel" attachTo="link"

Get selected item when double clicking on a Richfaces extendedDataTable in JSF2

最后都变了- 提交于 2019-12-02 14:56:38
问题 In my JSF 2 application I have a Richfaces extendedDataTable. When I doubleclick on a row I want to leave this page and I will display the details of the selected table entry on this other page. I tryied the following in the table page: <rich:extendedDataTable value="#{bean.loadedAnfragen}" var="anfrage" selection="#{bean.selectedAnfrage}" id="anfragenTable" selectionMode="single" onrowdblclick="showAnfrage();"> ... here are my columns ... </rich:extendedDataTable> <a4j:jsFunction name=

JSF2.0 + Richfaces 3.3.3, jsp not found error

独自空忆成欢 提交于 2019-12-02 14:55:01
问题 I created simple project using JSF2.0 + Richfaces3.3.3 + tomcat6.0.29 in Netbeans6.9.1 Step1 : File -> NewProject + Select JSF 2.0 + Prefered Page Language as JSP Step 2: Jar JSF2.0 jsf-api.jar JSF2.0 jsf-impl.jar JSTL1.1 - Standard.jar JSTL1.1 - jstl.jar jsf-facelets.jar (Facelets 1. 1. 15) richfaces-api-3.3.3.Final.jar richfaces-ui-3.3.3.Final.jar richfaces-impl-jsf2-3.3. 3.Final.jar commons-beanutils-1.8.3.jar commons-collections-3.2. 1.jar commons-digester-2.0.jar commons-logging-1.1.1

How to pass parameters to ui:include that inside of c:forEach tag

女生的网名这么多〃 提交于 2019-12-02 14:54:31
问题 We are trying to create a list with iterating an entity with ui:include. my .xhtml file is like; <c:forEach items="#{entityHome.list}" var="entityId"> <ui:include src="/some.xhtml"> <ui:param name="id" value="#{entityId}" /> </ui:include> </c:forEach> We have already created a .xhtml file to visualize single entity. Not we want a list of all entities. Firstly we were using a h:dataGrid but according to this we changed it to c:forEach . Now when page is rendered, fields in /some.xhtml are