Author: alexsmirnov
Date: 2009-11-16 21:04:34 -0500 (Mon, 16 Nov 2009)
New Revision: 15890
Modified:
branches/community/3.3.X/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
branches/community/3.3.X/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
Log:
https://jira.jboss.org/jira/browse/RF-8053 - hook method added.
Modified:
branches/community/3.3.X/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
===================================================================
---
branches/community/3.3.X/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2009-11-17
00:49:17 UTC (rev 15889)
+++
branches/community/3.3.X/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2009-11-17
02:04:34 UTC (rev 15890)
@@ -435,6 +435,17 @@
return function.toScript();
}
+
+ /**
+ *
https://jira.jboss.org/jira/browse/RF-8053 - public hook to change action URL in
portlet environment.
+ * @param context
+ * @return
+ */
+ public String getActionUrl(FacesContext context){
+ AjaxContext ajaxContext =
org.ajax4jsf.context.AjaxContext.getCurrentInstance(context);
+ String ajaxActionUrl = ajaxContext.getAjaxActionURL(context);
+ return ajaxActionUrl;
+ }
/**
* Return accepted types map
Modified:
branches/community/3.3.X/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
---
branches/community/3.3.X/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2009-11-17
00:49:17 UTC (rev 15889)
+++
branches/community/3.3.X/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2009-11-17
02:04:34 UTC (rev 15890)
@@ -48,12 +48,6 @@
variables.setVariable("addLabel",labels.get("add"));
variables.setVariable("uploadLabel",labels.get("upload"));
variables.setVariable("clearAllLabel",labels.get("clear_all"));
-
- org.ajax4jsf.context.AjaxContext ajaxContext =
org.ajax4jsf.context.AjaxContext.getCurrentInstance(context);
- String ajaxActionUrl = ajaxContext.getAjaxActionURL(context);
-
- variables.setVariable("actionUrl", ajaxActionUrl);
-
variables.setVariable("listWidth", getFileListWidth(component));
variables.setVariable("listHeight", getFileListHeight(component));
@@ -191,7 +185,7 @@
<c:scriptOption name="labels" value="#{labels}" />
</c:scriptObject>
<script type="text/javascript">
- new FileUpload('#{clientId}','#{actionUrl}',
#{this:getActionScript(context, component)}, '#{this:getProgressBarId(context,
component)}',
+ new FileUpload('#{clientId}','#{this:getActionUrl(context)}',
#{this:getActionScript(context, component)}, '#{this:getProgressBarId(context,
component)}',
'#{this:getSessionId(context, component)}'
<c:if test="#{not empty options}">
, <f:writeAsScript value="#{options}" />