0

Main page where i want my pop dialog to be shown

    <p:commandLink value="Login now "
       oncomplete="PF('LoginDialog').show()" update=":form:loginDialog">
    </p:commandLink> 

</h:body>
    <ui:include src="/job/login.xhtml"></ui:include>

</html>

The page am trying to make as a pop-up

<ui:composition>

    <h:head>

        <title>Login now</title>

    </h:head>
    <h:form id="form">
        <p:dialog id="loginDialog" header="Login Now" widgetVar="LoginDialog"
            showEffect="fade" hideEffect="fade" appendTo="@(body)" modal="true" resizable="true" >



                <p:messages id="messages" />
                <label class="text-black" for="fusername">Username </label>

                <p:inputText id="username" value="#{login.username}" required="true"
                    requiredMessage="Username is mandatory" class="form-control">
                    <p:watermark for="username" value="Username" />
                </p:inputText>


                <label class="text-black" for="fname">Password</label>
                <p:password id="password" value="#{login.password}" required="true"
                    class="form-control" requiredMessage="Password is mandatory">
                    <p:watermark for="password" value="Password" />
                </p:password>


                <p:commandButton value="Login" icon="ui-icon-star"
                    action="#{login.submit}" ajax="false"
                    class="btn px-4 btn-primary text-white">
                </p:commandButton>
        </p:dialog>

            </h:form>

</ui:composition>
</html>

I don't understand why this is not showing up in the main page,can somebody help? It doesn't give me any errors but it's not shown.

Andrés Alcarraz
  • 1,570
  • 1
  • 12
  • 21
enxhi
  • 1
  • Welcome, @enxhi. Are the commandLink and dialog components on separate pages? Hard to tell from your sample code. Also, see this [PrimeFaces forum post](https://forum.primefaces.org/viewtopic.php?t=36908) about appendTo + the form tag + including the dialog on the page properly – mheppler9d Sep 26 '19 at 00:09
  • Yes they are on separate pages ,the point is that in a simple page the whole things works ,but when I put my command link inside divs it doesn't work and I don't understand why ,have tried many things and after a week a have my thesis presentation – enxhi Sep 26 '19 at 18:45
  • Try with a remmotecommand that executes ondocument ready, it will show the dialog when document ready ;) – BugsForBreakfast Sep 27 '19 at 04:16
  • @BugsForBreakfast how can use it to call a dialog in primefaces ? Because I think remmote comand it's from JavaScript – enxhi Oct 03 '19 at 20:55
  • @enxhi You need to use the dialogs widgetVar in the javascript function, and in the remmoteCommand you call your javascript function, on its onstart or oncomplete attribute, as you prefer, I will post an example tomorrow when I have some time – BugsForBreakfast Oct 03 '19 at 22:22
  • That would be very helpful thanks a lot – enxhi Oct 04 '19 at 05:17
  • I think Jquery is having conflicts with Primefaces components,i changed my script into like in this https://stackoverflow.com/questions/5457292/jquery-conflicts-with-primefaces/5510507forum but not solved and my pages keeps loading ,i dont know what else can solve this – enxhi Oct 06 '19 at 23:04

0 Answers0