Re: Prettyfaces + Primefaces – JSF2.0 – Glassfish 3

Splash Forums PrettyFaces Users Prettyfaces + Primefaces – JSF2.0 – Glassfish 3 Re: Prettyfaces + Primefaces – JSF2.0 – Glassfish 3

#20218

dmport
Participant

Thanks for the reply

Here is the information

`clientDetails.xhtml

The objective of this button is to open a dialog but before do an action on the bean.

<p:commandButton actionListener=”#{clientDetailBean.setupCreateClientUser}”

oncomplete=”dialogCreateUser.show()” value=”Add new”/>

The methods on bean

public void setupCreateClientUser(ActionEvent actionEvent){

this.currentClientUser = new Clientuser();

this.currentClientUser.setActive(true);

this.currentClientUser.setClient(currentClient);

}

public void insertClientUser(ActionEvent actionEvent){

if(currentClientUser!=null){

User.InsertUser(currentClientUser);

}

}

web.xml

<web-app version=”3.0″ xmlns=”http://java.sun.com/xml/ns/javaee” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd“>

<filter>

<filter-name>Pretty Filter</filter-name>

<filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>

<async-supported>true</async-supported>

</filter>

<filter-mapping>

<filter-name>Pretty Filter</filter-name>

<url-pattern>*.xhtml</url-pattern>

<dispatcher>FORWARD</dispatcher>

<dispatcher>REQUEST</dispatcher>

<dispatcher>ERROR</dispatcher>

</filter-mapping>

<context-param>

<param-name>javax.faces.PROJECT_STAGE</param-name>

<param-value>Development</param-value>

</context-param>

<servlet>

<servlet-name>Faces Servlet</servlet-name>

<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

<load-on-startup>1</load-on-startup>

</servlet>

<servlet-mapping>

<servlet-name>Faces Servlet</servlet-name>

<url-pattern>*.xhtml</url-pattern>

</servlet-mapping>

<servlet>

<servlet-name>Resource Servlet</servlet-name>

<servlet-class>org.primefaces.resource.ResourceServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>Resource Servlet</servlet-name>

<url-pattern>/primefaces_resource/*</url-pattern>

</servlet-mapping>

<context-param>

<param-name>com.sun.faces.allowTextChildren</param-name>

<param-value>true</param-value>

</context-param>

<context-param>

<param-name>primefaces.skin</param-name>

<param-value>none</param-value>

</context-param>

<session-config>

<session-timeout>

30

</session-timeout>

</session-config>

<welcome-file-list>

<welcome-file>home.xhtml</welcome-file>

</welcome-file-list>

</web-app>

<pretty-config xmlns=”http://ocpsoft.com/prettyfaces/3.1.0″

xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”

xsi:schemaLocation=”http://ocpsoft.com/prettyfaces/3.1.0

http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.1.0.xsd“>

<url-mapping id=”clients.show”>

<pattern value=”/clients/” />

<view-id>/client/show.xhtml</view-id>

</url-mapping>

<url-mapping id=”clients.create”>

<pattern value=”/clients/newclient” />

<action>#{clientDetailBean.setupCreateClient}</action>

<view-id>/client/create.xhtml</view-id>

</url-mapping>

<url-mapping id=”clients.details”>

<pattern value=”/clients/#{ clientid }/” />

<query-param name=”clientid”>#{clientDetailBean.currentClientId}</query-param>

<action onPostback=”false”>#{clientDetailBean.selectClient}</action>

<view-id>/client/clientDetails.xhtml</view-id>

</url-mapping>

<url-mapping id=”clients.edit”>

<pattern value=”/clients/edit/#{ clientid }/” />

<query-param name=”clientid”>#{clientDetailBean.currentClientId}</query-param>

<action>#{clientDetailBean.selectClient}</action>

<view-id>/client/edit.xhtml</view-id>

</url-mapping>

</pretty-config>

<faces-config version=”2.0″

xmlns=”http://java.sun.com/xml/ns/javaee”

xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”

xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd“>

<navigation-rule>

<from-view-id>*</from-view-id>

<navigation-case>

<from-outcome>clients.show</from-outcome>

<to-view-id>/client/show.xhtml</to-view-id>

</navigation-case>

<navigation-case>

<from-outcome>clients.details</from-outcome>

<to-view-id>/client/clientDetails.xhtml</to-view-id>

</navigation-case>

<navigation-case>

<from-outcome>clients.edit</from-outcome>

<to-view-id>/client/edit.xhtml</to-view-id>

</navigation-case>

<navigation-case>

<from-outcome>clients.create</from-outcome>

<to-view-id>/client/create.xhtml</to-view-id>

</navigation-case>

<navigation-case>

<from-outcome>home.show</from-outcome>

<to-view-id>/home.xhtml</to-view-id>

</navigation-case>

</navigation-rule>

</faces-config>