Author: abelevich
Date: 2010-06-25 10:54:42 -0400 (Fri, 25 Jun 2010)
New Revision: 17670
Modified:
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/component/UISubTable.java
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java
root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/subtable-toggler.js
root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/subtable.js
Log:
RF-8658
Modified:
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/component/UISubTable.java
===================================================================
---
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/component/UISubTable.java 2010-06-25
00:01:41 UTC (rev 17669)
+++
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/component/UISubTable.java 2010-06-25
14:54:42 UTC (rev 17670)
@@ -66,8 +66,16 @@
valueExpression.setValue(elContext, newValue);
}
- String render = resolveClientId(facesContext, this, BODY);
- getFacesContext().getPartialViewContext().getRenderIds().add(render);
+ if(getFacesContext().getPartialViewContext().isAjaxRequest()) {
+ String render = resolveClientId(facesContext, this, BODY);
+
+ getFacesContext().getPartialViewContext().getRenderIds().add(render);
+
+ String togglerId = toggleEvent.getTogglerId();
+ if(togglerId != null) {
+
getFacesContext().getPartialViewContext().getRenderIds().add(togglerId);
+ }
+ }
}
super.broadcast(event);
Modified:
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java
===================================================================
---
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java 2010-06-25
00:01:41 UTC (rev 17669)
+++
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java 2010-06-25
14:54:42 UTC (rev 17670)
@@ -87,9 +87,12 @@
String clientId = subTable.getClientId(facesContext);
Map<String, String> requestMap =
facesContext.getExternalContext().getRequestParameterMap();
+ String optionsId = clientId + OPTIONS;
+ String togglerId = requestMap.get(optionsId);
+
String stateId = clientId + STATE;
String state = (String)requestMap.get(stateId);
-
+
boolean isExpand = true;
if(state != null) {
int newValue = Integer.parseInt(state);
@@ -99,7 +102,7 @@
}
if(subTable.isExpanded() != isExpand) {
- new ToggleEvent(subTable, isExpand).queue();
+ new ToggleEvent(subTable, isExpand, togglerId).queue();
}
}
}
Modified:
root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/subtable-toggler.js
===================================================================
---
root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/subtable-toggler.js 2010-06-25
00:01:41 UTC (rev 17669)
+++
root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/subtable-toggler.js 2010-06-25
14:54:42 UTC (rev 17670)
@@ -23,7 +23,12 @@
toggle: function(e) {
var subtable = richfaces.$(this.forId);
if(subtable) {
- this.toggleControl(subtable.isExpand());
+ var mode = subtable.getMode();
+
+ if(richfaces.ui.SubTable.MODE_CLNT == mode) {
+ this.toggleControl(subtable.isExpand());
+ }
+
subtable.setOption(this.id);
subtable.toggle(e);
}
Modified:
root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/subtable.js
===================================================================
---
root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/subtable.js 2010-06-25
00:01:41 UTC (rev 17669)
+++
root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/subtable.js 2010-06-25
14:54:42 UTC (rev 17670)
@@ -103,7 +103,11 @@
setOption: function(option) {
optionsInputElem.call(this).val(option);
- }
+ },
+
+ getMode: function() {
+ return this.expandMode;
+ }
};
})());
Show replies by date