0

I have included a file like this in A.xhtml page

<ui:include src="B.xhtml" />

and trying to open it with this command

<a4j:commandButton value="Add user" onclick="#{rich:component('popup')}.show()" />

and here is my B.xhtml file

<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:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:fn="http://java.sun.com/jsp/jstl/functions">

<f:metadata>
    <f:event listener="#{login.verifyLogin}" type="preRenderView" />
</f:metadata>

<body>
    <ui:composition>

        <ui:define name="content">


            <rich:popupPanel id="popup" modal="true" autosized="true"
                resizeable="false">


                <h:form>

                    <table cellspacing="20px">
                        <tr>
.....
....
.....
</tr>
</table>
</h:form>


            </rich:popupPanel>
        </ui:define>

    </ui:composition>

</body>
</html>

But popup window not opening What can be cause of the issue?

Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202
  • What does the generates onclick look like? – Makhiel Jul 28 '15 at 14:00
  • Problem can be in path of B.xhtml in `ui:include` (try with ./B.xhtml if B is in the same folder as A) or in wrong position of `ui:include` (can produce the nested forms). – Vasil Lukach Jul 28 '15 at 14:04
  • @VasilLukach both file are inside same folder otherwise `include` will throw `File Not Found Exception` – Subodh Joshi Jul 28 '15 at 17:37
  • @Makhiel I did not get your point i added a space which was missing – Subodh Joshi Jul 28 '15 at 17:39
  • Facelets templating/including is hardly the cause of the problem of the popup not showing up (unless you completely misunderstood Facelets). Please create a single all-in-one page to exclude it from being the cause. If the problem still persists, update your question to show that as MCVE instead. This must eliminate irrelevant noise and make the question better focused (not only for us, but also for yourself). – BalusC Jul 28 '15 at 17:39
  • @BalusC I created a Single page with popup inside the same page then it worked fine but i have to use `include` as per requirement – Subodh Joshi Jul 28 '15 at 17:41
  • Then post the problematic code as a MCVE. This has then nothing to do with RichFaces nor popups. – BalusC Jul 28 '15 at 17:42
  • 1
    Just use plain text like "Hello" instead of ``. Show both parent and include in its entirety with the minimum necessary code to demonstrate the problem of "Hello" not showing up. – BalusC Jul 28 '15 at 17:52
  • Again Thanks @BalusC the link helped me http://stackoverflow.com/questions/4792862/how-to-include-another-xhtml-in-xhtml-using-jsf-2-0-facelets – Subodh Joshi Jul 29 '15 at 06:17

0 Answers0