In my JSF page when user clicks on 'Register' commandLink component I have to display a confirmation message to the user in a jQuery popup after doing the registration stuff.
My JSF page looks like
<h:commandLink value="Register" p:data-role="button" >
    <f:ajax execute="@form" listener="#{userController.registerUser(event)}" 
            onevent="function(data){if(data.status==='success')
            {
           openDialogFunc();
            }}" />
</h:commandLink>
<div data-role="popup" id="register-dialog" data-theme="a" data-overlay-theme="a">  
    <div data-role="header" data-tap-toggle="false">
        <h1>Success</h1>
    </div>
    <div data-role="content">
        <br/>
        <p>Your user account has now been created.</p>
        <br/>
        <h:commandButton value="Login" p:data-role="button" action="#{userController.Login}"/>
    </div>
</div>
The definition of openDialogFunc is given below:
function openDialogFunc() {
    $("<a />").attr({
        "href": "#register-dialog",
        "data-rel": "popup",
        "data-position-to": "window",
        "data-theme": "a"
    }).click();
}
When I click on the 'Register' button it registers the user and the openDialogFunc is called. However the jQuery popup is not displayed. Am I doing something silly here? (I am a newbie to Java/Web world).
Update:- I used component from primefaces (version 3.5) as per @BalusC's advice. But the dialog is again not displaying. I simply did the copy paste from the sample found in showcase. The browser log displayed an error message 'PF not defined'. I used the following code to launch the dialog:
<p:commandButton id="basic" value="Basic" onclick="PF('dlg1').show();" type="button" />
which doesn't work in 3.5. Its actually a 4.0 way to display the dialog. However using the following didn't work either
<p:commandButton id="basic" value="Basic" onclick="dlg1.show();" type="button" />  
Anyhow, now I am using Growl component to display the notification.
I can see there is a Dialog Framework which can be used to launch an external page into a dialog from a bean. Is it possible to use the same framework to launch a or into the dialog dynamically?
 
     
    