Author: abelevich
Date: 2009-08-25 17:11:15 -0400 (Tue, 25 Aug 2009)
New Revision: 15304
Modified:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
Log:
Modified:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
---
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-08-25
21:10:30 UTC (rev 15303)
+++
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-08-25
21:11:15 UTC (rev 15304)
@@ -288,6 +288,29 @@
}
}
+ public static <A,T> AjaxEventOptions buildEventOptions(T t ,
CommonAttributesAccessor<A, T> accessor) {
+
+ AjaxEventOptions ajaxEventOptions = new AjaxEventOptions();
+ String ajaxStatusName = accessor.getStatusId(t);
+ if(ajaxStatusName != null && ajaxStatusName.trim().length() != 0) {
+ ajaxEventOptions.set(STATUS_ATTR_NAME, ajaxStatusName);
+ }
+
+ Map<String, Object> parameters = ajaxEventOptions.getParameters();
+ A context = accessor.getContext();
+
+ if(context instanceof ClientBehaviorContext) {
+ UIComponent parent = ((ClientBehaviorContext) context).getComponent();
+ FacesContext facesContext = ((ClientBehaviorContext) context).getFacesContext();
+ appendParameters(facesContext, parent, parameters);
+ } else if(context instanceof FacesContext){
+ FacesContext facesContext = (FacesContext)context;
+ appendParameters(facesContext, (UIComponent)t, parameters);
+ }
+
+ return ajaxEventOptions;
+ }
+
private static enum EventOptionsData {
begin {
@Override
@@ -322,7 +345,7 @@
if (ajaxStatusName != null && ajaxStatusName.length() != 0) {
ajaxEventOptions.set(STATUS_ATTR_NAME, ajaxStatusName);
}
-
+
Map<String, Object> parametersMap = new LinkedHashMap<String, Object>();
appendParameters(facesContext, component, parametersMap);
ajaxEventOptions.getParameters().putAll(parametersMap);
Show replies by date