Author: pkawiak
Date: 2008-09-23 04:01:37 -0400 (Tue, 23 Sep 2008)
New Revision: 10540
Modified:
trunk/samples/extendedDataTable-sample/src/main/java/org/richfaces/samples/extdt/beans/ExtendedDataTableControlBean.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/pages/index.jsp
Log:
Updating the demo to show selection handling
Modified:
trunk/samples/extendedDataTable-sample/src/main/java/org/richfaces/samples/extdt/beans/ExtendedDataTableControlBean.java
===================================================================
---
trunk/samples/extendedDataTable-sample/src/main/java/org/richfaces/samples/extdt/beans/ExtendedDataTableControlBean.java 2008-09-23
06:39:57 UTC (rev 10539)
+++
trunk/samples/extendedDataTable-sample/src/main/java/org/richfaces/samples/extdt/beans/ExtendedDataTableControlBean.java 2008-09-23
08:01:37 UTC (rev 10540)
@@ -7,7 +7,7 @@
public class ExtendedDataTableControlBean {
- String width = "500px";
+ String width = "100%";
String height = "500px";
List<SelectItem> sortModeSelectItems = new ArrayList<SelectItem>();
List<SelectItem> selectionModeSelectItems = new ArrayList<SelectItem>();
Modified:
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages.properties
===================================================================
---
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages.properties 2008-09-23
06:39:57 UTC (rev 10539)
+++
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages.properties 2008-09-23
08:01:37 UTC (rev 10540)
@@ -14,3 +14,4 @@
demo.testPageTitle=Component state test page
table.paginated=Enable paginator
table.rowsNumber=Number of rows
+table.selectedPatients=Selected patients
Modified:
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages_en.properties
===================================================================
---
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages_en.properties 2008-09-23
06:39:57 UTC (rev 10539)
+++
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages_en.properties 2008-09-23
08:01:37 UTC (rev 10540)
@@ -14,3 +14,4 @@
demo.testPageTitle=Component state test page
table.paginated=Enable paginator
table.rowsNumber=Number of rows
+table.selectedPatients=Selected patients
Modified:
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages_pl.properties
===================================================================
---
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages_pl.properties 2008-09-23
06:39:57 UTC (rev 10539)
+++
trunk/samples/extendedDataTable-sample/src/main/resources/i18n/messages_pl.properties 2008-09-23
08:01:37 UTC (rev 10540)
@@ -14,3 +14,4 @@
demo.testPageTitle=Component state test page
table.paginated=Enable paginator
table.rowsNumber=Number of rows
+table.selectedPatients=Selected patients
Modified: trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp 2008-09-23
06:39:57 UTC (rev 10539)
+++ trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp 2008-09-23
08:01:37 UTC (rev 10540)
@@ -23,6 +23,11 @@
height: 100%;
}
+ table {
+ cell-padding: 10;
+ cell-spacing: 10;
+ }
+
#mainPanel {
width: 100%;
height: 100%;
@@ -41,12 +46,15 @@
</head>
<body>
- <h:panelGrid columns="2" id="mainPanel"
columnClasses="leftColumn, rightColumn">
+ <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>
+ <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}"
@@ -59,7 +67,7 @@
tableState="#{extendedDataTableBean.tableState}">
<rich:column id="firstName"
headerClass="dataTableHeader"
- width="150"
+ width="25%"
label="#{msg['patient.firstName']}"
sortable="true"
sortBy="#{patient.firstName}"
@@ -68,11 +76,15 @@
<f:facet name="header">
<h:outputText
value="#{msg['patient.firstName']}" />
</f:facet>
- <h:outputText value="#{patient.firstName}" />
+ <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="150"
+ width="25%"
label="#{msg['patient.lastName']}"
sortable="true"
sortBy="#{patient.lastName}"
@@ -85,7 +97,7 @@
</rich:column>
<rich:column id="admissionDate"
headerClass="dataTableHeader"
- width="150"
+ width="50%"
label="#{msg['patient.admissionDate']}"
sortable="true"
sortBy="#{patient.admissionDate}">
@@ -94,13 +106,15 @@
</f:facet>
<h:outputText value="#{patient.admissionDate}" />
</rich:column>
+ <a4j:support event="onselectionchange"
action="#{extendedDataTableBean.takeSelection}"
reRender="selectedPatients">
+ </a4j:support>
</extdt:extendedDataTable>
<rich:datascroller
style="width: #{extendedDataTableControlBean.width}"
rendered="#{extendedDataTableControlBean.paginated}"
for="demoTable">
</rich:datascroller>
- </h:form>
+ </h:form>
</rich:panel>
<rich:panel id="rightPanel">
<h:form>
@@ -146,6 +160,29 @@
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>