Author: konstantin.mishin
Date: 2008-05-30 07:06:42 -0400 (Fri, 30 May 2008)
New Revision: 8839
Modified:
trunk/samples/sortingFilteringDemo/src/main/java/org/richfaces/sandbox/Bean.java
trunk/samples/sortingFilteringDemo/src/main/webapp/pages/index.jsp
Log:
RF-3012 update demo
Modified:
trunk/samples/sortingFilteringDemo/src/main/java/org/richfaces/sandbox/Bean.java
===================================================================
---
trunk/samples/sortingFilteringDemo/src/main/java/org/richfaces/sandbox/Bean.java 2008-05-30
11:02:23 UTC (rev 8838)
+++
trunk/samples/sortingFilteringDemo/src/main/java/org/richfaces/sandbox/Bean.java 2008-05-30
11:06:42 UTC (rev 8839)
@@ -6,6 +6,10 @@
import java.util.ArrayList;
import java.util.Collection;
+import javax.faces.model.ListDataModel;
+
+import org.richfaces.demo.datagrid.model.Issue;
+import org.richfaces.demo.datagrid.service.JiraService;
import org.richfaces.model.Ordering;
/**
@@ -17,6 +21,8 @@
private String sortMode;
private Ordering[] sortOrder;
private Collection<String> sortPriority;
+ private Issue selectedIssue;
+ private ListDataModel model = new ListDataModel(new
JiraService().getChannel().getIssues());
public Bean() {
sortOrder = new Ordering[4];
@@ -58,4 +64,24 @@
public void setSortOrder(Ordering[] sortOrder) {
this.sortOrder = sortOrder;
}
+
+ public Issue getSelectedIssue() {
+ return selectedIssue;
+ }
+
+ public void setSelectedIssue(Issue selectedIssue) {
+ this.selectedIssue = selectedIssue;
+ }
+
+ public void select() {
+ selectedIssue = (Issue) model.getRowData();
+ }
+
+ public ListDataModel getModel() {
+ return model;
+ }
+
+ public void setModel(ListDataModel model) {
+ this.model = model;
+ }
}
Modified: trunk/samples/sortingFilteringDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/sortingFilteringDemo/src/main/webapp/pages/index.jsp 2008-05-30 11:02:23
UTC (rev 8838)
+++ trunk/samples/sortingFilteringDemo/src/main/webapp/pages/index.jsp 2008-05-30 11:06:42
UTC (rev 8839)
@@ -15,7 +15,29 @@
<f:selectItem itemLabel="multi" itemValue="multi"/>
<a4j:support event="onchange" reRender="dataTable"
action="#{bean.clearSortPriority}"></a4j:support>
</h:selectOneRadio>
- <dt:dataTable id="dataTable"
value="#{jiraService.channel.issues}" var="issue"
sortMode="#{bean.sortMode}" sortPriority="#{bean.sortPriority}">
+ <h:panelGroup id="selectionTable">
+ <table >
+ <tr>
+ <td>Selected Issue</td>
+ <td>
+ <h:outputText
value="#{bean.selectedIssue.key.value}"></h:outputText>
+ </td>
+ <td>
+ <h:outputText
value="#{bean.selectedIssue.summary}"></h:outputText>
+ </td>
+ <td>
+ <h:outputText
value="#{bean.selectedIssue.assignee.name}"></h:outputText>
+ </td>
+ <td>
+ <h:outputText
value="#{bean.selectedIssue.reporter.name}"></h:outputText>
+ </td>
+ </tr>
+ </table>
+ </h:panelGroup>
+ <dt:dataTable id="dataTable" value="#{bean.model}"
var="issue" sortMode="#{bean.sortMode}"
sortPriority="#{bean.sortPriority}">
+ <dt:column>
+ <a4j:commandLink value="Select" action="#{bean.select}"
reRender="selectionTable"></a4j:commandLink>
+ </dt:column>
<dt:column filterBy="#{issue.key.value}" filterValue="CH-"
sortBy="#{issue.key}" width="60px"
sortOrder="#{bean.sortOrder[0]}" filterEvent="onkeyup">
<f:facet name="header">
Show replies by date