Dialog jsf page not working

I am trying to provide an example from the perffaces website. Using Dialog Framework - Basic

<p:commandButton value="Options" icon="ui-icon-extlink" action="#{dialogBean.viewCarsCustomized}" /> 

Bean dialogbean

open class DialogBean {

 public String viewCarsCustomized() { return "dialog:viewCars?modal=true"; } 

}

viewCars.xhtml

 <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:p="http://primefaces.org/ui"> <h:head> </h:head> <h:body> <p:dataTable var="car" value="#{tableBean.carsSmall}"> <p:column headerText="Model"> <h:outputText value="#{car.model}" /> </p:column> <p:column headerText="Year"> <h:outputText value="#{car.year}" /> </p:column> <p:column headerText="Manufacturer"> <h:outputText value="#{car.manufacturer}" /> </p:column> <p:column headerText="Color"> <h:outputText value="#{car.color}" /> </p:column> </p:dataTable> </h:body> </html> 

This is my example in My Bean. I try like this

 public String viewComposant(){ return "dialog:AjoutC?modal=true"; } 

it does not work, I try to do it like this. but every time a mistake

Unable to delete error message. de vue '/pagess/Parsing/ReacgModule.xhtml' pour l'action '# {parserXls.viewComposant ()}' avec le rรฉsultat 'Dialog: /pagess/pagesComposant/AjoutC.jsf modal = true'.

 public String viewComposant(){ return "dialog:/pagess/pagesComposant/AjoutC.jsf?modal=true"; } 

But when I like it, the page returns, but not the way I like it

 public String viewComposant(){ return "/pagess/pagesComposant/AjoutC.jsf"; } 
+5
source share
1 answer

3.5 version of price lists

Dialog transition prefix dialog: from "Dialog" is introduced in PrimeFaces 4.0 and does not work in older versions.

So, you have 2 options:


Update : according to the comment, how could you use it with the widgetVar approach in JS:

 <p:button value="Open dialog" onclick="w_dialog.show(); return false;" /> <p:dialog widgetVar="w_dialog"> <p>Dialog content.</p> <p:dialog> 

And here is how you could use the visible approach in JSF:

 <h:form> <p:commandButton value="Open dialog" action="#{bean.showDialog}" update=":dialog" /> </h:form> <p:dialog id="dialog" visible="#{bean.showDialog}"> <p>Dialog content.</p> <p:dialog> 

from

 private boolean showDialog; public void showDialog() { showDialog = true; } public boolean isShowDialog() { return showDialog; } 

If necessary, you can move <p:dialog> to the include file, which you include <ui:include> .

+6
source

All Articles