richfaces

change background color of a row in rich:dataTable

一个人想着一个人 提交于 2019-12-02 11:53:06
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? 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}" /> </rich:column> <a4j:support event="onRowClick" oncomplete="highlightSingleRow(this)"/> </rich

Expression Error: Named Object: javax.faces.convert.IntegerConverter not found

帅比萌擦擦* 提交于 2019-12-02 11:19:20
问题 Following is my code <rich:select id="cycle_group" value="#{menuCycleBean.menuCycleDetailTO.menuCycleGroupId}" defaultLabel="#{msg['gobal.select.default.label']}" converter="javax.faces.convert.IntegerConverter"> <f:selectItems value="#{menuCycleBean.cycleGroupList}" var="n" itemLabel="#{n.label}" itemValue="#{n.id}" /> </rich:select> "menuCycleGroupId" is "Integer" Value and "n.id" is "String" value. I need to convert String to Integer. I am using following attribute converter="javax.faces

Conditionally including a Facelet file via <ui:include>

青春壹個敷衍的年華 提交于 2019-12-02 10:40:09
I have 2 Facelets files (index.xhtml and report.xhtml). I use the RichFaces <ui:include src="report.xhtml"/> to load the report into the index. Works fine. But when I try to only show report on certain conditions, I fail! What does not work is this: <ui:include src="report.xhtml" rendered="#{indexService.contentName == 'report'}"/> . The rendered attribute of ui:include does not seem to work. How can I load the report.xhtml into the index.xhtml on certain conditions? Where is the error in my code? Edit: Half of it works now. Changing the Facelet file works with conditions. But the

how to display rich content using jsf component?

旧巷老猫 提交于 2019-12-02 10:20:36
I used the rich: editor component to enter rich content and I save it in a database. When I tried to display it in outputText field , rich tags are not interpreted and are displayed as simple text. So my question is: how can I make the jsf component (or Richfaces) interpret this rich content and display it properly?? The h:outputText indeed by default escapes predefined XML/HTML entities to avoid XSS attacks . If you want to display user-controlled input unescaped, then just set the escape attribute to false . <h:outputText value="#{bean.text}" escape="false" /> However, keep potential XSS

Using backing bean value in javascript

牧云@^-^@ 提交于 2019-12-02 10:16:37
<h:form prependId="false" id="vt_sel_form"> <p:panelGrid styleClass="center" columns="2"> <p:commandButton value="GO" oncomplete="alert(#{test.i})" actionListener="#{test.testfxn()}" update="@this"/> </p:panelGrid> </h:form> import java.io.Serializable; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; @ViewScoped @ManagedBean(name = "test") public class TestClass implements Serializable { int i ; public int getI() { return i; } public void setI(int i) { this.i = i; } public void testfxn() { setI(i++); //i=i+10; System.out.println("i" + i); } } Here, alert(#{test.i}) is

JSF/Hibernate NotBlank validation

随声附和 提交于 2019-12-02 09:37:56
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 from jsr303 and hibernate, but they both failed I still can send a blank string like " ". If you use

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

霸气de小男生 提交于 2019-12-02 09:18:19
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="showAnfrage" action="#{bean.showAnfrage}" /> The method in the bean gets called but the selection (the row

a4j:mediaOutput not rendering PDF

落爺英雄遲暮 提交于 2019-12-02 09:07:31
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" operation="show" event="onclick" /> </h:outputLink> <rich:modalPanel id="panel" width="350" height="100"> <f

Servlet Faces Servlet is not available (richfaces 4,tomcat 7)

一世执手 提交于 2019-12-02 08:05:55
问题 I am trying out my first richfaces project. So I created a new JSF project (using JBoss Tools eclipse plugin) with the following options selected: JSF2.0 JSFKickStartWithoutLibs I did no changes to generated sample.The exported WAR file contains the following libraries /WEB-INF/lib/common-annotations.jar /WEB-INF/lib/commons-beanutils.jar /WEB-INF/lib/commons-collections.jar /WEB-INF/lib/commons-digester.jar /WEB-INF/lib/commons-logging.jar /WEB-INF/lib/cssparser-0.9.5.jar /WEB-INF/lib/guava

JSF RichTable merging rows / columns in a header

﹥>﹥吖頭↗ 提交于 2019-12-02 07:46:15
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 looks like this: <rich:dataTable id="mydatatable" value="#{applicationListBean.data}" > <f:facet name=