Dynamically add/remove jsf components example

Program:   dynamic.xhtml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"> <h:head> </h:head> <h:body> <h:form> <h:dataTable value="#{dynBean.dynList}" var="myListElement"> <h:column> <h:panelGrid> <h:outputText value="www.javadomain.in"></h:outputText> </h:panelGrid> </h:column> </h:dataTable> <h:commandButton value="Add" action="#{dynBean.addToMyList}" /> <h:commandButton value="Remove" action="#{dynBean.removeFromMyList}" /> </h:form> </h:body> </html> DynamicBean.java: import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.faces.bean.CustomScoped; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import javax.faces.bean.ViewScoped; @ManagedBean(name =

804 total views, no views today

» Read more

[solved] an annotationconfiguration instance is required to use mapping class

An annotationconfiguration instance is required to use mapping class Error: an annotationconfiguration instance is required to use mapping class Solution: 1. Ensure you have hibernate-annotations.jar file 2. Create the sessionfactory using new AnnotationConfiguration() not using new Configuration(). Eg: SessionFactory hibernateConfig1 = new AnnotationConfiguration().configure(“hibernate1.cfg.xml”).buildSessionFactory(); Recommended Books: 307 total views, no views today

307 total views, no views today

» Read more

Multiple databases using hibernate annotations

Database and Table Structure: DATABASE : DATABASEONE Table: EMPIDNAME EMPID INT(4) EMPNAME VARCHAR(15) DATABASE : DATABASETWO Table : EMPIDSALARY EMPID INT (4) EMPSALARY INT(4) Project Structure: Step 1: Hibernate configuration files for both databases: first database (DATABASEONE) hibernate configuration file (hibernate1.cfg.xml): <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!– Database connection configurations –> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>

410 total views, no views today

» Read more

Multiple databases using hibernate example

Database and Table Structure: DATABASE : DATABASEONE Table: EMPIDNAME EMPID INT(4) EMPNAME VARCHAR(15) DATABASE : DATABASETWO Table : EMPIDSALARY EMPID INT (4) EMPSALARY INT(4) Project Structure: Step 1: Hibernate configuration files for both databases: first database (DATABASEONE) hibernate configuration file (hibernate1.cfg.xml): <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!– Database connection configurations –> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>

164 total views, no views today

» Read more

Ice Panel Popup Examples

In JSF, those who are using Ice components if they need popup they can go with Ice panel Popups. Ice Panel Popup : <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <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:c="http://java.sun.com/jsp/jstl/core" xmlns:ace="http://www.icefaces.org/icefaces/components" xmlns:ice="http://www.icesoft.com/icefaces/component" xmlns:ui="http://java.sun.com/jsf/facelets"> <h:head> </h:head> <h:body> <h:form> <h:commandButton value="Click to open Ice Panl Popup" actionListener="#{icePopupBean.openPopup}" /> <ice:panelPopup visible="#{icePopupBean.popupOpened}" rendered="#{icePopupBean.popupOpened}" autoCentre="true"> <f:facet

372 total views, 1 views today

» Read more

[solved] diff propagated to root but no id set html null

diff propagated to root but no id set html null: Error: diff propagated to root but no id set html null Solution: Use <redirect/> in the faces-config file. Try to put h:panelGroup inside body (this error may occur if we use the ice components directly inside the body) – so it can be avoided if we use the ice components

442 total views, 1 views today

» Read more

[solved] java.lang.ClassNotFoundException: com.icesoft.faces.util.event.servlet.ContextEventRepeater

java.lang.ClassNotFoundException: com.icesoft.faces.util.event.servlet.ContextEventRepeater: Error: java.lang.ClassNotFoundException: com.icesoft.faces.util.event.servlet.ContextEventRepeater How I solved ? I have downloaded and added the icefaces-1.8.1.jar file to lib folder (web-inf/lib). Download link: icefaces-1.8.1.jar Recommended Books: 222 total views, no views today

222 total views, no views today

» Read more
1 2 3 5