richfaces

Sending parameter to a Controller

一世执手 提交于 2019-12-10 17:48:01
问题 I got this: <a4j:commandLink action="#{searchBean.someMethod}" reRender="search"><span><h:graphicImage value="/home/img/icons/red.gif" width="12" height="12" /> Street</span></a4j:commandLink> And on my Bean, I got a method: public void someMethod(String string){ doStruff(); } Is it possible to send a String as parameter to my method? 回答1: You can send param with <f:param> like this <a4j:commandLink action="#{searchBean.someMethod}" reRender="search"> <span> <h:graphicImage value="/home/img

JSF Form and German Umlauts

為{幸葍}努か 提交于 2019-12-10 17:34:04
问题 I'm facing a strange problem in one of my JSF (which is a facelet). I'm using Richfaces and on one page I got a normal form <h:form></h:form> My problem is when I submit the form all UTF-8 chars - like german umlauts (äöü) - are recieved encrypted. If I change the page to ISO-8859-1 on my browser it works. If I expand the form with attribute <h:form id="register-form" acceptcharset="ISO-8859-1"> it works too. (just for german umlauts) - other UTF-8 chars will be encrypted to something

Richfaces a4j:loadScript clears jQuery plugins on ajax calls

故事扮演 提交于 2019-12-10 16:36:40
问题 I'm loading jQuery embedded into RichFaces with: <a4j:loadScript src="resource://jquery.js"/> Next, I'm loading the FancyBox jQuery plugin with: <script type="text/javascript" src="/App/fancybox/jquery.fancybox-1.3.4.pack.js"/> The plugin works ok when the page is first loaded, however after executing an ajax call with <a4j:jsFunction name="myMethod" data="#{myController.jsonDataToReturn}" action="#{myController.doSomething()}" oncomplete="populateData(data);"> <a4j:actionparam name=

RichFaces 4 replacement for <a4j:loadScript>

a 夏天 提交于 2019-12-10 16:21:25
问题 I'm currently migrating a legacy JSF 1.2 application using RichFaces 3.3 to JSF 2.0 and RichFaces 4. However, inclusion of the jQuery library bundled with RichFaces does no longer work by including <a4j:loadScript src="resource://jquery.js"/> , as the <a4j:loadScript> component has been removed from RichFaces version 4. The RF 3.3 to 4 migration guide does not state how to include the bundled scripts otherwise. I've seen suggestions to use <h:outputScript name="jquery.js" target="head" /> ,

javax.faces.ViewState is missing after ajax render

蓝咒 提交于 2019-12-10 15:32:39
问题 This is not a duplicate post, i just done research but not helping. First, this is my page... simplified for easy reading. <h:form id="treeForm"> <f:event type="preRenderView" listener="#{taskTreeBean.update}" /> <rich:tree id="tree" nodeType="#{node.type}" var="node" value="#{taskTreeBean.rootNodes}" toggleType="client" selectionType="ajax" render="@all" selectionChangeListener="#{taskTreeBean.selectionChanged}"> <rich:treeNode> ... </rich:treeNode> </rich:tree> </h:form> <h:form id=

Default sort column in rich:datatable

*爱你&永不变心* 提交于 2019-12-10 14:58:37
问题 I have rich:dataTable with multiple sortable columns. <rich:column sortBy="#{user.uid}"> ... <rich:column sortBy="#{user.sn}"> ... etc. Sorting works fine. However, when page is loaded, table is always sorted by 1st column. How can I set "default" sorting column? (for example, the one with user.sn) 回答1: I suppose you will have to sort the underlying list. By default the table will be ordered like the list is that you pass as value. 回答2: The sort order of a column is defined by its sortOrder

JSF1.2: difference between ui:repeat, a4j:repeat and t:datalist tags

。_饼干妹妹 提交于 2019-12-10 14:21:57
问题 Do you know what is the difference between the tags mentioned in the subject? I thought they should produce pretty much the same result but it turned out that in some cases ui:repeat (a facelets tag) is not working as you would expect, although it's also considered a basic iteration component. t is for tomahawk and a4j is a richfaces prefix. Any comment is welcome. 回答1: Facelets' ui:repeat has indeed bugs in certain situations. As to the difference with the other two, it boils down that it's

How to refresh entire JSF page from the backing bean

六月ゝ 毕业季﹏ 提交于 2019-12-10 11:41:39
问题 We have a rich:comboBox on a JSF page which has a valueChangeListener that calls a backing bean function: <rich:comboBox id="cbmodel" defaultLabel="${accessUtils.activeRole}" value="${accessUtils.activeRole}" style="float: right;" valueChangeListener="${accessUtils.valueChangeListener}" > <c:forEach var="role" items="${accessUtils.currentUserRoles}"> <f:selectItem itemValue="#{role}"/> <a4j:support event="onchange" ajaxSingle="false" /> </c:forEach> </rich:comboBox> And here's the

How to replace the value of skin parameter on the fly in Richfaces 4.3?

孤者浪人 提交于 2019-12-10 11:03:31
问题 We have 2 applications: client application and admin application. User in admin application can change theme of client application. If theme contains image and skin then it is doable. Image servlet is using for reading image from DB on the fly and skin is changing dynamically. I have already implemented it. Task is more complicated : admin should have the possibility to customize ANY of the skin's parameters. Environment : JSF 2, RichFaces 4.3 We can save parameters and create new skin file,

jsf 2 response.sendRedirect is not working

丶灬走出姿态 提交于 2019-12-10 09:44:50
问题 I have observed an interesting thing in my JSF2.1/Richfaces 4.2 application. Some how all response.sendRedirect() calls inside either Filter (or) JSF Bean action methods are not working. If we use location.href on client side (Browser), it is working fine. Any suggestions on what could be causing send redirect failure? I have tried below signatures. response.sendRedirect("/appRoot/mypage.xhtml"); or (HttpServletResponse) facesCtx.getResponse()).sendRedirect(((HttpServletRequest)request)