Menu
  • HOME
  • TAGS

Using richfaces's tabPanel - tab's ontableave

Tag: richfaces,jboss-seam

Using Seam 2.2.2.Final and Richfaces 3.3.3.Final.

I need to perform an action when user leaves a tab, and this action can only take place after all the page is loaded, there are some bean init taking place on each tab content. So I went and read about .

Problem is, with 3 tabs, for example, as each tab is rendered and render passes for the next one, the command is fired. No good, bean not initialized and I get nullpointer pointed at me!

Anyway to prevent this behavior on this tag? As I am doing an improvement on a very large app, I am trying to mess around the deployed code as little as possible.

Thankx in advance for taking a look. Here is an example code for my page:

<?xml version="1.0" encoding="ISO-8859-1"?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:a="http://richfaces.org/a4j" 
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:rich="http://richfaces.ajax4jsf.org/rich"
                template="/WEB-INF/xhtml/templates/frameTemplate.xhtml">


    <ui:param name="pageTitle" value="Elaborar relatório, voto e ementa" />
    <ui:define name="title">#{pageTitle}</ui:define>
    <ui:param name="home" value="#{sessionProcess}" />

    <ui:define name="frameBody">
        <rich:jQuery query="hide()" selector="#update" timing="onload"/>

    <s:div id="allTabs">
        <rich:tabPanel title="Tab1" switchType="ajax" style="width: 100%;">
            <rich:tab label="Report"
                rendered="#{!sessionProcess.hideReport}" 
                title="Report" style="width: 100%;"
                action="#{sessionProcess.setReport()}" immediate="true" ontableave="#{sessionProcess.writeDraftReport()}">
                .
                .
                .
        <rich:tabPanel title="Tab2" switchType="ajax" style="width: 100%;">
            <rich:tab label="Vote"
                rendered="#{!sessionProcess.hideVote}" 
                title="Report" style="width: 100%;"
                action="#{sessionProcess.setVote()}" immediate="true" ontableave="#{sessionProcess.writeDraftVote()}">
                .
                .
                .

Best How To :

The @ontableave is for client-side code, i.e. JavaScript, not for bean methods. If you need to execute something on the server in response to a client-side event, use <a4j:support>:

<rich:tab label="Report" … >
    <a4j:support event="ontableave" 
                 action="#{sessionProcess.writeDraftReport()}" />
</rich:tab>

Why the Jquery Datatable doesn't work whith richfaces ?

javascript,jquery,jsf,datatables,richfaces

I replace <a4j:repeat> by <ui:repeat> and it works good.So my code looks like: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://java.sun.com/jsf/passthrough" xmlns:c="http://java.sun.com/jsp/jstl/core"> <h:head>...

Damaged parameter of javascript function in selectBooleanCheckbox

javascript,jsf,jsf-2,richfaces,selectbooleancheckbox

Here, onclick="alert(#{pi.idNumber});" onchange="alert('ID number: ' + #{pi.idNumber}); return false;" You're printing it as a JavaScript number type variable. Like the Java int, it has also a technical limit. For JavaScript it is 253 (9007199254740992). Better print it as a string. onclick="alert('#{pi.idNumber}');" onchange="alert('ID number: #{pi.idNumber}'); return false;" Note that EL runs...

a4j:htmlCommandLink in RichFaces 4

jsf,migration,richfaces

It seems that the RichFaces 4 removed the a4j:htmlCommandLink, as it's not included in the component reference. In my opinion, you can just use the <a4j:commandLink>: The <a4j:commandLink> component is similar to the JavaServer Faces (JSF) <h:commandLink> component, except that it includes plugged-in Ajax behavior. ...

RichFaces a4j:commandButton oncomplete

jsf,richfaces

You're supposed to use the action attribute for the purpose of invoking a managed bean method on submit. <a4j:commandButton ... action="#{archivoAfipController.emptyAction}" /> The oncomplete must represent a client side script expression (thus, e.g. JavaScript, which is in JSF perspective basically a plain vanilla String!), which should be executed when the...

Seam pageflow example NumberGuess Not landing on to the second page

seam,jboss-seam,page-flow,jpdl

