Author: ilya_shaikovsky
Date: 2008-06-10 06:27:00 -0400 (Tue, 10 Jun 2008)
New Revision: 8972
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
trunk/samples/richfaces-demo/src/main/webapp/richfaces/scrollableDataTable/examples/scrollableDataTable.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-3262
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java 2008-06-10
10:00:44 UTC (rev 8971)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java 2008-06-10
10:27:00 UTC (rev 8972)
@@ -172,12 +172,16 @@
public String takeSelection() {
getSelectedCars().clear();
- Iterator<Object> iterator = getSelection().getKeys();
- while (iterator.hasNext()){
- Object key = iterator.next();
- table.setRowKey(key);
- if (table.isRowAvailable()) {
- getSelectedCars().add((DemoInventoryItem) table.getRowData());
+ if (getSelection().isSelectAll()){
+ getSelectedCars().addAll(allCars);
+ }else{
+ Iterator<Object> iterator = getSelection().getKeys();
+ while (iterator.hasNext()){
+ Object key = iterator.next();
+ table.setRowKey(key);
+ if (table.isRowAvailable()) {
+ getSelectedCars().add((DemoInventoryItem) table.getRowData());
+ }
}
}
return null;
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/scrollableDataTable/examples/scrollableDataTable.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/scrollableDataTable/examples/scrollableDataTable.xhtml 2008-06-10
10:00:44 UTC (rev 8971)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/scrollableDataTable/examples/scrollableDataTable.xhtml 2008-06-10
10:27:00 UTC (rev 8972)
@@ -5,7 +5,13 @@
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
-
+ <style>
+ .scrolls{
+ width:300px;
+ height:200px;
+ overflow:auto;
+ }
+ </style>
<h:form>
<rich:spacer height="30" />
<rich:scrollableDataTable rowKeyVar="rkv" frozenColCount="1"
height="400px"
@@ -44,13 +50,14 @@
action="#{dataTableScrollerBean.takeSelection}"
oncomplete="javascript:Richfaces.showModalPanel('panel');"/>
</h:form>
- <rich:modalPanel id="panel" autosized="true">
+ <rich:modalPanel id="panel" autosized="false"
keepVisualState="false" width="315" height="230">
<f:facet name="header">
<h:outputText value="Selected Rows"/>
</f:facet>
<f:facet name="controls">
<span style="cursor:pointer"
onclick="javascript:Richfaces.hideModalPanel('panel')">X</span>
</f:facet>
+ <h:panelGroup layout="block" styleClass="scrolls">
<rich:dataTable value="#{dataTableScrollerBean.selectedCars}"
var="sel" id="table">
<rich:column>
<f:facet name="header"><h:outputText value="Make"
/></f:facet>
@@ -72,6 +79,7 @@
<f:facet name="header"><h:outputText value="Stock"
/></f:facet>
<h:outputText value="#{sel.stock}" />
</rich:column>
- </rich:dataTable>
+ </rich:dataTable>
+ </h:panelGroup>
</rich:modalPanel>
</ui:composition>
\ No newline at end of file