Author: pkawiak
Date: 2009-04-25 06:41:47 -0400 (Sat, 25 Apr 2009)
New Revision: 13850
Added:
trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.xhtml
trunk/samples/extendedDataTable-sample/src/main/webapp/pages/stateTestPage.xhtml
Removed:
trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp
trunk/samples/extendedDataTable-sample/src/main/webapp/pages/stateTestPage.jsp
Modified:
trunk/samples/extendedDataTable-sample/src/main/java/org/richfaces/samples/extdt/beans/ExtendedDataTableBB.java
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages.properties
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages_en.properties
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages_pl.properties
trunk/samples/extendedDataTable-sample/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
trunk/samples/extendedDataTable-sample/src/main/webapp/WEB-INF/web.xml
Log:
RF-6151: updated demo of extendedTableDataModel. Facelets introduced,
serializing/deserializing dataModel is now available in demo.
Modified:
trunk/samples/extendedDataTable-sample/src/main/java/org/richfaces/samples/extdt/beans/ExtendedDataTableBB.java
===================================================================
---
trunk/samples/extendedDataTable-sample/src/main/java/org/richfaces/samples/extdt/beans/ExtendedDataTableBB.java 2009-04-25
10:32:22 UTC (rev 13849)
+++
trunk/samples/extendedDataTable-sample/src/main/java/org/richfaces/samples/extdt/beans/ExtendedDataTableBB.java 2009-04-25
10:41:47 UTC (rev 13850)
@@ -1,11 +1,17 @@
package org.richfaces.samples.extdt.beans;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -17,102 +23,156 @@
/**
* @author pkawiak
- *
+ *
*/
public class ExtendedDataTableBB {
-
- private SimpleSelection selection = new SimpleSelection();
- private List<DemoPatient> selectedItems;
- private Comparator<DemoPatient> dateComparator;
- private String tableState = null;
- private ExtendedTableDataModel<DemoPatient> dataModel;
- private Integer patientsNumber = 100;
- public ExtendedDataTableBB() {
- }
-
- public ExtendedTableDataModel<DemoPatient> getDataModel(){
- if (dataModel == null){
- dataModel = new ExtendedTableDataModel<DemoPatient>(new
DemoPatientProvider(patientsNumber));
- }
- return dataModel;
- }
-
- public SimpleSelection getSelection() {
- return selection;
- }
+ private SimpleSelection selection = new SimpleSelection();
+ private List<DemoPatient> selectedItems;
+ private Comparator<DemoPatient> dateComparator;
+ private String tableState = null;
+ private ExtendedTableDataModel<DemoPatient> dataModel;
+ private Integer patientsNumber = 100;
- public void setSelection(SimpleSelection selection) {
- this.selection = selection;
- }
-
- public String takeSelection() {
- getSelectedItems().clear();
- Iterator<Object> iterator = getSelection().getKeys();
- while (iterator.hasNext()){
- Object key = iterator.next();
- selectedItems.add(getDataModel().getObjectByKey(key));
- }
- return null;
- }
-
- public Integer getPatientsNumber() {
- return patientsNumber;
- }
+ private ByteArrayOutputStream byteOutputStream;
+ private ObjectOutputStream objectOutputStream;
- public void setPatientsNumber(Integer patientsNumber) {
- if (patientsNumber != this.patientsNumber) {
- dataModel = new ExtendedTableDataModel<DemoPatient>(new
DemoPatientProvider(patientsNumber));
- }
- this.patientsNumber = patientsNumber;
- }
+ public ExtendedDataTableBB() {
+ }
- public List<DemoPatient> getSelectedItems() {
- if (selectedItems == null){
- selectedItems = new ArrayList<DemoPatient>();
- }
- return selectedItems;
- }
+ public ExtendedTableDataModel<DemoPatient> getDataModel() {
+ if (dataModel == null) {
+ dataModel = new ExtendedTableDataModel<DemoPatient>(
+ new DemoPatientProvider(patientsNumber));
+ }
+ return dataModel;
+ }
- public void setSelectedItems(List<DemoPatient> selectedItems) {
- this.selectedItems = selectedItems;
- }
+ public SimpleSelection getSelection() {
+ return selection;
+ }
- public String getTableState() {
- if (tableState == null){
- //try to get state from cookies
- Cookie[] cookies =
((HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest()).getCookies();
- if (cookies != null){
- for (Cookie c : cookies){
- if (c.getName().equals("extdtSampleTabelState")){
- tableState = c.getValue();
- break;
- }
- }
- }
- }
- return tableState;
- }
+ public void setSelection(SimpleSelection selection) {
+ this.selection = selection;
+ }
- public void setTableState(String tableState) {
- this.tableState = tableState;
- //save state in cookies
- Cookie stateCookie = new Cookie("extdtSampleTabelState", this.tableState);
+ public String takeSelection() {
+ getSelectedItems().clear();
+ Iterator<Object> iterator = getSelection().getKeys();
+ while (iterator.hasNext()) {
+ Object key = iterator.next();
+ selectedItems.add(getDataModel().getObjectByKey(key));
+ }
+ return null;
+ }
+
+ public Integer getPatientsNumber() {
+ return patientsNumber;
+ }
+
+ public void setPatientsNumber(Integer patientsNumber) {
+ if (patientsNumber != this.patientsNumber) {
+ dataModel = new ExtendedTableDataModel<DemoPatient>(
+ new DemoPatientProvider(patientsNumber));
+ }
+ this.patientsNumber = patientsNumber;
+ }
+
+ public List<DemoPatient> getSelectedItems() {
+ if (selectedItems == null) {
+ selectedItems = new ArrayList<DemoPatient>();
+ }
+ return selectedItems;
+ }
+
+ public void setSelectedItems(List<DemoPatient> selectedItems) {
+ this.selectedItems = selectedItems;
+ }
+
+ public String getTableState() {
+ if (tableState == null) {
+ // try to get state from cookies
+ Cookie[] cookies = ((HttpServletRequest) FacesContext
+ .getCurrentInstance().getExternalContext().getRequest())
+ .getCookies();
+ if (cookies != null) {
+ for (Cookie c : cookies) {
+ if (c.getName().equals("extdtSampleTabelState")) {
+ tableState = c.getValue();
+ break;
+ }
+ }
+ }
+ }
+ return tableState;
+ }
+
+ public void setTableState(String tableState) {
+ this.tableState = tableState;
+ // save state in cookies
+ Cookie stateCookie = new Cookie("extdtSampleTabelState",
+ this.tableState);
stateCookie.setMaxAge(30 * 24 * 60 * 60);
- ((HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse()).addCookie(stateCookie);
+ ((HttpServletResponse) FacesContext.getCurrentInstance()
+ .getExternalContext().getResponse()).addCookie(stateCookie);
+ }
+
+ public void serializeModel(ActionEvent event) {
+ try {
+ byteOutputStream = new ByteArrayOutputStream();
+ objectOutputStream = new ObjectOutputStream(byteOutputStream);
+ objectOutputStream.writeObject(dataModel);
+ System.out.println("Data Model serialized");
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ objectOutputStream.flush();
+ objectOutputStream.close();
+ byteOutputStream.close();
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ }
+ }
+ }
+
+ public void deserializeModel(ActionEvent event) {
+ ByteArrayInputStream fIn=null;
+ ObjectInputStream oIn=null;
+
+ try{
+ fIn= new ByteArrayInputStream(byteOutputStream.toByteArray());
+ oIn = new ObjectInputStream(fIn);
+ // de-serializing dataModel
+ dataModel = (ExtendedTableDataModel<DemoPatient>) oIn.readObject();
+ System.out.println("Data Model deserialized");
+ patientsNumber = dataModel.getRowCount();
+ } catch(IOException e) {
+ e.printStackTrace();
+ } catch(ClassNotFoundException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ oIn.close();
+ fIn.close();
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ }
+ }
}
-
- public Comparator<DemoPatient> getDateComparator(){
- if (dateComparator == null){
- dateComparator = new Comparator<DemoPatient>(){
- public int compare(DemoPatient o1, DemoPatient o2) {
- return o1.getAdmissionDate().compareTo(o2.getAdmissionDate());
- }
-
- };
- }
- return dateComparator;
- }
-
+ public Comparator<DemoPatient> getDateComparator() {
+ if (dateComparator == null) {
+ dateComparator = new Comparator<DemoPatient>() {
+
+ public int compare(DemoPatient o1, DemoPatient o2) {
+ return o1.getAdmissionDate().compareTo(
+ o2.getAdmissionDate());
+ }
+
+ };
+ }
+ return dateComparator;
+ }
+
}
Modified:
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages.properties
===================================================================
---
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages.properties 2009-04-25
10:32:22 UTC (rev 13849)
+++
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages.properties 2009-04-25
10:41:47 UTC (rev 13850)
@@ -10,6 +10,8 @@
table.selectionMode=Selection mode
table.patientsNumber=Number of patients
table.testComponentState=Test component state
+table.serializeDataModel=Serialize data model
+table.deserializeDataModel=Deserialize data model
table.back=Back
demo.testPageTitle=Component state test page
table.paginated=Enable paginator
@@ -17,3 +19,6 @@
table.selectedPatients=Selected patients
select=Select
table.enableContextMenu=Enable context menu
+component.test=Component test
+dataModel.test=ExtendedTableDataModel test
+
Modified:
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages_en.properties
===================================================================
---
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages_en.properties 2009-04-25
10:32:22 UTC (rev 13849)
+++
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages_en.properties 2009-04-25
10:41:47 UTC (rev 13850)
@@ -15,5 +15,9 @@
table.paginated=Enable paginator
table.rowsNumber=Number of rows
table.selectedPatients=Selected patients
+table.serializeDataModel=Serialize data model
+table.deserializeDataModel=Deserialize data model
select=Select
table.enableContextMenu=Enable context menu
+component.test=Component test
+dataModel.test=ExtendedTableDataModel test
Modified:
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages_pl.properties
===================================================================
---
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages_pl.properties 2009-04-25
10:32:22 UTC (rev 13849)
+++
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages_pl.properties 2009-04-25
10:41:47 UTC (rev 13850)
@@ -10,6 +10,8 @@
table.selectionMode=Selection mode
table.patientsNumber=Number of patients
table.testComponentState=Test component state
+table.serializeDataModel=Serialize data model
+table.deserializeDataModel=Deserialize data model
table.back=Back
demo.testPageTitle=Component state test page
table.paginated=Enable paginator
@@ -17,3 +19,5 @@
table.selectedPatients=Selected patients
select=Selekt
table.enableContextMenu=Enable context menu
+component.test=Component test
+dataModel.test=ExtendedTableDataModel test
Modified:
trunk/samples/extendedDataTable-sample/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
===================================================================
---
trunk/samples/extendedDataTable-sample/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia 2009-04-25
10:32:22 UTC (rev 13849)
+++
trunk/samples/extendedDataTable-sample/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia 2009-04-25
10:41:47 UTC (rev 13850)
@@ -1,17 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
-<PROCESS model-entity="JSFProcess">
- <PROCESS-ITEM NAME="rules:*" PATH="*" SHAPE="32,17,0,0"
model-entity="JSFProcessGroup">
- <PROCESS-ITEM ID="rules:*:0" NAME="item" PATH="*"
model-entity="JSFProcessItem">
- <PROCESS-ITEM-OUTPUT ID="stateTest::#pages#stateTestPage.jsp"
- NAME="output" PATH="/pages/stateTestPage.jsp"
- TARGET="rules:#pages#stateTestPage.jsp" TITLE="stateTest"
model-entity="JSFProcessItemOutput"/>
- <PROCESS-ITEM-OUTPUT ID="index::#pages#index.jsp"
NAME="output1"
- PATH="/pages/index.jsp" TARGET="rules:#pages#index.jsp"
- TITLE="index" model-entity="JSFProcessItemOutput"/>
+<PROCESS ENTITY="JSFProcess">
+ <PROCESS-ITEM ENTITY="JSFProcessGroup" NAME="rules:*"
PATH="*" SHAPE="32,17,0,0">
+ <PROCESS-ITEM ENTITY="JSFProcessItem" ID="rules:*:0"
NAME="item" PATH="*">
+ <PROCESS-ITEM-OUTPUT ENTITY="JSFProcessItemOutput"
+ ID="stateTest::#pages#stateTestPage.jsp" NAME="output"
+ PATH="/pages/stateTestPage.jsp"
+ TARGET="rules:#pages#stateTestPage.jsp" TITLE="stateTest"/>
+ <PROCESS-ITEM-OUTPUT ENTITY="JSFProcessItemOutput"
+ ID="index::#pages#index.jsp" NAME="output1"
PATH="/pages/index.jsp"
+ TARGET="rules:#pages#index.jsp" TITLE="index"/>
</PROCESS-ITEM>
</PROCESS-ITEM>
- <PROCESS-ITEM NAME="rules:#pages#stateTestPage.jsp"
- PATH="/pages/stateTestPage.jsp" SHAPE="32,465,0,0"
model-entity="JSFProcessGroup"/>
- <PROCESS-ITEM NAME="rules:#pages#index.jsp"
PATH="/pages/index.jsp"
- SHAPE="32,577,0,0" model-entity="JSFProcessGroup"/>
+ <PROCESS-ITEM ENTITY="JSFProcessGroup"
+ NAME="rules:#pages#stateTestPage.jsp"
PATH="/pages/stateTestPage.jsp" SHAPE="32,465,0,0"/>
+ <PROCESS-ITEM ENTITY="JSFProcessGroup"
NAME="rules:#pages#index.jsp"
+ PATH="/pages/index.jsp" SHAPE="32,577,0,0"/>
</PROCESS>
Modified: trunk/samples/extendedDataTable-sample/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/extendedDataTable-sample/src/main/webapp/WEB-INF/web.xml 2009-04-25
10:32:22 UTC (rev 13849)
+++ trunk/samples/extendedDataTable-sample/src/main/webapp/WEB-INF/web.xml 2009-04-25
10:41:47 UTC (rev 13850)
@@ -1,46 +1,60 @@
-<?xml version="1.0"?>
-<web-app version="2.5"
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_2_5.xsd">
- <display-name>Archetype Created Web Application</display-name>
- <context-param>
- <param-name>javax.faces.CONFIG_FILES</param-name>
- <param-value>/WEB-INF/faces-config.xml</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
- <param-value>server</param-value>
- </context-param>
- <context-param>
- <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
- <param-value>false</param-value>
- </context-param>
-
- <filter>
- <display-name>Ajax4jsf Filter</display-name>
- <filter-name>ajax4jsf</filter-name>
- <filter-class>org.ajax4jsf.Filter</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>ajax4jsf</filter-name>
- <servlet-name>Faces Servlet</servlet-name>
- <dispatcher>REQUEST</dispatcher>
- <dispatcher>FORWARD</dispatcher>
- <dispatcher>INCLUDE</dispatcher>
- </filter-mapping>
- <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>/faces/*</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>*.jsf</url-pattern>
- </servlet-mapping>
- <login-config>
- <auth-method>BASIC</auth-method>
- </login-config>
-</web-app>
+<?xml version="1.0"?>
+<web-app version="2.5"
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_2_5.xsd">
+ <display-name>Archetype Created Web Application</display-name>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+ <param-value>com.sun.facelets.FaceletViewHandler</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.VIEW_MAPPINGS</param-name>
+ <param-value>*xhtml</param-value>
+ </context-param>
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+ <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>/faces/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Deleted: trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp 2009-04-25
10:32:22 UTC (rev 13849)
+++ trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp 2009-04-25
10:41:47 UTC (rev 13850)
@@ -1,188 +0,0 @@
-<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
-<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f" %>
-<%@ taglib
uri="http://richfaces.org/rich" prefix="rich" %>
-<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j" %>
-<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/extendedDataTable"
prefix="extdt" %>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
-<f:view>
- <html>
- <head>
- <title>
- <h:outputText value="#{msg['demo.title']}">
- </h:outputText>
- </title>
- <style type="text/css">
-
- .leftColumn {
- width: 50%;
- height: 100%;
- }
-
- .rightColumn {
- width: 50%;
- height: 100%;
- }
-
- table {
- cell-padding: 10;
- cell-spacing: 10;
- }
-
- #mainPanel {
- width: 100%;
- height: 100%;
- }
-
- #leftPanel {
- width: 100%;
- height: 100%;
- }
-
- #rightPanel {
- width: 100%;
- height: 100%;
- }
- </style>
- </head>
-
-<body>
- <h:panelGrid style="table-layout: fixed;" columns="2"
id="mainPanel" columnClasses="leftColumn, rightColumn">
- <rich:spacer></rich:spacer>
- <rich:spacer></rich:spacer>
- <rich:panel id="leftPanel">
- <h:form id="form1">
- <extdt:extendedDataTable id="demoTable"
- value="#{extendedDataTableBean.dataModel}" var="patient"
- style="margin: 0 auto;"
- rows="#{extendedDataTableControlBean.rowsNumber}"
- width="#{extendedDataTableControlBean.width}"
- height="#{extendedDataTableControlBean.height}"
- selectedClass="dataTableSelectedRow" footerClass="demo-footer"
- sortMode="#{extendedDataTableControlBean.sortMode}"
- selectionMode="#{extendedDataTableControlBean.selectionMode}"
- selection="#{extendedDataTableBean.selection}"
rowKeyVar="rkvar"
- enableContextMenu="#{extendedDataTableControlBean.contextMenuEnabled}"
- tableState="#{extendedDataTableBean.tableState}">
- <rich:column id="firstName" headerClass="dataTableHeader"
- width="25%" label="#{msg['patient.firstName']}"
sortable="true"
- sortBy="#{patient.firstName}" filterBy="#{patient.firstName}"
- filterEvent="onkeyup">
- <f:facet name="header">
- <h:outputText value="#{msg['patient.firstName']}" />
- </f:facet>
- <h:outputText id="text" value="#{patient.firstName}">
- <rich:toolTip for="text">
- <h:outputText value="sasasasasasa" />
- </rich:toolTip>
- </h:outputText>
- </rich:column>
- <rich:column id="lastName" headerClass="dataTableHeader"
- width="25%" label="#{msg['patient.lastName']}"
sortable="true"
- sortBy="#{patient.lastName}" filterBy="#{patient.lastName}"
- filterEvent="onkeyup">
- <f:facet name="header">
- <h:outputText value="#{msg['patient.lastName']}" />
- </f:facet>
- <h:outputText value="#{patient.lastName}" />
- </rich:column>
- <rich:column id="admissionDate"
headerClass="dataTableHeader"
- width="50%" label="#{msg['patient.admissionDate']}"
- sortable="true" sortBy="#{patient.admissionDate}">
- <f:facet name="header">
- <h:outputText value="#{msg['patient.admissionDate']}" />
- </f:facet>
- <h:outputText value="#{patient.admissionDate}" />
- </rich:column>
-
- <f:facet name="footer">
- <rich:datascroller
- style="width: #{extendedDataTableControlBean.width}"
- rendered="#{extendedDataTableControlBean.paginated}"
- for="demoTable">
- </rich:datascroller>
- </f:facet>
- <a4j:support event="onselectionchange"
- action="#{extendedDataTableBean.takeSelection}"
- reRender="selectedPatients" />
- </extdt:extendedDataTable>
- </h:form>
- </rich:panel>
- <rich:panel id="rightPanel">
- <h:form>
- <h:panelGrid columns="2">
- <h:outputLabel value="#{msg['table.width']}"
for="tableWidthInput" />
- <h:inputText
- id="tableWidthInput"
- value="#{extendedDataTableControlBean.width}" />
- <h:outputLabel value="#{msg['table.height']}"
for="tableHeightInput" />
- <h:inputText
- id="tableHeightInput"
- value="#{extendedDataTableControlBean.height}" />
- <h:outputLabel value="#{msg['table.patientsNumber']}"
for="tablePatientsNumberInput" />
- <h:inputText
- id="tablePatientsNumberInput"
- value="#{extendedDataTableBean.patientsNumber}" />
- <h:outputLabel value="#{msg['table.enableContextMenu']}"
for="tableEnableContextMenu" />
- <h:selectBooleanCheckbox
- id="tableEnableContextMenu"
- value="#{extendedDataTableControlBean.contextMenuEnabled}"
/>
- <h:outputLabel value="#{msg['table.sortMode']}"
for="tableSortModeSelect" />
- <h:selectOneMenu
- id="tableSortModeSelect"
- value="#{extendedDataTableControlBean.sortMode}"
- >
- <f:selectItems
value="#{extendedDataTableControlBean.sortModeSelectItems}"/>
- </h:selectOneMenu>
- <h:outputLabel value="#{msg['table.selectionMode']}"
for="tableSelectionModeSelect" />
- <h:selectOneMenu
- id="tableSelectionModeSelect"
- value="#{extendedDataTableControlBean.selectionMode}"
- >
- <f:selectItems
value="#{extendedDataTableControlBean.selectionModeSelectItems}"/>
- </h:selectOneMenu>
- <h:outputLabel value="#{msg['table.paginated']}"
for="paginatedCheckbox" />
- <h:selectBooleanCheckbox
- id="paginatedCheckbox"
- value="#{extendedDataTableControlBean.paginated}" />
- <h:outputLabel value="#{msg['table.rowsNumber']}"
for="tableRowsNumberInput" />
- <h:inputText
- id="tableRowsNumberInput"
- value="#{extendedDataTableControlBean.rowsNumber}" />
- </h:panelGrid>
- <a4j:commandButton value="#{msg['table.update']}"
reRender="mainPanel">
- </a4j:commandButton>
- <a4j:commandButton
value="#{msg['table.testComponentState']}"
- action="stateTest"
- >
- </a4j:commandButton>
- <rich:spacer height="5px" width="100%">
- </rich:spacer>
- <rich:dataTable id="selectedPatients"
value="#{extendedDataTableBean.selectedItems}"
var="selectedPatient">
- <f:facet name="header">
- <h:outputText
value="#{msg['table.selectedPatients']}" />
- </f:facet>
- <rich:column id="selectedFirstName"
- headerClass="dataTableHeader"
- label="#{msg['patient.firstName']}">
- <f:facet name="header">
- <h:outputText
value="#{msg['patient.firstName']}" />
- </f:facet>
- <h:outputText value="#{selectedPatient.firstName}" />
- </rich:column>
- <rich:column id="selectedLastName"
- headerClass="dataTableHeader"
- label="#{msg['patient.lastName']}">
- <f:facet name="header">
- <h:outputText value="#{msg['patient.lastName']}"
/>
- </f:facet>
- <h:outputText value="#{selectedPatient.lastName}" />
- </rich:column>
- </rich:dataTable>
- <rich:messages>
- </rich:messages>
- </h:form>
- </rich:panel>
- </h:panelGrid>
-</body>
-</html>
-</f:view>
\ No newline at end of file
Added: trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.xhtml
(rev 0)
+++ trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.xhtml 2009-04-25
10:41:47 UTC (rev 13850)
@@ -0,0 +1,199 @@
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:extdt="http://labs.jboss.com/jbossrichfaces/ui/extendedDataTab...
+
xmlns:a4j="http://richfaces.org/a4j">
+
+<head>
+<title><h:outputText value="#{msg['demo.title']}">
+</h:outputText></title>
+<style type="text/css">
+.leftColumn {
+ width: 50%;
+ height: 100%;
+}
+
+.rightColumn {
+ width: 50%;
+ height: 100%;
+}
+
+#mainPanel {
+ width: 100%;
+ height: 100%;
+}
+
+#leftPanel {
+ width: 100%;
+ height: 100%;
+}
+
+#rightPanel {
+ width: 100%;
+ height: 100%;
+}
+</style>
+</head>
+<body>
+<f:view>
+ <table style="width: 100%;">
+ <tr>
+ <td />
+ <td />
+ </tr>
+ <tr style="width: 100%;">
+ <td class="leftColumn"><rich:panel id="leftPanel">
+ <h:form id="form1">
+ <extdt:extendedDataTable id="demoTable"
+ value="#{extendedDataTableBean.dataModel}" var="patient"
+ style="margin: 0 auto;"
+ rows="#{extendedDataTableControlBean.rowsNumber}"
+ width="#{extendedDataTableControlBean.width}"
+ height="#{extendedDataTableControlBean.height}"
+ selectedClass="dataTableSelectedRow" footerClass="demo-footer"
+ sortMode="#{extendedDataTableControlBean.sortMode}"
+ selectionMode="#{extendedDataTableControlBean.selectionMode}"
+ selection="#{extendedDataTableBean.selection}"
rowKeyVar="rkvar"
+ enableContextMenu="#{extendedDataTableControlBean.contextMenuEnabled}"
+ tableState="#{extendedDataTableBean.tableState}">
+ <rich:column id="firstName" headerClass="dataTableHeader"
+ width="25%" label="#{msg['patient.firstName']}"
sortable="true"
+ sortBy="#{patient.firstName}" filterBy="#{patient.firstName}"
+ filterEvent="onkeyup">
+ <f:facet name="header">
+ <h:outputText value="#{msg['patient.firstName']}" />
+ </f:facet>
+ <h:outputText id="text" value="#{patient.firstName}">
+ <rich:toolTip for="text">
+ <h:outputText value="sasasasasasa" />
+ </rich:toolTip>
+ </h:outputText>
+ </rich:column>
+ <rich:column id="lastName" headerClass="dataTableHeader"
+ width="25%" label="#{msg['patient.lastName']}"
sortable="true"
+ sortBy="#{patient.lastName}" filterBy="#{patient.lastName}"
+ filterEvent="onkeyup">
+ <f:facet name="header">
+ <h:outputText value="#{msg['patient.lastName']}" />
+ </f:facet>
+ <h:outputText value="#{patient.lastName}" />
+ </rich:column>
+ <rich:column id="admissionDate"
headerClass="dataTableHeader"
+ width="50%" label="#{msg['patient.admissionDate']}"
+ sortable="true" sortBy="#{patient.admissionDate}">
+ <f:facet name="header">
+ <h:outputText value="#{msg['patient.admissionDate']}" />
+ </f:facet>
+ <h:outputText value="#{patient.admissionDate}" />
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:datascroller
+ style="width: #{extendedDataTableControlBean.width}"
+ rendered="#{extendedDataTableControlBean.paginated}"
+ for="demoTable">
+ </rich:datascroller>
+ </f:facet>
+ <a4j:support event="onselectionchange"
+ action="#{extendedDataTableBean.takeSelection}"
+ reRender="selectedPatients" />
+ </extdt:extendedDataTable>
+ </h:form>
+ </rich:panel></td>
+ <td class="rightColumn"><rich:panel id="rightPanel">
+ <rich:tabPanel switchType="ajax">
+ <rich:tab label="#{msg['component.test']}">
+ <h:form id="componentTestForm">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="#{msg['table.width']}"
+ for="tableWidthInput" />
+ <h:inputText id="tableWidthInput"
+ value="#{extendedDataTableControlBean.width}" />
+ <h:outputLabel value="#{msg['table.height']}"
+ for="tableHeightInput" />
+ <h:inputText id="tableHeightInput"
+ value="#{extendedDataTableControlBean.height}" />
+ <h:outputLabel value="#{msg['table.patientsNumber']}"
+ for="tablePatientsNumberInput" />
+ <h:inputText id="tablePatientsNumberInput"
+ value="#{extendedDataTableBean.patientsNumber}" />
+ <h:outputLabel value="#{msg['table.enableContextMenu']}"
+ for="tableEnableContextMenu" />
+ <h:selectBooleanCheckbox id="tableEnableContextMenu"
+ value="#{extendedDataTableControlBean.contextMenuEnabled}" />
+ <h:outputLabel value="#{msg['table.sortMode']}"
+ for="tableSortModeSelect" />
+ <h:selectOneMenu id="tableSortModeSelect"
+ value="#{extendedDataTableControlBean.sortMode}">
+ <f:selectItems
+ value="#{extendedDataTableControlBean.sortModeSelectItems}" />
+ </h:selectOneMenu>
+ <h:outputLabel value="#{msg['table.selectionMode']}"
+ for="tableSelectionModeSelect" />
+ <h:selectOneMenu id="tableSelectionModeSelect"
+ value="#{extendedDataTableControlBean.selectionMode}">
+ <f:selectItems
+ value="#{extendedDataTableControlBean.selectionModeSelectItems}"
/>
+ </h:selectOneMenu>
+ <h:outputLabel value="#{msg['table.paginated']}"
+ for="paginatedCheckbox" />
+ <h:selectBooleanCheckbox id="paginatedCheckbox"
+ value="#{extendedDataTableControlBean.paginated}" />
+ <h:outputLabel value="#{msg['table.rowsNumber']}"
+ for="tableRowsNumberInput" />
+ <h:inputText id="tableRowsNumberInput"
+ value="#{extendedDataTableControlBean.rowsNumber}" />
+ </h:panelGrid>
+ <a4j:commandButton value="#{msg['table.update']}"
+ reRender="demoTable">
+ </a4j:commandButton>
+ <a4j:commandButton
value="#{msg['table.testComponentState']}"
+ action="stateTest">
+ </a4j:commandButton>
+ <rich:spacer height="5px" width="100%">
+ </rich:spacer>
+ <rich:dataTable id="selectedPatients"
+ value="#{extendedDataTableBean.selectedItems}"
+ var="selectedPatient">
+ <f:facet name="header">
+ <h:outputText value="#{msg['table.selectedPatients']}"
/>
+ </f:facet>
+ <rich:column id="selectedFirstName"
+ headerClass="dataTableHeader"
+ label="#{msg['patient.firstName']}">
+ <f:facet name="header">
+ <h:outputText value="#{msg['patient.firstName']}" />
+ </f:facet>
+ <h:outputText value="#{selectedPatient.firstName}" />
+ </rich:column>
+ <rich:column id="selectedLastName"
headerClass="dataTableHeader"
+ label="#{msg['patient.lastName']}">
+ <f:facet name="header">
+ <h:outputText value="#{msg['patient.lastName']}" />
+ </f:facet>
+ <h:outputText value="#{selectedPatient.lastName}" />
+ </rich:column>
+ </rich:dataTable>
+ </h:form>
+ </rich:tab>
+ <rich:tab label="#{msg['dataModel.test']}">
+ <h:form id="dataModelTestForm">
+ <a4j:commandButton
value="#{msg['table.serializeDataModel']}"
+ actionListener="#{extendedDataTableBean.serializeModel}" />
+ <a4j:commandButton
value="#{msg['table.deserializeDataModel']}"
+ reRender="demoTable"
+ actionListener="#{extendedDataTableBean.deserializeModel}" />
+ </h:form>
+ </rich:tab>
+ </rich:tabPanel>
+ <rich:messages>
+ </rich:messages>
+ </rich:panel></td>
+ </tr>
+ </table>
+</f:view>
+</body>
+</html>
\ No newline at end of file
Deleted: trunk/samples/extendedDataTable-sample/src/main/webapp/pages/stateTestPage.jsp
===================================================================
---
trunk/samples/extendedDataTable-sample/src/main/webapp/pages/stateTestPage.jsp 2009-04-25
10:32:22 UTC (rev 13849)
+++
trunk/samples/extendedDataTable-sample/src/main/webapp/pages/stateTestPage.jsp 2009-04-25
10:41:47 UTC (rev 13850)
@@ -1,24 +0,0 @@
-<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
-<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f" %>
-<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j" %>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
-<f:view>
- <html>
- <head>
- <title>
- <h:outputText value="#{msg['demo.testPageTitle']}">
- </h:outputText>
- </title>
-
- </head>
-
-<body>
- <h:form>
- <a4j:commandButton value="#{msg['table.back']}"
- action="index"
- >
- </a4j:commandButton>
- </h:form>
-</body>
-</html>
-</f:view>
\ No newline at end of file
Copied: trunk/samples/extendedDataTable-sample/src/main/webapp/pages/stateTestPage.xhtml
(from rev 13415,
trunk/samples/extendedDataTable-sample/src/main/webapp/pages/stateTestPage.jsp)
===================================================================
--- trunk/samples/extendedDataTable-sample/src/main/webapp/pages/stateTestPage.xhtml
(rev 0)
+++
trunk/samples/extendedDataTable-sample/src/main/webapp/pages/stateTestPage.xhtml 2009-04-25
10:41:47 UTC (rev 13850)
@@ -0,0 +1,23 @@
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:extdt="http://labs.jboss.com/jbossrichfaces/ui/extendedDataTab...
+
xmlns:a4j="http://richfaces.org/a4j">
+
+<head>
+<title><h:outputText value="#{msg['demo.title']}">
+</h:outputText></title>
+
+</head>
+<body>
+<f:view>
+ <h:form>
+ <a4j:commandButton value="#{msg['table.back']}"
action="index">
+ </a4j:commandButton>
+ </h:form>
+</f:view>
+</body>
+</html>
\ No newline at end of file
Property changes on:
trunk/samples/extendedDataTable-sample/src/main/webapp/pages/stateTestPage.xhtml
___________________________________________________________________
Name: svn:mergeinfo
+