Question

I am trying to use together the three frameworks: PrimeFaces, PrimeFaces Mobile and MyFaces ExtVal. The library versions are: PF 3.3.1, PF Mobile 0.9.3, MyFaces ExtVal 2.0.5. Consider the following code:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.org/ui">
    <f:view>
        <h:head>
            <meta charset="UTF-8" />
            <title>Primefaces Mobile test</title>
        </h:head>
        <h:body>
            <h:form>
                <p:commandButton value="Oi" />
            </h:form>
        </h:body>
    </f:view>
</html>

If the project has only PrimeFaces and Mobile jars, the rendered commandButton is as expected:

<button id="j_idt6:j_idt7" name="j_idt6:j_idt7" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" onclick="PrimeFaces.ab({source:'j_idt6:j_idt7'});return false;" type="submit"><span class="ui-button-text">Oi</span></button>

This is the default PrimeFaces renderer. If i configure f:view with renderKitId as PRIMEFACES_MOBILE, the rendered button is:

<button id="j_idt6:j_idt7" name="j_idt6:j_idt7" type="submit" data-iconpos="left" onclick="PrimeFaces.ab({source:'j_idt6:j_idt7'});return false;">Oi</button>

It is also OK, as expected. Now, adding MyFaces ExtVal jars, everything breaks and only the PRIMEFACES_MOBILE is the renderer of the components. To test the behavior, i added the jars: myfaces-extval-bean-validation-2.0.5.jar, myfaces-extval-core-2.0.5.jar and myfaces-extval-property-validation-2.0.5.jar. Then i removed the renderKitId, so that the default PrimeFaces library should be used but again the result is:

<button id="j_idt6:j_idt7" name="j_idt6:j_idt7" type="submit" data-iconpos="left" onclick="PrimeFaces.ab({source:'j_idt6:j_idt7'});return false;">Oi</button>

I tried forcing the renderKitId in f:view to HTML_BASIC, but it keeps rendering the PrimeFaces Mobile version of the commandButton.

So guys, do you have any suggestions? Before the definition of RenderKitId, my system was OK, when i upgraded the libraries i got this error. I posted in PrimeFaces forum, but i couldn't see a way to solve, and i can't see why this is happening.

Was it helpful?

Solution

For those that experience the same error that i'm having, this problem is specific to the way MyFaces EXTVAL was working with the renderkit ids. Today, with the help of @Howard i saw a new fix from the EXTVAL guys which solved the problem.

To see more information: https://issues.apache.org/jira/browse/EXTVAL-151 http://forum.primefaces.org/viewtopic.php?p=90933#p90933

I would like to thank @Howard for the support since last year, and the MyFaces EXTVAL team for the fix. Regards.

OTHER TIPS

@Fernando, I just reported a similar issue that I experienced with OmniFaces, MyFaces JAR and PrimeFaces Mobile JAR. OmniFaces fixed it, and said the following:

Comment 4 by project member balusc, Today (4 hours ago) In MyFaces, the render kit ID is set during building of the view (and in Mojarra during creating of the view). Hence the temporary view didn't had the right render kit ID.

This is been fixed: view source code

This 'may' fix your issue as well. It's available in OmniFaces 1.3. Add the JAR to your classpath, retest, and reply with test results. I don't think it is necessary for you to make any changes to your web.xml or faces-config.xml. If I'm not mistaking, OmniFaces has a PartialViewContext called OmniPartialView(Context), but you may need to add OmniFaces's FullAjaxExceptionHandler to faces-config.xml, and that may fix this issue for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top