jsf 2 - Page jsf into dialog not working -


i try folow exemple primefaces site .using dialog framework - basic

    <p:commandbutton value="options" icon="ui-icon-extlink" action="#{dialogbean.viewcarscustomized}" /> 

bean dialogbean

public 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 exemple on bean . try

public string viewcomposant(){         return "dialog:ajoutc?modal=true";      } 

it not working,i try .but every time error

impossible de trouver un cas de navigation correspondant depuis l'id 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 page returend not like

public string viewcomposant(){             return "/pagess/pagescomposant/ajoutc.jsf";          } 

3.5 version of primefaces

the dialog: navigation outcome prefix "dialog framework" introduced in primefaces 4.0 , don't work in older versions.

so, you've 2 options:

  1. upgrade primefaces 4.0 (note: it's still in beta)
  2. use "old" approach of dialogwidgetvar.show() in javascript or visible="#{somecondition} in jsf. see the <p:dialog> examples in primefaces showcase.

update: per comment, here's how use widgetvar approach in js:

<p:button value="open dialog" onclick="w_dialog.show(); return false;" /> <p:dialog widgetvar="w_dialog">     <p>dialog's content.</p> <p:dialog> 

and here's how use 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's content.</p> <p:dialog> 

with

private boolean showdialog;  public void showdialog() {     showdialog = true; }  public boolean isshowdialog() {     return showdialog; } 

you can if necessary move <p:dialog> include file include <ui:include>.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -