Author: abelevich
Date: 2010-03-26 10:37:17 -0400 (Fri, 26 Mar 2010)
New Revision: 16674
Modified:
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/DataBean.java
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/model/Employee.java
root/examples-sandbox/trunk/components/tables/src/main/webapp/home.xhtml
Log:
insert dataScrollers into subTables
Modified:
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/DataBean.java
===================================================================
---
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/DataBean.java 2010-03-26
14:35:49 UTC (rev 16673)
+++
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/DataBean.java 2010-03-26
14:37:17 UTC (rev 16674)
@@ -5,6 +5,7 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
+import org.ajax4jsf.model.DataComponentState;
import org.richfaces.demo.model.Employee;
import org.richfaces.demo.utils.EmployeeUtils;
import org.richfaces.event.SortingEvent;
@@ -12,13 +13,21 @@
@ManagedBean(name="dataBean")
@SessionScoped
public class DataBean {
-
- private List<Employee> employeeList;
+
+ DataComponentState componentState;
+
+ public DataComponentState getComponentState() {
+ return componentState;
+ }
+
+ public void setComponentState(DataComponentState componentState) {
+ this.componentState = componentState;
+ }
+
+ private List<Employee> employeeList;
private boolean state = true;
-
-
- public void setEmployeeList(List<Employee> employeeList) {
+ public void setEmployeeList(List<Employee> employeeList) {
this.employeeList = employeeList;
}
Modified:
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/model/Employee.java
===================================================================
---
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/model/Employee.java 2010-03-26
14:35:49 UTC (rev 16673)
+++
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/model/Employee.java 2010-03-26
14:37:17 UTC (rev 16674)
@@ -12,7 +12,7 @@
private String title;
- private Company company;
+ private List <Company> companies;
private String eMail;
@@ -53,12 +53,12 @@
this.name = name;
}
- public Company getCompany() {
- return company;
+ public List <Company> getCompanies() {
+ return companies;
}
- public void setCompany(Company company) {
- this.company = company;
+ public void setCompanies(List<Company> companies) {
+ this.companies = companies;
}
public String getEMail() {
@@ -88,8 +88,8 @@
Employee employee = (Employee) obj;
return name.equals(employee.getName())
&& title.equals(employee.getTitle())
- && (company == null ? employee.getCompany() == null : company
- .equals(employee.getCompany()));
+ && (companies == null ? employee.getCompanies() == null : companies
+ .equals(employee.getCompanies()));
}
@Override
@@ -97,7 +97,7 @@
int hash = 1;
hash = hash * 17 + name.hashCode();
hash = hash * 17 + title.hashCode();
- hash = hash * 17 + (company == null ? 0 : company.hashCode());
+ hash = hash * 17 + (companies == null ? 0 : companies.hashCode());
return hash;
}
Modified: root/examples-sandbox/trunk/components/tables/src/main/webapp/home.xhtml
===================================================================
--- root/examples-sandbox/trunk/components/tables/src/main/webapp/home.xhtml 2010-03-26
14:35:49 UTC (rev 16673)
+++ root/examples-sandbox/trunk/components/tables/src/main/webapp/home.xhtml 2010-03-26
14:37:17 UTC (rev 16674)
@@ -21,9 +21,9 @@
</f:facet>
<f:facet name="header">
<rich:colGroup id="headerFacet1">
- <rich:column colspan="3"><h:outputText
id="headerFacet12" value="header column 1">
</h:outputText></rich:column>
- <rich:column breakBefore="true"><h:outputText
id="headerFacet13" value="header column
2"></h:outputText></rich:column>
- <rich:column colspan="2"><h:outputText
id="headerFacet14" value="header column
3"></h:outputText></rich:column>
+ <rich:column><h:outputText id="headerFacet12"
value="header column 1"> </h:outputText></rich:column>
+ <rich:column><h:outputText id="headerFacet13" value="header
column 2"></h:outputText></rich:column>
+ <rich:column><h:outputText id="headerFacet14" value="header
column 3"></h:outputText></rich:column>
</rich:colGroup>
</f:facet>
<rich:column id="column_name" sortBy="#{record.name}"
sortIconAsc="resources/images/asc.gif"
sortIconDesc="resources/images/desc.gif"
sortIconUnsort="resources/images/unsort.gif">
@@ -48,17 +48,13 @@
<h:outputText value="#{record.EMail}" />
</rich:column>
- <rich:subTable id="expandedSubTable" var="company"
value="#{record.company}" rows="20" switchType="ajax"
expanded="true">
+ <rich:subTable id="expandedSubTable" var="company"
value="#{record.companies}" rows="1" switchType="ajax"
expanded="true">
<f:facet name="header">
- <rich:colGroup id="headerFacet1" >
- <rich:column><h:outputText id="headerFacet12"
value="company"> </h:outputText></rich:column>
- <rich:column><h:outputText id="headerFacet13"
value="office location"></h:outputText></rich:column>
- <rich:column><h:outputText id="headerFacet14"
value="phone"></h:outputText></rich:column>
- </rich:colGroup>
+ <ds:dataScroller id="subscroller" for="expandedSubTable"
maxPages="3"></ds:dataScroller >
</f:facet>
<f:facet name="footer">
- <h:outputText value="SubTable Footer facet" />
+ <h:outputText value="footer"/>
</f:facet>
<rich:column id="column_company_name">
@@ -79,8 +75,8 @@
</f:facet>
</rich:dataTable>
-
- <ds:dataScroller id="ds" for="richTable"
maxPages="7"></ds:dataScroller>
+ <ds:dataScroller id="scroller" for="richTable"
maxPages="7"></ds:dataScroller >
+
<br/>
<h:commandButton value="submit" />
</h:form>
Show replies by date