summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2013-07-05 02:33:38 (EDT)
committerStephan Born2013-08-29 05:02:42 (EDT)
commitf81f27ccfe8bfea898b45d6d1338ee53ac49d503 (patch)
tree3f7e71f68fe72eee729916142f615db592eed7b3
parent2b8790234a990bc0265d7daa3df473446eab9ec6 (diff)
downloadorg.eclipse.stardust.ui.web-f81f27ccfe8bfea898b45d6d1338ee53ac49d503.zip
org.eclipse.stardust.ui.web-f81f27ccfe8bfea898b45d6d1338ee53ac49d503.tar.gz
org.eclipse.stardust.ui.web-f81f27ccfe8bfea898b45d6d1338ee53ac49d503.tar.bz2
Jira-ID: CRNT-28362
Made changes to UiUtils.js to use currentWindow for getting UI components. Included UiUtils.js at BridgeUtils.js Used parent to call UiUtils.js from wizard.xhtml git-svn-id: https://svn.csa.sungard.com/repos/ipp2/product/trunk/stardust/ui.web@65850 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b Signed-off-by: Sidharth Singh <sidharth.singh@sungard.com>
-rw-r--r--portal-common/src/main/resources/META-INF/tags/wizard.xhtml4
-rw-r--r--portal-common/src/main/resources/META-INF/xhtml/UiUtils.js85
-rw-r--r--portal-common/src/main/resources/META-INF/xhtml/js/BridgeUtils.js1
3 files changed, 55 insertions, 35 deletions
diff --git a/portal-common/src/main/resources/META-INF/tags/wizard.xhtml b/portal-common/src/main/resources/META-INF/tags/wizard.xhtml
index 2d1b10e..bf7bd9f 100644
--- a/portal-common/src/main/resources/META-INF/tags/wizard.xhtml
+++ b/portal-common/src/main/resources/META-INF/tags/wizard.xhtml
@@ -136,7 +136,9 @@
</ice:commandButton>
<script type="text/javascript" language="javascript">
- softClick('input', 'onLoadActionButton');
+ <!-- Current window is not available at UiUtils -->
+ parent.UiUtils.softClick(this.window,
+ 'input', 'onLoadActionButton');
</script>
</ice:panelGroup>
</f:facet>
diff --git a/portal-common/src/main/resources/META-INF/xhtml/UiUtils.js b/portal-common/src/main/resources/META-INF/xhtml/UiUtils.js
index 9c6f95b..1bfd4c6 100644
--- a/portal-common/src/main/resources/META-INF/xhtml/UiUtils.js
+++ b/portal-common/src/main/resources/META-INF/xhtml/UiUtils.js
@@ -1,39 +1,56 @@
/*******************************************************************************
- * Copyright (c) 2011 SunGard CSA LLC and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * SunGard CSA LLC - initial API and implementation and/or initial documentation
- *******************************************************************************/
-function softClick(type,linkName)
-{
- var linkChars = linkName.length;
- var allLinks = document.getElementsByTagName(type);
- for (var i = 0; i < allLinks.length; i++)
- {
- var check=String_endsWith(allLinks[i].id,linkName);
- if(check)
- {
- var form = formOf(allLinks[i]);
- var formId = form.id;
- return iceSubmitPartial(form,allLinks[i]);
- //iceSubmitPartial(form, allLinks[i],MouseEvent.CLICK);
- }
+ * Copyright (c) 2011 SunGard CSA LLC and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: SunGard CSA LLC - initial API and implementation and/or initial
+ * documentation
+ ******************************************************************************/
+var UiUtils = function() {
+ function softClick(contentWindow, type, linkName) {
+ try {
+ var linkChars = linkName.length;
+ var allLinks = contentWindow.document.getElementsByTagName(type);
+ for ( var i = 0; i < allLinks.length; i++) {
+ var check = String_endsWith(allLinks[i].id, linkName);
+ if (check) {
+ var form = allLinks[i].form;
+ var formId = form.id;
+ return contentWindow.iceSubmitPartial(form, allLinks[i]);
+ // iceSubmitPartial(form, allLinks[i],MouseEvent.CLICK);
+ }
+ }
+ } catch (e) {
+ alert(e);
+ }
}
-}
-function String_endsWith(str,subStr) {
- return str.length >= subStr.length && (str.substring(str.length - subStr.length) == subStr);
-}
+ function String_endsWith(str, subStr) {
+ try {
+ return str.length >= subStr.length
+ && (str.substring(str.length - subStr.length) == subStr);
+ } catch (e) {
+ alert(e);
+ }
+ }
-function softClickHtmlLink(id)
-{
- var aLink = document.getElementById(id);
- if(aLink)
- {
- aLink.click();
+ function softClickHtmlLink(id) {
+ var aLink = document.getElementById(id);
+ if (aLink) {
+ aLink.click();
+ }
}
-}
+
+ return {
+ softClick : function(contentWindow, type, linkName) {
+ softClick(contentWindow, type, linkName);
+ },
+ String_endsWith : function(str, subStr) {
+ return String_endsWith(str, subStr);
+ },
+ softClickHtmlLink : function(id) {
+ softClickHtmlLink(id);
+ }
+ };
+}();
diff --git a/portal-common/src/main/resources/META-INF/xhtml/js/BridgeUtils.js b/portal-common/src/main/resources/META-INF/xhtml/js/BridgeUtils.js
index b19afed..848fe5d 100644
--- a/portal-common/src/main/resources/META-INF/xhtml/js/BridgeUtils.js
+++ b/portal-common/src/main/resources/META-INF/xhtml/js/BridgeUtils.js
@@ -589,6 +589,7 @@ if (!window["BridgeUtils"].FrameManager) {
injectJavaScript(head, 'plugins/common/iPopupDialog.js');
injectJavaScript(head, 'plugins/common/js/Messaging.js');
injectJavaScript(head, 'plugins/common/js/ProcessPortal.js');
+ injectJavaScript(head, 'plugins/common/UiUtils.js');
}
/*