Resolved the issue.Weld is scanning the archive, which seems to cause the problem.The Weld Docs says: You can either set this up for your deployment only by adding the following content to the META-INF/jboss-all.xml file of your application. jboss-all.xml file goes to your META-INF for ear archive and likely to...

How to set dynamic height for rich:extendedDataTable rows?

css,jsf,richfaces,row

You can override the height for .rf-edt-c. <rich:extendedDataTable styleClass="myTable" … /> .myTable .rf-edt-c { height: 100%; } ...

RichFaces 4 ExtendedDataTable - Selecting rows programmatically

javascript,jsf,richfaces

You can just go with #{rich:component('tableId')}, the function calls clientId internally anyway. #{rich:component('rich:clientId('tableId')')} This should be getting you a parse error. Single quotes mark a string, not a method argument....

java.lang.IllegalArgumentException: Multiple entries with same key: interface javax.validation.constraints.Min

jsf,deployment,richfaces,jsf-2.2

Frontend artifacts don't belong in EAR's /lib. They belong in WAR's /WEB-INF/lib. It would otherwise make the backend (the EJB) totally unreusable on other frontends (other WARs), such as Spring MVC, JAX-RS RESTful, "Plain vanilla" JSP/Servlet, etc..etc.. Using/importing JSF FacesContext and friends such as Servlet's HttpServletRequest in an EJB class...

Seam to Weld CDI

jboss-weld,jboss-seam

Check out https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Web_Platform/5/html/Seam_Reference_Guide/ch07s11.html "Where interceptor order is important, add @Interceptor annotations to your interceptor classes to specify a particular order of interceptors." @Interceptor(around={BijectionInterceptor.class, ValidationInterceptor.class, ConversationInterceptor.class}) public class LoggedInInterceptor { ... } So with one interceptor it is not very useful ... ...

header height

datatable,richfaces

The background image starts repeating itself, which it shouldn't do. You can fix that with this: .rf-dt-hdr-c { background-repeat: repeat-x; } ...

Render Panel on ajax start - JSF

ajax,jsf,jsf-2,richfaces

This worked <a4j:commandButton id="myButton" onclick="updateMyPanel();" .... ></a4j:commandButton> <a4j:jsFunction name="updateMyPanel" render="myPanel"> </a4j:jsFunction> NOTE: I tried onbegin and onbeforedomupdate but both didn't work !!...

How to apply common java script method for all Button when onclick action occur?

javascript,jsf,button,xhtml,richfaces

How about something like this fiddle, have a selector retrieving all the buttons and a small JavaScript to apply the event listener to all your buttons? Hope this is what you were looking for. <input id="Button1" type="button" class="myButton" value="Button1"> <input id="Button2" type="button" class="myButton" value="Button2"> <input id="Button3" type="button" class="myButton" value="Button3"> var...

a4j:commandButton doesn't render the element

jsf,richfaces,ajax4jsf,commandbutton

The solution is quite simple. I used <h:form> inside other <h:form>. It will not work anyway. When I remove internal - the jsf works smooth and as it should.

When pressing enter on popup the submit buttons on landing page gets triggered

javascript,html,jsf-2,richfaces

