0

It seems, that I have exactly same problem as jsf 2 primefaces openDialog not working?, but I'm using Spring Boot and I do not know how to configure that while I have no faces-config.xml.

I found https://github.com/code-not-found/jsf-primefaces/tree/master/jsf-primefaces-spring-boot which I believe is a good starter point for PrimeFaces (JSF) and Spring Boot combination.

In that project I added data.xhtml from PrimeFaces Showcase - Dialog Framework > Data + DFView.xhtml.

I just had to change

PrimeFaces.current().dialog.openDynamic("selectCar", options, null);

to

RequestContext.getCurrentInstance().openDialog("selectCar", options, null);

while org.joinfaces:jsf-spring-boot-parent:2.4.1 is using PrimeFaces 6.1 (not the latest 6.2)

When I click on Select Car button, my dfView.chooseCar is called, but after

RequestContext.getCurrentInstance().openDialog("selectCar", options, null);

dialog is not shown.

For simplicity, my dialog contains static text only.

edit 1:

I simply tried to create faces-config.xml in src/main/resources/WEB-INF/ folder with content

<?xml version="1.0" encoding="UTF-8"?>
<faces-config 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"
              version="2.2">
    <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>

but still not working...

Betlista
  • 10,327
  • 13
  • 69
  • 110

1 Answers1

0

It shows that adding faces-config.xml with content from question is solution and it should be in src/main/resources/META-INF/ folder.

I had additional problem with Spring Security, but this was solved using this answer - https://stackoverflow.com/a/31811446/384674

Betlista
  • 10,327
  • 13
  • 69
  • 110