Search code examples
richfacesopenjpamyfaces

Richfaces and myfaces compatibility issue


I cant get myFaces (2.1.8 but same prob with 2.0) to work along with RichFaces 4.2.2 on Tomee 1.1 container. Tried googling but found nothing relevant.

A soon as richfaces tags are added to the page, the myFace JavaScript library link usually included in the 1st form of the page:

<script type="text/javascript" src="/pilot/javax.faces.resource/oamSubmit.js.xhtml?ln=org.apache.myfaces">

disappears from the rendered HTML. And consequently all "h:commandLink" links fail in the browser with a javascript error "myFaces not defined".

here is a sample

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich">

<h:head></h:head>
<h:body>

<h:form>
<h:commandLink value="Index" action="welcome" immediate="true" />
<rich:popupPanel >
</rich:popupPanel>
</h:form>

</h:body>
</html>

Solution

  • Apparently Myfaces is defined in jsf.js and there is some issue around that.

    Anyways adding the following code in web.xml fixes the problem

    <context-param>
        <param-name>org.apache.myfaces.USE_MULTIPLE_JS_FILES_FOR_JSF_UNCOMPRESSED_JS</param-name>
        <param-value>true</param-value>
    </context-param>