Author: nbelaevski
Date: 2007-11-21 18:19:14 -0500 (Wed, 21 Nov 2007)
New Revision: 4160
Modified:
branches/3.1.x/samples/orderingListDemo/src/main/java/org/richfaces/Bean.java
branches/3.1.x/samples/orderingListDemo/src/main/java/org/richfaces/OrderingListDemoBean.java
branches/3.1.x/samples/orderingListDemo/src/main/webapp/pages/index.jsp
Log:
http://jira.jboss.com/jira/browse/RF-1395
Modified: branches/3.1.x/samples/orderingListDemo/src/main/java/org/richfaces/Bean.java
===================================================================
---
branches/3.1.x/samples/orderingListDemo/src/main/java/org/richfaces/Bean.java 2007-11-21
19:50:03 UTC (rev 4159)
+++
branches/3.1.x/samples/orderingListDemo/src/main/java/org/richfaces/Bean.java 2007-11-21
23:19:14 UTC (rev 4160)
@@ -93,8 +93,11 @@
}
private void queueEvent(PhaseId phaseId) {
- new Event(this, getList().getRowData(),
- getList().getClientId(FacesContext.getCurrentInstance()), phaseId).queue();
+ UIOrderingList list = getList();
+ if (list.isRowAvailable()) {
+ new Event(this, list.getRowData(),
+ getList().getClientId(FacesContext.getCurrentInstance()), phaseId).queue();
+ }
}
public void processDecodes(FacesContext context) {
@@ -126,9 +129,12 @@
System.out.println(cid + " !!! " + ((Event) event).getClientId());
}
- Object rd = getList().getRowData();
- if (!rd.equals(((Event) event).getValue())) {
- System.out.println(rd + " !!! " + ((Event) event).getValue());
+ UIOrderingList list = getList();
+ if (list.isRowAvailable()) {
+ Object rd = list.getRowData();
+ if (!rd.equals(((Event) event).getValue())) {
+ System.out.println(rd + " !!! " + ((Event) event).getValue());
+ }
}
} else {
super.broadcast(event);
Modified:
branches/3.1.x/samples/orderingListDemo/src/main/java/org/richfaces/OrderingListDemoBean.java
===================================================================
---
branches/3.1.x/samples/orderingListDemo/src/main/java/org/richfaces/OrderingListDemoBean.java 2007-11-21
19:50:03 UTC (rev 4159)
+++
branches/3.1.x/samples/orderingListDemo/src/main/java/org/richfaces/OrderingListDemoBean.java 2007-11-21
23:19:14 UTC (rev 4160)
@@ -103,5 +103,7 @@
this.onbottomclick = onbottomclick;
}
-
+ public void clear() {
+ this.items.clear();
+ }
}
Modified: branches/3.1.x/samples/orderingListDemo/src/main/webapp/pages/index.jsp
===================================================================
--- branches/3.1.x/samples/orderingListDemo/src/main/webapp/pages/index.jsp 2007-11-21
19:50:03 UTC (rev 4159)
+++ branches/3.1.x/samples/orderingListDemo/src/main/webapp/pages/index.jsp 2007-11-21
23:19:14 UTC (rev 4160)
@@ -178,7 +178,9 @@
</h:panelGroup>
</h:panelGrid>
<h3>Ordering lists within a4j:repeat</h3>
- <a4j:commandButton reRender="repeat" value="Rerender
a4j:repeat" />
+ <a4j:commandButton reRender="repeat" value="Rerender
a4j:repeat" />
+
+ <h:commandButton value="Clear list"
action="#{demoBean.clear}"></h:commandButton>
</h:form>
</f:view>
</body>