I managed to handle the enter key by using this script: <script type="text/javascript"> $(document).bind('keydown', 'Return', function(e){ key = e.keyCode; if(key == 13){ // Enter key pressed // Get button binding from backing bean. var continueBtn = document.getElementById("#{optionsController.continueButton.clientId}"); if(!continueBtn.disabled){ continueBtn.click(); } return false; } }); Also added the binding for the...

RichFaces extendedDataTable disable sorting

jsf,richfaces

Why can't you use the sortMode=multi? The table also has sortPriority - a list of ids by which to sort, I assume your not adding the ids of the columns to the sortPriority so it gets sorted by the id that is there. The handling is done in org.richfaces.renderkit.SortingFilteringRowsRenderer.decodeSorting(). EDIT:...

JSF templating and controller invocation

jsf,templates,dynamic,richfaces,jsf-1.2

I finally got my template working. I was wrong, JSF and Facelet components should not call a method so they can fill themselves. The correct MVC way is to call a method of the controller before, the controller will build the view bean and then only redirect to the JSF...

Error Omnifaces o:validateOrder with Rich Faces Calendar component

jsf,richfaces,omnifaces

The <o:validateXxx> components are sensitive to their location relative to the target input components. This is very useful to prioritize validation depending on component's own converter and validators. When placed before the target input components, then they will validate the raw unsubmitted values, and they will run before any of...

What a4j eventsQueue should be replaced to?

jsf,richfaces

You have two options Use the queueId on the ajax tag: <a4j:ajax event="change" render="dropCheck" queueId="balbanceQueue"/> Use the a4j:attachQueue component, nested within the component that'll trigger the ajax-request. This tag is used in combination with the a4j:queue component to provide scoped ajax-queue definition. Using this, you should have something that looks...

Avoid onRowClick event when outputLink is clicked inside of RichFaces datatable

javascript,javascript-events,datatable,richfaces

Basically what Event.stop(event) does is the following: \\ stops the event from bubbling up the event chain event.stopPropagation(); \\ prevents the default action the browser makes on that event event.preventDefault(); In your case you want just to prevent bubbling, so a way to go: onclick="event.stopPropagation()" ...

How to disable JSF components programmatically

jsf-2,richfaces

After further research I noticed there are some classes that extend the ones we were using in our project. Those classes have a getter/setter for the disabled attribute which also disables the component in the server side. I tested this disabling the components programmatically and removing the disabled attribute while...

Change default color of a popupPanel?

jsf-2,richfaces

Add This css : .rf-pp-hdr{ background: red; } ...

JSF Composite Component with conditional popup panel

jsf,richfaces,el,composite-component

The oncomplete attribute of the <a4j:commandLink> component must evaluate to a String. Here, your EL tries to invoke either a showMessage() or a submitToServer() java method depending on a boolean value, which are not found. what you want is a String with the JS function name, so just put function...

Ajax Rerender working for selectOneMenu, but not input text

jsf,richfaces

<a4j:support> works with JSF components. Replace your <input type="text"> by <h:inputText>.

Example reRender not working Richfaces 3.3.4 final

jsf,tree,richfaces,rerender

just in fact somebody else has similar Problems: After working on other things in the mean time I now figured out how to solve this Issue. It was rather easy and all work is done in the JSP: Use Rich Tree Node inside the Rich Tree Tag Use the ajaxSubmitSelection...

Migrating Atmosphere 1.0.0 to 2.X.X breaks Async communication for Internet Explorer

internet-explorer,internet-explorer-8,migration,richfaces,atmosphere

The problem was missing setting for all filters taking part in communication. Strange that only Internet Explorer requests couldn't be handled....

rich:toolTip not handling String values that contain quotes

jsf,richfaces

OK, so the root of the issue was that the rich:extendedDataTable uses an ID supplied by each entry to generate a unique ID for each table row. So the problem ended up being in the underlying "Model Managed-Bean" that implemented a generic data entity interface, this interface defines a getEntityId()...

h:inputText allow only numbers during input [duplicate]

jsf-2,numbers,richfaces

I finished using this function: onkeypress="if(event.which &lt; 48 || event.which &gt; 57 ) if(event.which != 8) return false;" This work well in IE and Chrome, I don´t know why it´s not work well in firefox too, this function block the tab key in Firefox. Thanks for all....

Error Omnifaces 2.0 o:massAttribute with o:validateOrder

jsf-2,richfaces,omnifaces

It's caused by the isXxx() getter incorrectly returning a Boolean instead of boolean. The fix is available as per today's 2.1-SNAPSHOT and will be in 2.1 release....

How to pass a value on selected row change?

jsf-2,richfaces

What richface version are you using? For richfaces 4.3.x, the following example might do the trick: XHTML: <rich:extendedDataTable id="myTable" value="#{crudBean.rows}" var="rowItem" rowClasses="odd-row, even-row" selection="#{crudBean.actionForm.selection}" rows="#{crudBean.actionForm.occurrences}" rowKeyVar="idx" > <a4j:ajax event="selectionchange" listener="#{crudBean.actionForm.selectionListener}" immediate="true" /> <rich:column width="100px" styleClass="#{rowItem.className}"> ...stuff......

URL rewrite in Wildfly?

jsf,mod-rewrite,jsf-2,primefaces,richfaces

You may also want to look at Rewrite, which will be the core of PrettyFaces 4. It's more dynamic and can intercept URLs if you require login. http://www.ocpsoft.org/java/migrating-from-prettyfaces-to-rewrite-simplicity-meets-power/ http://www.mastertheboss.com/javaee/servlet-30/rewrite-a-java-ee-url-rewriting-solution...

Close rich:popupPanel on back-end exception

jsf,popup,richfaces

Use @data, it makes a bean property available in Javascript. <a4j:commandButton id="getReportList_btn" value="Get Report List" action="#{service.downloadReportList}" data="#{service.downloadFailure}" onbegin="#{rich:component('reportList_dlg')}.show()" oncomplete="if(event.data)#{rich:component('reportList_dlg')}.hide()" /> So if an exception occurs during service.downloadReportList set downloadFailure to true....

Using richfaces's tabPanel - tab's ontableave

richfaces,jboss-seam

The @ontableave is for client-side code, i.e. JavaScript, not for bean methods. If you need to execute something on the server in response to a client-side event, use <a4j:support>: <rich:tab label="Report" … > <a4j:support event="ontableave" action="#{sessionProcess.writeDraftReport()}" /> </rich:tab> ...

Reuse Component JSF2.1 with Facelets

jsf-2,richfaces,facelets

You can create facelet tag with following code: TAG (myTable.xhtml): <c:if test="#{!subtable}"> <rich:dataTable id="tabla_items_del_paquete" value="#{listaPaqueteItems}" var="p" rowKeyVar="row_tabla_items_del_paquete" rows="10" rowClasses="odd-row, even-row" styleClass="stable"> <ui:insert> </rich:dataTable> </c:if> <c:if test="#{subtable}"> <rich:collapsibleSubTable id="subtable"> <ui:insert> </rich:collapsibleSubTable> </c:if> USAGE: <my:mytable> ... your...

Controlling component from backing bean

jsf,richfaces,components,javabeans

The solution for me was to rerender te parent, not the actual component. Also adding the new element children as children to the bound component. XHTML : Added a h:panelgroup around the place holder. <h:panelGroup id="#{cc.attrs.id}_parent"> <rich:panel id="#{cc.attrs.id}" binding="#{myBean.panel}"/> </h:panelGroup> <a4j:jsFunction name="createPanels" action="#{myBean.createPanels}" render="#{cc.attrs.id}_parent"> <a4j:param name="rootId" assignTo="#{myBean.rootId}"/> <a4j:param name="rootKey"...

How to display PDF in JSF, with content from ServletResponse

jsf,pdf,jsf-2,richfaces

I don't see anything wrong with your current setup.Most probably the problem lies in your XHTML page and something is causing your not to fire the event.Please refer this post for further details,surely this will be of some help to you.

Dynamically show/hide page elements via backing bean method called with AJAX using RichFaces

jsf,richfaces,ajax4jsf

I've seen similar behavior with JSF 2.1. When a rendered tag is present on an element, and you plan on showing/hiding the element via ajax, you should wrap it with another naming container and rerender the parent container instead. Something like this would do <tr> <td >string1:</td> <td> <h:inputText style="width:...

JSF too many commandLinks (h:form) lead to ViewExpiredException

jsf,richfaces,toggle,commandlink,viewexpiredexception

Thank you very much for your help Makhiel. I finally managed to solve the problem with the commandButtons solution. I can't explain why, but the IDs of my togglePanelItems got duplicated in the different reports. Giving every togglePanelItem a unique ID like <rich:togglePanelItem name="closed" id="#{param.reportWrapper}_opened"> and <rich:togglePanelItem name="opened" id="#{param.reportWrapper}_closed"> solved...

Can't check any option of h:selectOneRadio inside h:extendedDatatable JSF

jsf,radio-button,richfaces

According to the docs the @value is supposed to be a ValueExpression, so a hard-coded value will not do (I assume this isn't the final use-case). This will work: <rich:dataTable value="#{bean.intList}" var="value"> <rich:column> <h:selectOneRadio value="#{value}"> <f:selectItem itemValue="1" /> <f:selectItem itemValue="2" /> <f:selectItem itemValue="3" /> </h:selectOneRadio> </rich:column> </rich:dataTable> By the way,...

a4j:support - Value retrieved from h:selectOneMenu is always NULL

ajax,jsf,richfaces,ajax4jsf

The problem was identified: Each "option" generated by the t:selectItems tag was with the item id instead of an index, while the comboConverter was using an index to select the item. So, the list had 12 items (indexes should range from 0 to 11), but the id of the selected...

JSF rendering popup frow a manegbean condition?

jsf,jsf-2,popup,richfaces

You're calling the function before the popupPanel is created, that's why you're getting the undefined error. You don't have to render a JS function in order to show the panel though, you can just show the panel: <rich:popupPanel id="popup" show="#{usuario.fail == 1}" …> … </rich:popupPanel> ...

Richfaces custom skinning images

resources,richfaces,skinning

The solution was not complicated but not satisfying. I moved the reference of the resource file to the skin property file: custom.ecss : ... .btn-accept{ height:22px; width:47px; background: '#{richSkin.okBtnImg}'; } ... default.skin.properties : .... okBtnImg=url("#{resource['image/button/okBtnImg.png']}") no-repeat 0 0 !important; ... custom.skin.properties : .... okBtnImg=url("#{resource['image/customSkin/button/okBtnImg.png']}") no-repeat 0 0 !important; ... ...

Richfaces ExtendedDataTable update without scrolling to top

jsf,richfaces

I got an answer from a coworker. It's actually incredibly simple. All you have to do is wrap a normal dataTable within a panelGroup as follows: <h:panelGroup layout="block" style="overflow: auto; height: 700px"> <h:dataTable id="myTable" ></h:dataTable> </h:panelGroup> With this setup you can still use a poll on the table, but the...

rich:calendar set default date to today's date

jsf,richfaces

Just preset the model behind the value attribute to the desired value. E.g. directly after preparing/obtaining the instance: instance.setNotificationDate(new Date()); ...

IllegalArgumentException: Cannot convert [] of type class java.util.HashSet to class xxx

jsf,richfaces,illegalargumentexception

@selection of EDT has to evaluate to a Collection, it looks like yours is pointing to a single object.

RichFaces 3 html tag inside commandLink

html,jsp,jsf,richfaces

The HTML that this renders is incorrect JSF doesn't render it that way. It's the webbrowser itself who interpreted the obtained HTML markup that way. You most likely looked in HTML DOM inspector in webbrowser's web developer toolset as available via F12, instead of straight in the raw HTML...

javax.el.ELException: Error Parsing: “#{a4jSkin.imageUrl('buttonBackgroundImage.png')}”

jsf,jsf-2,richfaces

#{a4jSkin.imageUrl('buttonBackgroundImage.png')} This EL syntax whereby a bean method is invoked with an argument wasn't supported before EL 2.2. This in turn suggestes that you're deploying to a Servlet 2.5 / EL 2.1 container or older. Based on your previous questions, I gather that upgrading to at least Servlet 3.0 is...

Can not find the tag library descriptor for “http://richfaces.ajax4jsf.org/rich”

eclipse,jsf,richfaces,jsf-2.2

JSP is deprecated since JSF 2.0. It's succeeded by Facelets (XHTML). Therefore, JSF 2.0 compatible component libraries like RichFaces 4+ and PrimeFaces 2+ do not support JSP anymore. Those component libraries do not contain JSP taglibs anymore. Hence this error. Migrate JSP to its successor Facelets. See also: Migrating from...

rich:calendar custom footer not being recognized

jsf,richfaces

The calendar footer is not customizable (not every component is set up to use the facets). You have to put the grid under the table and hide the footer (.rf-cal-ftr) if you need to.

ADF Custom Search Form

oracle11g,richfaces,oracle-adf

Lots of answer on google, like this. Also, look at using the ExecWithParams if you want to build it based on bind vars