jboss / mojarra

Fork of Mojarra
10 stars 41 forks source link

Mojarra 2.3 regression: Component rendered in wrong DOM level #21

Open erickdeoliveiraleal opened 6 years ago

erickdeoliveiraleal commented 6 years ago

I already reported in PrimeFaces side issue 1 and issue 2 but @tandraschko said it maybe a Mojarra 2.3 problem.

Sample XHTML

<!DOCTYPE html>
<html 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://primefaces.org/ui"
    xmlns:fn="http://java.sun.com/jsp/jstl/functions">

<h:head>

</h:head>

<h:body>

    <h:form>

        <p:selectOneMenu id="presidio">

            <f:selectItem itemLabel="Nenhum" noSelectionOption="true" />

        </p:selectOneMenu>

    </h:form>

    <h:form id="form">

        <p:commandButton process="@this"
            oncomplete="PF('dlgFolha').show('#{component.clientId}')"
            value="Folha de Ponto" ajax="true" />

    </h:form>

    <p:overlayPanel widgetVar="dlgPdf">
        <h:form id="dlgPdfIn">
            <p:outputPanel>
                <p:panelGrid columns="2" columnClasses="label,value">

                    <p:commandButton value="Movimentações" process="@this" />

                </p:panelGrid>
            </p:outputPanel>
        </h:form>
    </p:overlayPanel>
    <p:overlayPanel widgetVar="dlgFolha">
        <h:form id="dlgfolhaIn">
            <p:outputPanel>

                <p:commandButton value="Gerar" ajax="false" />

            </p:outputPanel>
        </h:form>
    </p:overlayPanel>
</h:body>
</html>
tandraschko commented 6 years ago

I also added a comment somewhere (not sure where)

somehow the second overlaypanel is rendered inside the first maybe the responsewriter does something wrong or some characters are filtered on rendering

It didn't happen in Mojarra 2.2 and MyFaces 2.2/2.3

EDIT: here it is: https://github.com/eclipse-ee4j/mojarra/issues/4407

erickdeoliveiraleal commented 6 years ago

@tandraschko this issue is in JBoss repository. A fork used in wildfly server. The main issue is in eclipse ee4j.

Em qua, 22 de ago de 2018 10:18, Thomas Andraschko notifications@github.com escreveu:

I also added a comment somewhere (not sure where)

somehow the second overlaypanel is rendered inside the first maybe the responsewrite does something wrong or some characters are filtered on rendering

It didn't happen in Mojarra 2.2 and MyFaces 2.2/2.3

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jboss/mojarra/issues/21#issuecomment-415028483, or mute the thread https://github.com/notifications/unsubscribe-auth/ADacSeioQFeYImesnRTvlpDbDH2laxyhks5uTVoigaJpZM4WHoIX .

abelet commented 6 years ago

This error is caused partly by the panelGrid issue (https://github.com/primefaces/primefaces/issues/4122) I reported before, and by the incorrect JSF implementation which I referred in #23.

The JSF development team closed the referred issue (https://github.com/eclipse-ee4j/mojarra/issues/4488) despite the fact that how vulnerable JSF become to component rendering problems, but seeing the positive attitude of @arjantijms I still hope this error will be fixed.

I attached a modified version of the HtmlResponseWriter class (HtmlResponseWriter.java.txt) eliminating the elementNames stack. If you build the jboss mojarra project with this modified version, the error will dissapear. I only have done this to prove the problem with the JSF implementation.

erickdeoliveiraleal commented 6 years ago

I think you can open an issue at wildfly side, so they can fix at wildfy https://issues.jboss.org/browse/WFLY-11147?filter=-4&jql=project%20%3D%20WFLY%20order%20by%20created%20DESC

abelet commented 6 years ago

The wildfly issue is here: https://issues.jboss.org/browse/WFLY-11151

erickdeoliveiraleal commented 6 years ago

fixed in https://github.com/primefaces/primefaces/issues/4122 thank you for investigate it, @abelet

abelet commented 6 years ago

@erickdeoliveiraleal, I'm happy that by solving my problem I could help you also. :) But we are not so satisfied yet, because another wrong component can cause serious headaches again due to the mojarra bug. So far not the wildfly issue (https://issues.jboss.org/browse/WFLY-11151) received to much attention, and the mojarra case (https://github.com/eclipse-ee4j/mojarra/issues/4488) has been closed. I hope someone will solve it from one of the JSF teams, and we don't have to patch our wildfly next spring.