richfaces

Print contents of ModalPanel

只谈情不闲聊 提交于 2019-12-20 11:30:50
问题 Is it possible to print just the contents of <rich:modalPanel >? 回答1: Wrap all the content of rich:modalpanel in a div then use following javascript snippet to do your work, of course it is not standard. add a print button in richmodal panel on click call this function of javascript function PrintContent() { var DocumentContainer = document.getElementById('divtoprint'); var WindowObject = window.open("", "PrintWindow", "width=750,height=650,top=50,left=50,toolbars=no,scrollbars=yes,status=no

how to display rich content using jsf component?

故事扮演 提交于 2019-12-20 05:48:05
问题 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?? 回答1: 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

javax.faces.FacesException: java.lang.ClassCastException: java.lang.String cannot be cast to javax.faces.component.UIComponent

筅森魡賤 提交于 2019-12-20 01:34:53
问题 My Java EE web application is working fine with Glassfish 2.1. Now I want to migrate to Glassfish 3.1.1 I have followed the modifications provided here my dependencies for richfaces are as follow:- <dependency> <groupId>org.richfaces.framework</groupId> <artifactId>richfaces-api</artifactId> <version>3.3.3.Final</version> </dependency> <dependency> <groupId>org.richfaces.framework</groupId> <artifactId>richfaces-impl-jsf2</artifactId> <version>3.3.3.Final</version> </dependency> <dependency>

Could not complete the operation due to error c00ce56e

a 夏天 提交于 2019-12-19 16:38:12
问题 I've upgraded from rich faces 3.3 to rich faces 4.2 because ajax didn't work for IE9. Now it still not works. After receiving the Response IE gets an JS error "SCRIPT58734: Der Vorgang konnte aufgrund des folgenden Fehlers nicht fortgesetzt werden: c00ce56e." while trying data.responseText=request.responseText on jsf.js.html?ln=javax.faces&conversationContext=2, Line 1 Row 21747 I think it's because of an incorrecct HTTP header Content-Type: text/xml;charset=UTF8 should be Content-Type: text

Displaying XML in JSF

巧了我就是萌 提交于 2019-12-19 10:16:32
问题 I have a method that gives back a formatted XML string. I want to show that on a JSF page in a nicely wrapped, readable way. I used this solution first. <pre><h:outputText value="myBean.xml"/></pre> The result is indented, but it doesn't wrap very long lines (with a lot of attributes for e.g.) RichFaces is also available in my project. What would you suggest? Thanks in advance, Daniel 回答1: Not sure if I understand you right, but if it is a plain vanilla String with XML data which you want to

a4j:support tag not found using JSF 2

旧城冷巷雨未停 提交于 2019-12-19 02:06:31
问题 just trying to integrate this commandLink <a4j:commandLink reRender="results-view" actionListener="#{myaction}" oncomplete="return false;" value="#{msg1.advanced_search}"> <a4j:support event="onclick"> <f:setPropertyActionListener value="./page.xhtml" target="#{changeViews['new-view'].value}" /> </a4j:support> </a4j:commandLink> On an applicacion which is using JSF2. If I leave it, I get this error Tag Library supports namespace: http://richfaces.org/a4j, but no tag was defined for name:

Using Multiple Resource bundles in JSF

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 12:34:21
问题 I am trying to access multiple resource bundles from a JSF page. I have two resource bundles: general_messages.properties module_message.properties I want to access both these resource bundles in a JSF file. One way I can do this is to define specific properties for each of these bundles: <f:loadBundle basename="com.sample.general_messages" var="general"/> <f:loadBundle basename="com.sample.module_message" var="module"/> Is there a way I can access both these resource bundles using the same

How to add a message to a specific component from JSF backing bean

送分小仙女□ 提交于 2019-12-18 11:49:13
问题 I have an h:inputText and an h:message connected to it: <h:inputText id="myText" value="#{myController.myText}" /> <a4j:outputPanel> <h:message for="myText" .../> </a4j:outputPanel> I want to send a message to it from java, in a manner like: FacesContext.getCurrentInstance().addMessage(arg0, arg1); which is sent to h:messages, but to a specific id in a specific form. How can I do this? (Without implementing validation bean or validation method - meaning without throwing validation exception).

Localization with bean validation in JSF

孤街浪徒 提交于 2019-12-18 10:56:21
问题 I made a MVC based website using JSF 2.0 and RichFaces 4. Every input text validation is been done using bean validation annotations. I am using Hibernate Validator as bean validation implementation. How can I display a localized message? If I use @NotNull(message="<h:outputText value=\"#{msg['Mymessage']}\" />") then it literally displays <h:outputText value="#{msg['Mymessage']}" /> as message. How is this caused and how can I solve it? 回答1: You should and can not put JSF tags in the message

jsf (richfaces) readonly input text validation [duplicate]

我怕爱的太早我们不能终老 提交于 2019-12-18 04:54:14
问题 This question already has answers here : Force JSF to process, validate and update readonly/disabled input components anyway (3 answers) Closed 4 years ago . Is there any way I can validate a jsf input text that is readonly but the value is changed upon some other events triggered? 回答1: Set the readonly attribute to true only during render response phase. This way it won't be seen as readonly in all other phases than the render response phase. <h:inputText ... readonly="#{facesContext