this.jq.draggable is not a function when using primefaces dialog framework

2.1k Views Asked by At

I'm trying to open a dialog using Primefaces Dialog Framework like in:

http://www.primefaces.org/showcase/ui/df/basic.xhtml

My jsf code:

<p:commandButton icon="ui-icon-extlink" actionListener="#{grabacionesServicios.verGrabacion}"></p:commandButton>

In GrabacionesServicios managed bean is the following method:

public void verGrabacion() {
    RequestContext.getCurrentInstance().openDialog("dialog_playgrabacion");
}

Amd my dialog_playgrabacion.xhtml is a simple helloworld jsf page.

When I click the button for opening the dialog with dialog_playgrabacion.xhtml contents I get the next javascript error:

Uncaught TypeError: this.jq.draggable is not a function

in primefaces.js file.

I have read some other post and found a solution that talk about inserting the following code in the head section:

<h:outputScript library="primefaces" name="jquery/jquery-plugins.js"/>

I have paste this code in different locations but always get the same error.

When I use the developer tools in chrome and consult network activity I see how jquery-plugins.js is correctly downloaded but it seems to be downloaded after primefaces.js. Perhaps this is the error? How can I force this file to be downloaded before primefaces.js

Can you help me please?

Thanks!

My faces-config.xml:

<?xml version='1.0' encoding='UTF-8'?>
<faces-config version="2.2"
          xmlns="http://xmlns.jcp.org/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">




<navigation-rule>
    <from-view-id>*</from-view-id>
    <navigation-case>
        <from-outcome>inicio</from-outcome>
        <to-view-id>/admin/inicio.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
        <from-outcome>misdatos</from-outcome>
        <to-view-id>/admin/mis_datos.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
        <from-outcome>logout</from-outcome>
        <to-view-id>/index.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
        <from-outcome>agente-atiende</from-outcome>
        <to-view-id>/admin/atencion/index-agente.html</to-view-id>
    </navigation-case>
</navigation-rule>

<application>
    <action-listener>org.primefaces.application.DialogActionListener</action-listener>
    <navigation-handler>org.primefaces.application.DialogNavigationHandler</navigation-handler>
    <view-handler>org.primefaces.application.DialogViewHandler</view-handler>
</application>

</faces-config>
0

There are 0 best solutions below