Author: sergeyhalipov
Date: 2007-07-04 10:40:56 -0400 (Wed, 04 Jul 2007)
New Revision: 1464
Modified:
branches/3.0.2/richfaces/modal-panel/src/main/config/component/modalPanel.xml
branches/3.0.2/richfaces/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java
branches/3.0.2/richfaces/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java
branches/3.0.2/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
branches/3.0.2/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
Log:
http://jira.jboss.com/jira/browse/RF-69
Modified: branches/3.0.2/richfaces/modal-panel/src/main/config/component/modalPanel.xml
===================================================================
---
branches/3.0.2/richfaces/modal-panel/src/main/config/component/modalPanel.xml 2007-07-04
13:13:57 UTC (rev 1463)
+++
branches/3.0.2/richfaces/modal-panel/src/main/config/component/modalPanel.xml 2007-07-04
14:40:56 UTC (rev 1464)
@@ -1,173 +1,187 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
"https://ajax4jsf.dev.java.net/nonav/dtds/component-config.dtd" >
-<components>
- <component>
- <name>org.richfaces.ModalPanel</name>
- <family>org.richfaces.ModalPanel</family>
- <classname>org.richfaces.component.html.HtmlModalPanel</classname>
- <superclass>org.richfaces.component.UIModalPanel</superclass>
- <test>
- <classname>org.richfaces.component.html.HtmlModalPanelComponentTest</classname>
- <superclassname>org.ajax4jsf.tests.AbstractAjax4JsfTestCase</superclassname>
- </test>
- <description>
- <![CDATA[
- ]]>
- </description>
- <renderer generate="true" override="true">
- <name>org.richfaces.ModalPanelRenderer</name>
- <template>org/richfaces/htmlModalPanel.jspx</template>
- </renderer>
- <tag>
- <name>modalPanel</name>
- <classname>org.richfaces.taglib.ModalPanelTag</classname>
- <superclass>
- org.ajax4jsf.framework.taglib.HtmlComponentTagBase
- </superclass>
- </tag>
- <!--
- <taghandler>
- <classname>org.ajax4jsf.tag.TestHandler</classname>
- </taghandler>
- -->
- &ui_component_attributes;
- <!--
- <property>
- <name>param</name>
- <classname>java.lang.String</classname>
- <description>
- </description>
- <defaultvalue>"default"</defaultvalue>
- </property>
- -->
-
- <property>
- <name>headerClass</name>
- <classname>java.lang.String</classname>
- <description>CSS style(s) is/are to be applied to component header when
this component is rendered
- </description>
- <defaultvalue>""</defaultvalue>
- </property>
-
- <property>
- <name>controlsClass</name>
- <classname>java.lang.String</classname>
- <description>CSS style(s) is/are to be applied to component controls
when this component is rendered
- </description>
- <defaultvalue>""</defaultvalue>
- </property>
-
- <property>
- <name>width</name>
- <classname>int</classname>
- <description>
- Attribute defines width of component
- </description>
- <defaultvalue>300</defaultvalue>
- </property>
- <property>
- <name>height</name>
- <classname>int</classname>
- <description>Attribute defines height of component
- </description>
- <defaultvalue>200</defaultvalue>
- </property>
-
- <property>
- <name>minWidth</name>
- <classname>int</classname>
- <description>
- Attribute defines min width of component
- </description>
- <defaultvalue>-1</defaultvalue>
- </property>
- <property>
- <name>minHeight</name>
- <classname>int</classname>
- <description>
- Attribute defines min height of component
- </description>
- <defaultvalue>-1</defaultvalue>
- </property>
-
- <property>
- <name>left</name>
- <classname>java.lang.String</classname>
- <description>
- Attribute defines X position of component left-top corner
- </description>
- <defaultvalue>"auto"</defaultvalue>
- </property>
- <property>
- <name>top</name>
- <classname>java.lang.String</classname>
- <description>
- Attribute defines Y position of component left-top corner
- </description>
- <defaultvalue>"auto"</defaultvalue>
- </property>
-
- <property>
- <name>resizeable</name>
- <classname>boolean</classname>
- <description>
- if "true" there is possibility to change component size
- </description>
- <defaultvalue>true</defaultvalue>
- </property>
- <property>
- <name>moveable</name>
- <classname>boolean</classname>
- <description>
- if "true" there is possibility to move component
- </description>
- <defaultvalue>true</defaultvalue>
- </property>
-
- <property>
- <name>zindex</name>
- <classname>int</classname>
- <description>
- Attribute is similar to the standard HTML attribute and can specify window placement
relative to the content
- </description>
- <defaultvalue>100</defaultvalue>
- </property>
-
- <property>
- <name>shadowOpacity</name>
- <classname>java.lang.String</classname>
- <description>
- HTML CSS class attribute of element for pop-up
- suggestion content
- </description>
- </property>
-
- <property>
- <name>shadowDepth</name>
- <classname>java.lang.String</classname>
- <description>
- Pop-up shadow depth for suggestion content
- </description>
- </property>
-
- <property>
- <name>onshow</name>
- <classname>java.lang.String</classname>
- <description>
- Event must occurs after panel opened
- </description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
-
- <property>
- <name>onhide</name>
- <classname>java.lang.String</classname>
- <description>
- Event must occurs after panel closed
- </description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
-
-
- </component>
-</components>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
"https://ajax4jsf.dev.java.net/nonav/dtds/component-config.dtd" >
+<components>
+ <component>
+ <name>org.richfaces.ModalPanel</name>
+ <family>org.richfaces.ModalPanel</family>
+ <classname>org.richfaces.component.html.HtmlModalPanel</classname>
+ <superclass>org.richfaces.component.UIModalPanel</superclass>
+ <test>
+ <classname>org.richfaces.component.html.HtmlModalPanelComponentTest</classname>
+ <superclassname>org.ajax4jsf.tests.AbstractAjax4JsfTestCase</superclassname>
+ </test>
+ <description>
+ <![CDATA[
+ ]]>
+ </description>
+ <renderer generate="true" override="true">
+ <name>org.richfaces.ModalPanelRenderer</name>
+ <template>org/richfaces/htmlModalPanel.jspx</template>
+ </renderer>
+ <tag>
+ <name>modalPanel</name>
+ <classname>org.richfaces.taglib.ModalPanelTag</classname>
+ <superclass>
+ org.ajax4jsf.framework.taglib.HtmlComponentTagBase
+ </superclass>
+ </tag>
+ <!--
+ <taghandler>
+ <classname>org.ajax4jsf.tag.TestHandler</classname>
+ </taghandler>
+ -->
+ &ui_component_attributes;
+ <!--
+ <property>
+ <name>param</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>"default"</defaultvalue>
+ </property>
+ -->
+
+ <property>
+ <name>headerClass</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style(s) is/are to be applied to component header when
this component is rendered
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+
+ <property>
+ <name>controlsClass</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style(s) is/are to be applied to component controls
when this component is rendered
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+
+ <property>
+ <name>width</name>
+ <classname>int</classname>
+ <description>
+ Attribute defines width of component
+ </description>
+ <defaultvalue>300</defaultvalue>
+ </property>
+ <property>
+ <name>height</name>
+ <classname>int</classname>
+ <description>Attribute defines height of component
+ </description>
+ <defaultvalue>200</defaultvalue>
+ </property>
+
+ <property>
+ <name>minWidth</name>
+ <classname>int</classname>
+ <description>
+ Attribute defines min width of component
+ </description>
+ <defaultvalue>-1</defaultvalue>
+ </property>
+ <property>
+ <name>minHeight</name>
+ <classname>int</classname>
+ <description>
+ Attribute defines min height of component
+ </description>
+ <defaultvalue>-1</defaultvalue>
+ </property>
+
+ <property>
+ <name>left</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Attribute defines X position of component left-top corner
+ </description>
+ <defaultvalue>"auto"</defaultvalue>
+ </property>
+ <property>
+ <name>top</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Attribute defines Y position of component left-top corner
+ </description>
+ <defaultvalue>"auto"</defaultvalue>
+ </property>
+
+ <property>
+ <name>resizeable</name>
+ <classname>boolean</classname>
+ <description>
+ if "true" there is possibility to change component size
+ </description>
+ <defaultvalue>true</defaultvalue>
+ </property>
+ <property>
+ <name>moveable</name>
+ <classname>boolean</classname>
+ <description>
+ if "true" there is possibility to move component
+ </description>
+ <defaultvalue>true</defaultvalue>
+ </property>
+
+ <property>
+ <name>zindex</name>
+ <classname>int</classname>
+ <description>
+ Attribute is similar to the standard HTML attribute and can specify window placement
relative to the content
+ </description>
+ <defaultvalue>100</defaultvalue>
+ </property>
+
+ <property>
+ <name>shadowOpacity</name>
+ <classname>java.lang.String</classname>
+ <description>
+ HTML CSS class attribute of element for pop-up
+ suggestion content
+ </description>
+ </property>
+
+ <property>
+ <name>shadowDepth</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Pop-up shadow depth for suggestion content
+ </description>
+ </property>
+
+ <property>
+ <name>onshow</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Event must occurs after panel opened
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+
+ <property>
+ <name>onhide</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Event must occurs after panel closed
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>showWhenRendered</name>
+ <classname>boolean</classname>
+ <description>
+ iA "true" value for this attribute makes a modal panel opened as default.
+ </description>
+ <defaultvalue>false</defaultvalue>
+ </property>
+ <property>
+ <name>keepState</name>
+ <classname>boolean</classname>
+ <description>
+ </description>
+ <defaultvalue>false</defaultvalue>
+ </property>
+
+ </component>
+</components>
Modified:
branches/3.0.2/richfaces/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java
===================================================================
---
branches/3.0.2/richfaces/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java 2007-07-04
13:13:57 UTC (rev 1463)
+++
branches/3.0.2/richfaces/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java 2007-07-04
14:40:56 UTC (rev 1464)
@@ -1,108 +1,114 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.component;
-
-import javax.faces.component.UIComponentBase;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.framework.skin.Skin;
-import org.ajax4jsf.framework.skin.SkinFactory;
-
-/**
- * JSF component class
- *
- */
-public abstract class UIModalPanel extends UIComponentBase {
-
- public static final String COMPONENT_TYPE = "org.richfaces.ModalPanel";
-
- private static final String COMPONENT_FAMILY = "org.richfaces.ModalPanel";
-
- /**
- * Shadow depth.
- */
- private static final int SHADOW_DEPTH = 4;
-
- public abstract int getWidth();
- public abstract int getHeight();
-
- public abstract void setWidth(int width);
- public abstract void setHeight(int height);
-
- public abstract int getMinWidth();
- public abstract int getMinHeight();
-
- public abstract void setMinWidth(int width);
- public abstract void setMinHeight(int height);
-
- public abstract boolean isResizeable();
- public abstract boolean isMoveable();
-
- public abstract void setResizeable(boolean resizeable);
- public abstract void setMoveable(boolean moveable);
-
- public abstract String getLeft();
- public abstract String getTop();
-
- public abstract void setLeft(String left);
- public abstract void setTop(String top);
-
- public abstract int getZindex();
- public abstract void setZindex(int zindex);
-
- public boolean getRendersChildren() {
- return true;
- }
-
- public String getShadowStyle() {
- String shadow = (String) getAttributes().get("shadowDepth");
- if (shadow == null) {
- shadow = Integer.toString(SHADOW_DEPTH);
- }
-
- String shadowStyle = "top: " + shadow + "; left: " + shadow
+ ";";
-
- FacesContext context = FacesContext.getCurrentInstance();
- if (null == context)
- return shadowStyle;
-
- String opacity = (String) getAttributes().get("shadowOpacity");
- String filterOpacity;
-
- if (null == opacity) {
- Skin skin = SkinFactory.getInstance().getSkin(context);
- opacity = (String) skin.getParameter(context, "shadowOpacity");
- }
- try {
- Double op = Double.valueOf(opacity);
- filterOpacity = Integer.toString(op.intValue() * 10);
- opacity = Double.toString(op.doubleValue() / 10);
- } catch (Exception e) {
- // illegal opacity
- return ";";
- }
- shadowStyle += " opacity:" + opacity
- + "; filter:alpha(opacity=" + filterOpacity + ");";
-
- return shadowStyle;
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.framework.skin.Skin;
+import org.ajax4jsf.framework.skin.SkinFactory;
+
+/**
+ * JSF component class
+ *
+ */
+public abstract class UIModalPanel extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.ModalPanel";
+
+ private static final String COMPONENT_FAMILY = "org.richfaces.ModalPanel";
+
+ /**
+ * Shadow depth.
+ */
+ private static final int SHADOW_DEPTH = 4;
+
+ public abstract int getWidth();
+ public abstract int getHeight();
+
+ public abstract void setWidth(int width);
+ public abstract void setHeight(int height);
+
+ public abstract int getMinWidth();
+ public abstract int getMinHeight();
+
+ public abstract void setMinWidth(int width);
+ public abstract void setMinHeight(int height);
+
+ public abstract boolean isResizeable();
+ public abstract boolean isMoveable();
+
+ public abstract void setResizeable(boolean resizeable);
+ public abstract void setMoveable(boolean moveable);
+
+ public abstract String getLeft();
+ public abstract String getTop();
+
+ public abstract void setLeft(String left);
+ public abstract void setTop(String top);
+
+ public abstract int getZindex();
+ public abstract void setZindex(int zindex);
+
+ public abstract boolean isShowWhenRendered();
+ public abstract void setShowWhenRendered(boolean opened);
+
+ public abstract boolean isKeepState();
+ public abstract void setKeepState(boolean keepState);
+
+ public boolean getRendersChildren() {
+ return true;
+ }
+
+ public String getShadowStyle() {
+ String shadow = (String) getAttributes().get("shadowDepth");
+ if (shadow == null) {
+ shadow = Integer.toString(SHADOW_DEPTH);
+ }
+
+ String shadowStyle = "top: " + shadow + "; left: " + shadow
+ ";";
+
+ FacesContext context = FacesContext.getCurrentInstance();
+ if (null == context)
+ return shadowStyle;
+
+ String opacity = (String) getAttributes().get("shadowOpacity");
+ String filterOpacity;
+
+ if (null == opacity) {
+ Skin skin = SkinFactory.getInstance().getSkin(context);
+ opacity = (String) skin.getParameter(context, "shadowOpacity");
+ }
+ try {
+ Double op = Double.valueOf(opacity);
+ filterOpacity = Integer.toString(op.intValue() * 10);
+ opacity = Double.toString(op.doubleValue() / 10);
+ } catch (Exception e) {
+ // illegal opacity
+ return ";";
+ }
+ shadowStyle += " opacity:" + opacity
+ + "; filter:alpha(opacity=" + filterOpacity + ");";
+
+ return shadowStyle;
+ }
+}
Modified:
branches/3.0.2/richfaces/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java
===================================================================
---
branches/3.0.2/richfaces/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java 2007-07-04
13:13:57 UTC (rev 1463)
+++
branches/3.0.2/richfaces/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java 2007-07-04
14:40:56 UTC (rev 1464)
@@ -22,7 +22,11 @@
package org.richfaces.renderkit;
import java.io.IOException;
+import java.util.Map;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIPanel;
+import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.servlet.ServletContext;
@@ -97,6 +101,33 @@
return true;
}
+ public String getShowScript(FacesContext context, UIModalPanel panel) {
+ StringBuffer result = new StringBuffer();
+
+ ExternalContext exCtx = context.getExternalContext();
+ Map rqMap = exCtx.getRequestParameterMap();
+ Object clnId = rqMap.get(panel.getClientId(context) + "OpenedState");
+
+ if (panel.isKeepState()) {
+ if (null != clnId) {
+ boolean opened = new Boolean((String) clnId).booleanValue();
+ panel.setShowWhenRendered(opened);
+ if (opened) {
+ result.append("Richfaces.showModalPanel('" +
panel.getClientId(context) + "');");
+ }
+ } else {
+ if (panel.isShowWhenRendered()) {
+ result.append("Richfaces.showModalPanel('" +
panel.getClientId(context) + "');");
+ }
+ }
+ } else {
+ if (null == clnId && panel.isShowWhenRendered()) {
+ result.append("Richfaces.showModalPanel('" + panel.getClientId(context)
+ "');");
+ }
+ }
+ return result.toString();
+ }
+
// public static String getOptions(FacesContext context, UIComponent component,
RendererUtils utils) {
// Map options = new HashMap();
//
Modified:
branches/3.0.2/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
---
branches/3.0.2/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-07-04
13:13:57 UTC (rev 1463)
+++
branches/3.0.2/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-07-04
14:40:56 UTC (rev 1464)
@@ -1,718 +1,742 @@
-if (!window.DW) {
- window.DW = {};
-}
-
-if (!window.Richfaces) {
- window.Richfaces = {};
-}
-
-sizeA = 4;
-sizeB = 40;
-
-ModalPanel = Class.create();
-
-{
- var searchString = "MSIE";
- var agent = navigator.userAgent;
- var idx = agent.indexOf(searchString);
- if (idx != -1) {
- var versIdx = agent.indexOf(";", idx);
- var versString;
-
- if (versIdx != -1) {
- versString = agent.substring(idx + searchString.length, versIdx);
- } else {
- versString = agent.substring(idx + searchString.length);
- }
-
- if (parseFloat(versString) < 7) {
- ModalPanel.disableSelects = true;
- }
- }
-}
-
-ModalPanel.panels = new Array();
-
-A4J.AJAX.AddListener({
- onafterajax: function(req, event, data) {
- var i = 0;
- while (i < ModalPanel.panels.length) {
- var panel = ModalPanel.panels[i];
-
- var elt = panel.markerId;
-
- if (!Richfaces.isNodeInDOMTree(elt)) {
- panel.destroy();
-
- ModalPanel.panels.splice(i, 1);
- //check all panels again. maybe we've removed parent of any panel just now
- i = 0;
- } else {
- i++;
- }
- }
- }
-});
-
-ModalPanel.Context = Class.create();
-ModalPanel.Context.prototype = {
- initialize: function(modalPanel) {
- this.cdiv = modalPanel.contentDiv;
- this.isPositionFixed = Richfaces.getComputedStyle(this.cdiv, "position") ==
"fixed";
- },
-
- left: function(offset) {
- return offset;
- },
-
- top: function(offset) {
- return offset;
- },
-
- width: function() {
- return this.cdiv.offsetWidth;
- },
-
- height: function() {
- return this.cdiv.offsetHeight;
- }
-}
-
- function getSizeElement() {
- var element;
- if (document.compatMode=='CSS1Compat') {
- element = document.documentElement;
- } else {
- element = document.body;
- }
-
- return element;
- }
-
-
-ModalPanel.prototype = {
- initialize: function(id, options) {
- this.markerId = $(id);
-
- this.id = $(id + "Container");
-
- this.options = options;
-
- this.baseZIndex = this.options.zindex ? this.options.zindex : 100;
-
- this.minWidth = Math.max(this.options.minWidth, 2*sizeA + 2);
- this.minHeight = Math.max(this.options.minHeight, 2*sizeA + 2);
-
- this.div = $(id + "Div");
- this.cursorDiv = $(id + "CursorDiv");
- this.cdiv = $(id + "CDiv");
- this.contentDiv = $(id + "ContentDiv");
- this.shadowDiv = $(id + "ShadowDiv");
-
- this.context = new ModalPanel.Context(this);
-
- this.borders = new Array();
-
- if (this.options.resizeable) {
- this.borders.push(new ModalPanel.Border(id + "ResizerNWU", this,
"NW-resize", ModalPanel.Sizer.NWU));
- this.borders.push(new ModalPanel.Border(id + "ResizerN", this,
"N-resize", ModalPanel.Sizer.N));
- this.borders.push(new ModalPanel.Border(id + "ResizerNEU", this,
"NE-resize", ModalPanel.Sizer.NEU));
- this.borders.push(new ModalPanel.Border(id + "ResizerNEL", this,
"NE-resize", ModalPanel.Sizer.NEL));
- this.borders.push(new ModalPanel.Border(id + "ResizerE", this,
"E-resize", ModalPanel.Sizer.E));
- this.borders.push(new ModalPanel.Border(id + "ResizerSEU", this,
"SE-resize", ModalPanel.Sizer.SEU));
- this.borders.push(new ModalPanel.Border(id + "ResizerSEL", this,
"SE-resize", ModalPanel.Sizer.SEL));
- this.borders.push(new ModalPanel.Border(id + "ResizerS", this,
"S-resize", ModalPanel.Sizer.S));
- this.borders.push(new ModalPanel.Border(id + "ResizerSWL", this,
"SW-resize", ModalPanel.Sizer.SWL));
- this.borders.push(new ModalPanel.Border(id + "ResizerSWU", this,
"SW-resize", ModalPanel.Sizer.SWU));
- this.borders.push(new ModalPanel.Border(id + "ResizerW", this,
"W-resize", ModalPanel.Sizer.W));
- this.borders.push(new ModalPanel.Border(id + "ResizerNWL", this,
"NW-resize", ModalPanel.Sizer.NWL));
- }
-
- if (this.options.moveable && $(id + "Header")) {
- this.header = new ModalPanel.Border(id + "Header", this, "move",
ModalPanel.Header);
- }
-
- this.id.modalPanel = this;
-
- if (this.div.style.setExpression)
- if (ModalPanel.disableSelects /* IE 6 */ || Richfaces.getComputedStyle(this.div,
"position") != "fixed" /* IE again, not in strict mode*/)
-
- {
- this.div.style.position = "absolute";
- this.cursorDiv.style.position = "absolute";
-
- //that is to apply filter
- this.div.style.width = "1px";
- this.div.style.height = "1px";
- this.cursorDiv.style.width = "1px";
- this.cursorDiv.style.height = "1px";
-
- this.cdiv.style.position = "absolute";
-
- this.cdiv.mpUseExpr = true;
- }
-
- if (this.options.onshow && this.options.onshow != ""){
- this.eventOnShow = new
Function("event",this.options.onshow).bindAsEventListener(this);
- }
- if (this.options.onhide && this.options.onhide != ""){
- this.eventOnHide = new
Function("event",this.options.onhide).bindAsEventListener(this);
- }
-
-
- ModalPanel.panels.push(this);
-
- this.eventFirstOnfocus = this.firstOnfocus.bindAsEventListener(this);
- this.eventLastOnfocus = this.lastOnfocus.bindAsEventListener(this);
-
- this.firstHref = $(this.markerId.id + "FirstHref");
- this.lastHref = $(this.markerId.id + "LastHref");
- },
-
- destroy: function() {
-
- this.traverseSelects(true);
-
- if (this.floatedToBody) {
- var parent = this.id.parentNode;
- if (parent) {
- parent.removeChild(this.id);
- }
- }
- },
-
- initIframe : function() {
- if (this.contentWindow) {
- Element.setStyle(this.contentWindow.document.body, { "margin" : "0px
0px 0px 0px" });
- } else {
- //TODO opera etc.
-
- }
-
- if("transparent" == Element.getStyle(document.body,
"background-color")) {
- this.allowTransparency = true;
- }
-
- //this.style.opacity = "0.5";
- //this.style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=50)';
- //var iframeBodyStyle = this.contentWindow.document.body.style;
- //iframeBodyStyle.backgroundColor = "#d0d0d0";
- //iframeBodyStyle.filter = "alpha(opacity=50)";
- //iframeBodyStyle.opacity = "0.5";
- //iframeBodyStyle.zIndex = "99";
- },
-
- traverseSelects: function(enable) {
- if (!ModalPanel.disableSelects) {
- return ;
- }
-
- var children = document.body.childNodes;
- for (var k = 0; k < children.length; k++) {
- var child = children[k];
- if (child != this.id && child.getElementsByTagName) {
-
- var selects = child.getElementsByTagName("SELECT");
-
- for (var i = 0; i < selects.length; i++) {
- var elt = selects[i];
-
- if (enable) {
- if (elt._mdwCount) {
- elt._mdwCount -= 1;
-
- if (elt._mdwCount == 0) {
- if (elt._mdwDisabled) {
- elt._mdwDisabled = undefined;
- } else {
- elt.disabled = false;
- }
-
- elt._mdwCount = undefined;
- }
- }
- } else {
- if (elt._mdwCount) {
- elt._mdwCount += 1;
- } else {
- if (elt.disabled) {
- elt._mdwDisabled = true;
- } else {
- elt.disabled = true;
- }
-
- elt._mdwCount = 1;
- }
- }
- }
- }
- }
- },
-
- setLeft: function(pos) {
- if (this.cdiv.mpUseExpr) {
- this.cdiv.mpLeft = pos;
- } else {
- this.cdiv.style.left = pos + "px";
- }
- },
-
- setTop: function(pos) {
- if (this.cdiv.mpUseExpr) {
- this.cdiv.mpTop = pos;
- } else {
- this.cdiv.style.top = pos + "px";
- }
- },
-
- firstOnfocus: function(event) {
- if (this.firstHref) {
- this.firstHref.focus();
- }
- },
-
- lastOnfocus: function(event) {
- if (this.lastHref) {
- this.lastHref.focus();
- }
- },
-
- processAllFocusElements: function(root) {
- if (root.focus &&
- // Many not visible elements have focus method, we is had to avoid processing them.
- /^a|input|select|button|textarea$/i.test(root.tagName) &&
- !root.disabled && !/^hidden$/.test(root.type) &&
- !/^none$/.test(root.style.display)) {
- this.execute(root);
- } else {
- if (root == this.cdiv)
- this.inModalPanel = true;
- var child = root.firstChild;
- while (child) {
- this.processAllFocusElements(child);
- child = child.nextSibling;
- }
- if (root == this.cdiv)
- this.inModalPanel = false;
- }
- },
-
- processTabindexes: function(input) {
- if (!this.inModalPanel) {
- if (!this.firstOutside)
- this.firstOutside = input;
- this.lastOutside = input;
- if (input.tabIndex) {
- input.prevTabIndex = input.tabIndex;
- }
- input.tabIndex = undefined;
- if (input.accesskey) {
- input.prevAccesskey = input.accesskey;
- }
- input.accesskey = undefined;
- }
- },
-
- restoreTabindexes: function(input) {
- if (!this.inModalPanel) {
- if (input.prevTabIndex)
- input.tabIndex = input.prevTabIndex;
- if (input.prevAccesskey)
- input.accesskey = input.prevAccesskey;
- }
- },
-
- preventFocus: function() {
- this.execute = this.processTabindexes;
- this.processAllFocusElements(document);
-
- if (this.firstOutside) {
- Event.observe(this.firstOutside, "focus", this.eventFirstOnfocus);
- }
- if (this.lastOutside && this.lastOutside != this.firstOutside) {
- Event.observe(this.lastOutside, "focus", this.eventLastOnfocus);
- }
- },
-
- restoreFocus: function() {
- this.execute = this.restoreTabindexes;
- this.processAllFocusElements(document);
-
- if (this.firstOutside) {
- Event.stopObserving(this.firstOutside, "focus", this.eventFirstOnfocus);
- this.firstOutside = null;
- }
- if (this.lastOutside) {
- Event.stopObserving(this.lastOutside, "focus", this.eventLastOnfocus);
- this.lastOutside = null;
- }
- },
-
- show: function(opts) {
- this.preventFocus();
-
- if (!this.floatedToBody) {
- this.parent = this.id.parentNode;
- document.body.appendChild(this.id.parentNode.removeChild(this.id));
- this.floatedToBody = true;
- }
-
- if (ModalPanel.disableSelects && !this.iframe) {
- new Insertion.Top(this.cdiv,
- "<iframe src=\"javascript:''\" frameborder=\"0\"
scrolling=\"no\" id=\"" + this.markerId.id + "IFrame\""
+
- "style=\"position: absolute; width: 1px; height: 1px; background-color:
white; overflow-y: hidden; z-index: 1;\">" +
- "</iframe>");
-
- this.iframe = $(this.markerId.id + "IFrame");
-
- //alert("IFrame:" + this.iframe + "created!");
-
- this.iframe.onload = this.initIframe.bind(this.iframe);
- }
-
- var options = {};
-
- if (!this.cdiv.mpSet) {
- Object.extend(options, this.options);
- }
-
- if (opts) {
- Object.extend(options, opts);
- }
-
- if (options.width) {
- if (this.minWidth > options.width) {
- options.width = this.minWidth;
- }
-
- if (this.iframe) {
- this.iframe.style.width = options.width + 'px';
- }
- this.contentDiv.style.width = options.width + 'px';
- this.shadowDiv.style.width = options.width + 'px';
- }
-
- if (options.height) {
- if (this.minHeight > options.height) {
- options.height = this.minHeight;
- }
-
- if (this.iframe) {
- this.iframe.style.height = options.height + 'px';
- }
- this.contentDiv.style.height = options.height + 'px';
- this.shadowDiv.style.height = options.height + 'px';
- }
-
- if (options.left) {
- var _left;
- if (options.left != "auto") {
- _left = parseInt(options.left, 10);
- } else {
- var cw = getSizeElement().clientWidth;
- if (RichFaces.navigatorType() == "OPERA")
- _left = (cw - this.contentDiv.style.width.replace("px", "")) /
2;
- else
- _left = (cw - Richfaces.getComputedStyleSize(this.contentDiv, "width")) /
2;
-
- }
-
- this.setLeft(_left);
- }
-
- if (options.top) {
- var _top;
- if (options.top != "auto") {
- _top = parseInt(options.top, 10);
- } else {
- var cw = getSizeElement().clientHeight;
- _top = (cw - Richfaces.getComputedStyleSize(this.contentDiv, "height")) /
2;
- }
-
- this.setTop(_top);
- }
-
- this.cdiv.mpSet = true;
-
- //Element.setStyle(this.dialogWindow.document.body, { "margin" : "0px
0px 0px 0px" });
- //if("transparent" == Element.getStyle(document.body,
"background-color")) {
- // this.iframe.allowTransparency = true;
- //}
-
-
- this.traverseSelects();
-
- //this.shape.init(this.cdiv, this.options);
-
- if (this.div.style.position == "absolute")
- {
- var we = "getSizeElement().clientWidth + \"px\"";
- var he = "getSizeElement().clientHeight + \"px\"";
- this.div.style.setExpression("width", we);
- this.div.style.setExpression("height", he);
-
- this.cursorDiv.style.setExpression("width", we);
- this.cursorDiv.style.setExpression("height", he);
-
- var le = "-Position.cumulativeOffset(this.parentNode)[0] +
getSizeElement().scrollLeft + \"px\"";
- var te = "-Position.cumulativeOffset(this.parentNode)[1] +
getSizeElement().scrollTop + \"px\"";
-
- this.div.style.setExpression("left", le);
- this.div.style.setExpression("top", te);
-
- this.cursorDiv.style.setExpression("left", le);
- this.cursorDiv.style.setExpression("top", te);
-
-
- var leftExpr = "(this.mpLeft || 0) +
-Position.cumulativeOffset(this.parentNode)[0] + getSizeElement().scrollLeft +
\"px\"";
- var topExpr = "(this.mpTop || 0) + -Position.cumulativeOffset(this.parentNode)[1]
+ getSizeElement().scrollTop + \"px\"";
-
- this.cdiv.style.setExpression("left", leftExpr);
- this.cdiv.style.setExpression("top", topExpr);
-
-
- /* That's how we output debug info - DOM inspector rulez */
- /*
- document.body.setExpression("_clientLeft",
"getSizeElement().clientLeft");
- document.body.setExpression("_clientTop",
"getSizeElement().clientTop");
- document.body.setExpression("_scrollLeft",
"getSizeElement().scrollLeft");
- document.body.setExpression("_scrollTop",
"getSizeElement().scrollTop");
- */
- /* */
- }
-
- this.id.style.visibility = "hidden";
-
- Element.show(this.id);
-
- this.doResizeOrMove(ModalPanel.Sizer.Diff.EMPTY);
-
- for (var k = 0; k < this.borders.length; k++ ) {
- this.borders[k].doPosition();
- }
-
- if (this.header) {
- this.header.doPosition();
- }
-
- this.id.style.visibility = "";
-
- var event = {};
- event.parameters = opts || {};
- if (this.eventOnShow) this.eventOnShow(event);
-
- this.lastOnfocus();
- },
-
- startDrag: function(border) {
- for (var k = 0; k < this.borders.length; k++ ) {
- //this.borders[k].hide();
- }
- },
-
- endDrag: function(border) {
- for (var k = 0; k < this.borders.length; k++ ) {
- //this.borders[k].show();
- this.borders[k].doPosition();
- }
- },
-
- hide: function(opts) {
- this.restoreFocus();
-
- this.traverseSelects(true);
-
- if (this.div.style.removeExpression) {
- this.div.style.removeExpression("width");
- this.div.style.removeExpression("height");
-
- this.div.style.removeExpression("left");
- this.div.style.removeExpression("top");
-
- this.cursorDiv.style.removeExpression("width");
- this.cursorDiv.style.removeExpression("height");
-
- this.cursorDiv.style.removeExpression("left");
- this.cursorDiv.style.removeExpression("top");
-
- this.cdiv.style.removeExpression("left");
- this.cdiv.style.removeExpression("top");
- }
-
- Element.hide(this.id);
-
- if (this.floatedToBody && this.parent) {
- document.body.removeChild(this.id);
- this.parent.appendChild(this.id);
- this.floatedToBody = false;
- }
-
- var event = {};
- event.parameters = opts || {};
- if (this.eventOnHide) this.eventOnHide(event);
- },
-
- doResizeOrMove: function(diff) {
- var vetoes = {};
- var cssHash = {};
- var cssHashWH = {};
-
- var vetoeChange = false;
- var newSize;
- // Avoid currentStyle bug in opera
- if (RichFaces.navigatorType() != "OPERA")
- newSize = Richfaces.getComputedStyleSize(this.contentDiv, "width");
- else
- newSize = parseInt(this.contentDiv.style.width.replace("px", ""),
10);
-
- var oldSize = newSize;
- newSize += diff.deltaWidth || 0;
-
- if (newSize >= this.minWidth) {
- if (diff.deltaWidth) {
- cssHashWH.width = newSize + 'px';
- }
- } else {
- if (diff.deltaWidth) {
- cssHashWH.width = this.minWidth + 'px';
-
- vetoes.vx = oldSize - this.minWidth;
- }
-
- vetoes.x = true;
- }
-
- if (vetoes.vx && diff.deltaX) {
- diff.deltaX = -vetoes.vx;
- }
-
- if (diff.deltaX && (vetoes.vx || !vetoes.x)) {
- if (vetoes.vx) {
- diff.deltaX = vetoes.vx;
- }
- var newPos;
- if (this.cdiv.mpUseExpr) {
- newPos = this.cdiv.mpLeft || 0;
- newPos += diff.deltaX;
-
- this.cdiv.mpLeft = newPos;
- } else {
- newPos = Richfaces.getComputedStyleSize(this.cdiv, "left");
- newPos += diff.deltaX;
- cssHash.left = newPos + 'px';
- }
- }
-
- var newSize = Richfaces.getComputedStyleSize(this.contentDiv, "height");
- var oldSize = newSize;
- newSize += diff.deltaHeight || 0;
-
- if (newSize >= this.minHeight) {
- if (diff.deltaHeight) {
- cssHashWH.height = newSize + 'px';
- }
- } else {
- if (diff.deltaHeight) {
- cssHashWH.height = this.minHeight + 'px';
-
- vetoes.vy = oldSize - this.minHeight;
- }
-
- vetoes.y = true;
- }
-
- if (vetoes.vy && diff.deltaY) {
- diff.deltaY = -vetoes.vy;
- }
-
- if (diff.deltaY && (vetoes.vy || !vetoes.y)) {
- if (vetoes.vy) {
- diff.deltaY = vetoes.vy;
- }
-
- var newPos;
- if (this.cdiv.mpUseExpr) {
- newPos = this.cdiv.mpTop || 0;
- newPos += diff.deltaY;
-
- this.cdiv.mpTop = newPos;
- } else {
- newPos = Richfaces.getComputedStyleSize(this.cdiv, "top");
- newPos += diff.deltaY;
- cssHash.top = newPos + 'px';
- }
- }
-
- Element.setStyle(this.cdiv, cssHash);
-
- Element.setStyle(this.contentDiv, cssHashWH);
- Element.setStyle(this.shadowDiv, cssHashWH);
- if (this.iframe) {
- Element.setStyle(this.iframe, cssHashWH);
- }
-
- var w = this.context.width();
- var h = this.context.height();
-
- this.context.reduced = null;
-
- if (w <= 2*sizeB) {
- this.context.reduced = {};
- this.context.reduced.w = w;
- }
-
- if (h <= 2*sizeB) {
- if (!this.context.reduced) {
- this.context.reduced = {};
- }
-
- this.context.reduced.h = h;
- }
-
- if (this.header) {
- this.header.doPosition();
- }
-
- return vetoes;
- }
-
-}
-
-Richfaces.findModalPanel = function (id) {
- if (id) {
- var prefId = (id.charAt(0) == ':' ? id : ':' + id);
-
- for (var i = 0; i < ModalPanel.panels.length; i++ ) {
- var pnl = ModalPanel.panels[i];
- if (pnl && pnl.markerId) {
- var pnlId = pnl.markerId.id;
-
- if (pnlId) {
- //try to match ids
- if (pnlId.length >= prefId.length) {
- var substr = pnlId.substring(pnlId.length - prefId.length, pnlId.length);
- if (substr == prefId) {
- return pnl.id;
- }
- }
- }
- }
- }
- }
-}
-
-Richfaces.showModalPanel = function (id, opts) {
- var panel = $(id + "Container");
- if (!panel) {
- panel = Richfaces.findModalPanel(id);
- }
- panel.modalPanel.show(opts);
-}
-
-Richfaces.hideModalPanel = function (id, opts) {
- var panel = $(id + "Container");
- if (!panel) {
- panel = Richfaces.findModalPanel(id);
- }
- panel.modalPanel.hide(opts);
-}
+if (!window.DW) {
+ window.DW = {};
+}
+
+if (!window.Richfaces) {
+ window.Richfaces = {};
+}
+
+sizeA = 4;
+sizeB = 40;
+
+ModalPanel = Class.create();
+
+{
+ var searchString = "MSIE";
+ var agent = navigator.userAgent;
+ var idx = agent.indexOf(searchString);
+ if (idx != -1) {
+ var versIdx = agent.indexOf(";", idx);
+ var versString;
+
+ if (versIdx != -1) {
+ versString = agent.substring(idx + searchString.length, versIdx);
+ } else {
+ versString = agent.substring(idx + searchString.length);
+ }
+
+ if (parseFloat(versString) < 7) {
+ ModalPanel.disableSelects = true;
+ }
+ }
+}
+
+ModalPanel.panels = new Array();
+
+A4J.AJAX.AddListener({
+ onafterajax: function(req, event, data) {
+ var i = 0;
+ while (i < ModalPanel.panels.length) {
+ var panel = ModalPanel.panels[i];
+
+ var elt = panel.markerId;
+
+ if (!Richfaces.isNodeInDOMTree(elt)) {
+ panel.destroy();
+
+ ModalPanel.panels.splice(i, 1);
+ //check all panels again. maybe we've removed parent of any panel just now
+ i = 0;
+ } else {
+ i++;
+ }
+ }
+ }
+});
+
+ModalPanel.Context = Class.create();
+ModalPanel.Context.prototype = {
+ initialize: function(modalPanel) {
+ this.cdiv = modalPanel.contentDiv;
+ this.isPositionFixed = Richfaces.getComputedStyle(this.cdiv, "position") ==
"fixed";
+ },
+
+ left: function(offset) {
+ return offset;
+ },
+
+ top: function(offset) {
+ return offset;
+ },
+
+ width: function() {
+ return this.cdiv.offsetWidth;
+ },
+
+ height: function() {
+ return this.cdiv.offsetHeight;
+ }
+}
+
+ function getSizeElement() {
+ var element;
+ if (document.compatMode=='CSS1Compat') {
+ element = document.documentElement;
+ } else {
+ element = document.body;
+ }
+
+ return element;
+ }
+
+
+ModalPanel.prototype = {
+ initialize: function(id, options) {
+ this.markerId = $(id);
+
+ this.id = $(id + "Container");
+
+ this.options = options;
+
+ this.baseZIndex = this.options.zindex ? this.options.zindex : 100;
+
+ this.minWidth = Math.max(this.options.minWidth, 2*sizeA + 2);
+ this.minHeight = Math.max(this.options.minHeight, 2*sizeA + 2);
+
+ this.div = $(id + "Div");
+ this.cursorDiv = $(id + "CursorDiv");
+ this.cdiv = $(id + "CDiv");
+ this.contentDiv = $(id + "ContentDiv");
+ this.shadowDiv = $(id + "ShadowDiv");
+
+ this.context = new ModalPanel.Context(this);
+
+ this.borders = new Array();
+
+ if (this.options.resizeable) {
+ this.borders.push(new ModalPanel.Border(id + "ResizerNWU", this,
"NW-resize", ModalPanel.Sizer.NWU));
+ this.borders.push(new ModalPanel.Border(id + "ResizerN", this,
"N-resize", ModalPanel.Sizer.N));
+ this.borders.push(new ModalPanel.Border(id + "ResizerNEU", this,
"NE-resize", ModalPanel.Sizer.NEU));
+ this.borders.push(new ModalPanel.Border(id + "ResizerNEL", this,
"NE-resize", ModalPanel.Sizer.NEL));
+ this.borders.push(new ModalPanel.Border(id + "ResizerE", this,
"E-resize", ModalPanel.Sizer.E));
+ this.borders.push(new ModalPanel.Border(id + "ResizerSEU", this,
"SE-resize", ModalPanel.Sizer.SEU));
+ this.borders.push(new ModalPanel.Border(id + "ResizerSEL", this,
"SE-resize", ModalPanel.Sizer.SEL));
+ this.borders.push(new ModalPanel.Border(id + "ResizerS", this,
"S-resize", ModalPanel.Sizer.S));
+ this.borders.push(new ModalPanel.Border(id + "ResizerSWL", this,
"SW-resize", ModalPanel.Sizer.SWL));
+ this.borders.push(new ModalPanel.Border(id + "ResizerSWU", this,
"SW-resize", ModalPanel.Sizer.SWU));
+ this.borders.push(new ModalPanel.Border(id + "ResizerW", this,
"W-resize", ModalPanel.Sizer.W));
+ this.borders.push(new ModalPanel.Border(id + "ResizerNWL", this,
"NW-resize", ModalPanel.Sizer.NWL));
+ }
+
+ if (this.options.moveable && $(id + "Header")) {
+ this.header = new ModalPanel.Border(id + "Header", this, "move",
ModalPanel.Header);
+ }
+
+ this.id.modalPanel = this;
+
+ if (this.div.style.setExpression)
+ if (ModalPanel.disableSelects /* IE 6 */ || Richfaces.getComputedStyle(this.div,
"position") != "fixed" /* IE again, not in strict mode*/)
+
+ {
+ this.div.style.position = "absolute";
+ this.cursorDiv.style.position = "absolute";
+
+ //that is to apply filter
+ this.div.style.width = "1px";
+ this.div.style.height = "1px";
+ this.cursorDiv.style.width = "1px";
+ this.cursorDiv.style.height = "1px";
+
+ this.cdiv.style.position = "absolute";
+
+ this.cdiv.mpUseExpr = true;
+ }
+
+ if (this.options.onshow && this.options.onshow != ""){
+ this.eventOnShow = new
Function("event",this.options.onshow).bindAsEventListener(this);
+ }
+ if (this.options.onhide && this.options.onhide != ""){
+ this.eventOnHide = new
Function("event",this.options.onhide).bindAsEventListener(this);
+ }
+
+
+ ModalPanel.panels.push(this);
+
+ this.eventFirstOnfocus = this.firstOnfocus.bindAsEventListener(this);
+ this.eventLastOnfocus = this.lastOnfocus.bindAsEventListener(this);
+
+ this.firstHref = $(this.markerId.id + "FirstHref");
+ this.lastHref = $(this.markerId.id + "LastHref");
+ },
+
+ destroy: function() {
+
+ this.traverseSelects(true);
+
+ if (this.floatedToBody) {
+ var parent = this.id.parentNode;
+ if (parent) {
+ parent.removeChild(this.id);
+ }
+ }
+ },
+
+ initIframe : function() {
+ if (this.contentWindow) {
+ Element.setStyle(this.contentWindow.document.body, { "margin" : "0px
0px 0px 0px" });
+ } else {
+ //TODO opera etc.
+
+ }
+
+ if("transparent" == Element.getStyle(document.body,
"background-color")) {
+ this.allowTransparency = true;
+ }
+
+ //this.style.opacity = "0.5";
+ //this.style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=50)';
+ //var iframeBodyStyle = this.contentWindow.document.body.style;
+ //iframeBodyStyle.backgroundColor = "#d0d0d0";
+ //iframeBodyStyle.filter = "alpha(opacity=50)";
+ //iframeBodyStyle.opacity = "0.5";
+ //iframeBodyStyle.zIndex = "99";
+ },
+
+ traverseSelects: function(enable) {
+ if (!ModalPanel.disableSelects) {
+ return ;
+ }
+
+ var children = document.body.childNodes;
+ for (var k = 0; k < children.length; k++) {
+ var child = children[k];
+ if (child != this.id && child.getElementsByTagName) {
+
+ var selects = child.getElementsByTagName("SELECT");
+
+ for (var i = 0; i < selects.length; i++) {
+ var elt = selects[i];
+
+ if (enable) {
+ if (elt._mdwCount) {
+ elt._mdwCount -= 1;
+
+ if (elt._mdwCount == 0) {
+ if (elt._mdwDisabled) {
+ elt._mdwDisabled = undefined;
+ } else {
+ elt.disabled = false;
+ }
+
+ elt._mdwCount = undefined;
+ }
+ }
+ } else {
+ if (elt._mdwCount) {
+ elt._mdwCount += 1;
+ } else {
+ if (elt.disabled) {
+ elt._mdwDisabled = true;
+ } else {
+ elt.disabled = true;
+ }
+
+ elt._mdwCount = 1;
+ }
+ }
+ }
+ }
+ }
+ },
+
+ setLeft: function(pos) {
+ if (this.cdiv.mpUseExpr) {
+ this.cdiv.mpLeft = pos;
+ } else {
+ this.cdiv.style.left = pos + "px";
+ }
+ },
+
+ setTop: function(pos) {
+ if (this.cdiv.mpUseExpr) {
+ this.cdiv.mpTop = pos;
+ } else {
+ this.cdiv.style.top = pos + "px";
+ }
+ },
+
+ firstOnfocus: function(event) {
+ if (this.firstHref) {
+ this.firstHref.focus();
+ }
+ },
+
+ lastOnfocus: function(event) {
+ if (this.lastHref) {
+ this.lastHref.focus();
+ }
+ },
+
+ processAllFocusElements: function(root) {
+ if (root.focus &&
+ // Many not visible elements have focus method, we is had to avoid processing them.
+ /^a|input|select|button|textarea$/i.test(root.tagName) &&
+ !root.disabled && !/^hidden$/.test(root.type) &&
+ !/^none$/.test(root.style.display)) {
+ this.execute(root);
+ } else {
+ if (root == this.cdiv)
+ this.inModalPanel = true;
+ var child = root.firstChild;
+ while (child) {
+ this.processAllFocusElements(child);
+ child = child.nextSibling;
+ }
+ if (root == this.cdiv)
+ this.inModalPanel = false;
+ }
+ },
+
+ processTabindexes: function(input) {
+ if (!this.inModalPanel) {
+ if (!this.firstOutside)
+ this.firstOutside = input;
+ this.lastOutside = input;
+ if (input.tabIndex) {
+ input.prevTabIndex = input.tabIndex;
+ }
+ input.tabIndex = undefined;
+ if (input.accesskey) {
+ input.prevAccesskey = input.accesskey;
+ }
+ input.accesskey = undefined;
+ }
+ },
+
+ restoreTabindexes: function(input) {
+ if (!this.inModalPanel) {
+ if (input.prevTabIndex)
+ input.tabIndex = input.prevTabIndex;
+ if (input.prevAccesskey)
+ input.accesskey = input.prevAccesskey;
+ }
+ },
+
+ preventFocus: function() {
+ this.execute = this.processTabindexes;
+ this.processAllFocusElements(document);
+
+ if (this.firstOutside) {
+ Event.observe(this.firstOutside, "focus", this.eventFirstOnfocus);
+ }
+ if (this.lastOutside && this.lastOutside != this.firstOutside) {
+ Event.observe(this.lastOutside, "focus", this.eventLastOnfocus);
+ }
+ },
+
+ restoreFocus: function() {
+ this.execute = this.restoreTabindexes;
+ this.processAllFocusElements(document);
+
+ if (this.firstOutside) {
+ Event.stopObserving(this.firstOutside, "focus", this.eventFirstOnfocus);
+ this.firstOutside = null;
+ }
+ if (this.lastOutside) {
+ Event.stopObserving(this.lastOutside, "focus", this.eventLastOnfocus);
+ this.lastOutside = null;
+ }
+ },
+
+ show: function(opts) {
+ this.preventFocus();
+
+ if (!this.floatedToBody) {
+ this.parent = this.id.parentNode;
+ document.body.insertBefore(this.parent.removeChild(this.id), null);
+ this.floatedToBody = true;
+ }
+
+ var forms = this.cdiv.getElementsByTagName("form");
+ if (forms) {
+ this.formOnload = this.setStateInput.bindAsEventListener(this);
+ for (var i = 0; i < forms.length; i++) {
+ Event.observe(forms[i], "submit", this.formOnload);
+ }
+ }
+
+ if (ModalPanel.disableSelects && !this.iframe) {
+ new Insertion.Top(this.cdiv,
+ "<iframe src=\"javascript:''\" frameborder=\"0\"
scrolling=\"no\" id=\"" + this.markerId.id + "IFrame\""
+
+ "style=\"position: absolute; width: 1px; height: 1px; background-color:
white; overflow-y: hidden; z-index: 1;\">" +
+ "</iframe>");
+
+ this.iframe = $(this.markerId.id + "IFrame");
+
+ //alert("IFrame:" + this.iframe + "created!");
+
+ this.iframe.onload = this.initIframe.bind(this.iframe);
+ }
+
+ var options = {};
+
+ if (!this.cdiv.mpSet) {
+ Object.extend(options, this.options);
+ }
+
+ if (opts) {
+ Object.extend(options, opts);
+ }
+
+ if (options.width) {
+ if (this.minWidth > options.width) {
+ options.width = this.minWidth;
+ }
+
+ if (this.iframe) {
+ this.iframe.style.width = options.width + 'px';
+ }
+ this.contentDiv.style.width = options.width + 'px';
+ this.shadowDiv.style.width = options.width + 'px';
+ }
+
+ if (options.height) {
+ if (this.minHeight > options.height) {
+ options.height = this.minHeight;
+ }
+
+ if (this.iframe) {
+ this.iframe.style.height = options.height + 'px';
+ }
+ this.contentDiv.style.height = options.height + 'px';
+ this.shadowDiv.style.height = options.height + 'px';
+ }
+
+ if (options.left) {
+ var _left;
+ if (options.left != "auto") {
+ _left = parseInt(options.left, 10);
+ } else {
+ var cw = getSizeElement().clientWidth;
+ if (RichFaces.navigatorType() == "OPERA")
+ _left = (cw - this.contentDiv.style.width.replace("px", "")) /
2;
+ else
+ _left = (cw - Richfaces.getComputedStyleSize(this.contentDiv, "width")) /
2;
+
+ }
+
+ this.setLeft(_left);
+ }
+
+ if (options.top) {
+ var _top;
+ if (options.top != "auto") {
+ _top = parseInt(options.top, 10);
+ } else {
+ var cw = getSizeElement().clientHeight;
+ _top = (cw - Richfaces.getComputedStyleSize(this.contentDiv, "height")) /
2;
+ }
+
+ this.setTop(_top);
+ }
+
+ this.cdiv.mpSet = true;
+
+ //Element.setStyle(this.dialogWindow.document.body, { "margin" : "0px
0px 0px 0px" });
+ //if("transparent" == Element.getStyle(document.body,
"background-color")) {
+ // this.iframe.allowTransparency = true;
+ //}
+
+
+ this.traverseSelects();
+
+ //this.shape.init(this.cdiv, this.options);
+
+ if (this.div.style.position == "absolute")
+ {
+ var we = "getSizeElement().clientWidth + \"px\"";
+ var he = "getSizeElement().clientHeight + \"px\"";
+ this.div.style.setExpression("width", we);
+ this.div.style.setExpression("height", he);
+
+ this.cursorDiv.style.setExpression("width", we);
+ this.cursorDiv.style.setExpression("height", he);
+
+ var le = "-Position.cumulativeOffset(this.parentNode)[0] +
getSizeElement().scrollLeft + \"px\"";
+ var te = "-Position.cumulativeOffset(this.parentNode)[1] +
getSizeElement().scrollTop + \"px\"";
+
+ this.div.style.setExpression("left", le);
+ this.div.style.setExpression("top", te);
+
+ this.cursorDiv.style.setExpression("left", le);
+ this.cursorDiv.style.setExpression("top", te);
+
+
+ var leftExpr = "(this.mpLeft || 0) +
-Position.cumulativeOffset(this.parentNode)[0] + getSizeElement().scrollLeft +
\"px\"";
+ var topExpr = "(this.mpTop || 0) + -Position.cumulativeOffset(this.parentNode)[1]
+ getSizeElement().scrollTop + \"px\"";
+
+ this.cdiv.style.setExpression("left", leftExpr);
+ this.cdiv.style.setExpression("top", topExpr);
+
+
+ /* That's how we output debug info - DOM inspector rulez */
+ /*
+ document.body.setExpression("_clientLeft",
"getSizeElement().clientLeft");
+ document.body.setExpression("_clientTop",
"getSizeElement().clientTop");
+ document.body.setExpression("_scrollLeft",
"getSizeElement().scrollLeft");
+ document.body.setExpression("_scrollTop",
"getSizeElement().scrollTop");
+ */
+ /* */
+ }
+
+ this.id.style.visibility = "hidden";
+
+ Element.show(this.id);
+
+ this.doResizeOrMove(ModalPanel.Sizer.Diff.EMPTY);
+
+ for (var k = 0; k < this.borders.length; k++ ) {
+ this.borders[k].doPosition();
+ }
+
+ if (this.header) {
+ this.header.doPosition();
+ }
+
+ this.id.style.visibility = "";
+
+ var event = {};
+ event.parameters = opts || {};
+ if (this.eventOnShow) this.eventOnShow(event);
+
+ this.lastOnfocus();
+
+ this.shown = true;
+ },
+
+ startDrag: function(border) {
+ for (var k = 0; k < this.borders.length; k++ ) {
+ //this.borders[k].hide();
+ }
+ },
+
+ endDrag: function(border) {
+ for (var k = 0; k < this.borders.length; k++ ) {
+ //this.borders[k].show();
+ this.borders[k].doPosition();
+ }
+ },
+
+ hide: function(opts) {
+ this.restoreFocus();
+
+ this.traverseSelects(true);
+
+ if (this.div.style.removeExpression) {
+ this.div.style.removeExpression("width");
+ this.div.style.removeExpression("height");
+
+ this.div.style.removeExpression("left");
+ this.div.style.removeExpression("top");
+
+ this.cursorDiv.style.removeExpression("width");
+ this.cursorDiv.style.removeExpression("height");
+
+ this.cursorDiv.style.removeExpression("left");
+ this.cursorDiv.style.removeExpression("top");
+
+ this.cdiv.style.removeExpression("left");
+ this.cdiv.style.removeExpression("top");
+ }
+
+ Element.hide(this.id);
+
+ if (this.floatedToBody && this.parent && this.parent.firstChild) {
+ document.body.removeChild(this.id);
+ this.parent.appendChild(this.id);
+ this.floatedToBody = false;
+ }
+
+ var event = {};
+ event.parameters = opts || {};
+ if (this.eventOnHide) this.eventOnHide(event);
+
+ this.shown = false;
+ },
+
+ doResizeOrMove: function(diff) {
+ var vetoes = {};
+ var cssHash = {};
+ var cssHashWH = {};
+
+ var vetoeChange = false;
+ var newSize;
+ // Avoid currentStyle bug in opera
+ if (RichFaces.navigatorType() != "OPERA")
+ newSize = Richfaces.getComputedStyleSize(this.contentDiv, "width");
+ else
+ newSize = parseInt(this.contentDiv.style.width.replace("px", ""),
10);
+
+ var oldSize = newSize;
+ newSize += diff.deltaWidth || 0;
+
+ if (newSize >= this.minWidth) {
+ if (diff.deltaWidth) {
+ cssHashWH.width = newSize + 'px';
+ }
+ } else {
+ if (diff.deltaWidth) {
+ cssHashWH.width = this.minWidth + 'px';
+
+ vetoes.vx = oldSize - this.minWidth;
+ }
+
+ vetoes.x = true;
+ }
+
+ if (vetoes.vx && diff.deltaX) {
+ diff.deltaX = -vetoes.vx;
+ }
+
+ if (diff.deltaX && (vetoes.vx || !vetoes.x)) {
+ if (vetoes.vx) {
+ diff.deltaX = vetoes.vx;
+ }
+ var newPos;
+ if (this.cdiv.mpUseExpr) {
+ newPos = this.cdiv.mpLeft || 0;
+ newPos += diff.deltaX;
+
+ this.cdiv.mpLeft = newPos;
+ } else {
+ newPos = Richfaces.getComputedStyleSize(this.cdiv, "left");
+ newPos += diff.deltaX;
+ cssHash.left = newPos + 'px';
+ }
+ }
+
+ var newSize = Richfaces.getComputedStyleSize(this.contentDiv, "height");
+ var oldSize = newSize;
+ newSize += diff.deltaHeight || 0;
+
+ if (newSize >= this.minHeight) {
+ if (diff.deltaHeight) {
+ cssHashWH.height = newSize + 'px';
+ }
+ } else {
+ if (diff.deltaHeight) {
+ cssHashWH.height = this.minHeight + 'px';
+
+ vetoes.vy = oldSize - this.minHeight;
+ }
+
+ vetoes.y = true;
+ }
+
+ if (vetoes.vy && diff.deltaY) {
+ diff.deltaY = -vetoes.vy;
+ }
+
+ if (diff.deltaY && (vetoes.vy || !vetoes.y)) {
+ if (vetoes.vy) {
+ diff.deltaY = vetoes.vy;
+ }
+
+ var newPos;
+ if (this.cdiv.mpUseExpr) {
+ newPos = this.cdiv.mpTop || 0;
+ newPos += diff.deltaY;
+
+ this.cdiv.mpTop = newPos;
+ } else {
+ newPos = Richfaces.getComputedStyleSize(this.cdiv, "top");
+ newPos += diff.deltaY;
+ cssHash.top = newPos + 'px';
+ }
+ }
+
+ Element.setStyle(this.cdiv, cssHash);
+
+ Element.setStyle(this.contentDiv, cssHashWH);
+ Element.setStyle(this.shadowDiv, cssHashWH);
+ if (this.iframe) {
+ Element.setStyle(this.iframe, cssHashWH);
+ }
+
+ var w = this.context.width();
+ var h = this.context.height();
+
+ this.context.reduced = null;
+
+ if (w <= 2*sizeB) {
+ this.context.reduced = {};
+ this.context.reduced.w = w;
+ }
+
+ if (h <= 2*sizeB) {
+ if (!this.context.reduced) {
+ this.context.reduced = {};
+ }
+
+ this.context.reduced.h = h;
+ }
+
+ if (this.header) {
+ this.header.doPosition();
+ }
+
+ return vetoes;
+ },
+
+ setStateInput: function(e) {
+ if (e && e.target) {
+ var input = document.createElement("input");
+ input.type = "hidden";
+ input.id = this.markerId.id + "OpenedState";
+ input.name = this.markerId.id + "OpenedState";
+ input.value = this.shown ? "true" : "false";
+
+ e.target.appendChild(input);
+ return true;
+ }
+ }
+}
+
+Richfaces.findModalPanel = function (id) {
+ if (id) {
+ var prefId = (id.charAt(0) == ':' ? id : ':' + id);
+
+ for (var i = 0; i < ModalPanel.panels.length; i++ ) {
+ var pnl = ModalPanel.panels[i];
+ if (pnl && pnl.markerId) {
+ var pnlId = pnl.markerId.id;
+
+ if (pnlId) {
+ //try to match ids
+ if (pnlId.length >= prefId.length) {
+ var substr = pnlId.substring(pnlId.length - prefId.length, pnlId.length);
+ if (substr == prefId) {
+ return pnl.id;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+Richfaces.showModalPanel = function (id, opts) {
+ var panel = $(id + "Container");
+ if (!panel) {
+ panel = Richfaces.findModalPanel(id);
+ }
+ panel.modalPanel.show(opts);
+}
+
+Richfaces.hideModalPanel = function (id, opts) {
+ var panel = $(id + "Container");
+ if (!panel) {
+ panel = Richfaces.findModalPanel(id);
+ }
+ panel.modalPanel.hide(opts);
+}
Modified:
branches/3.0.2/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
---
branches/3.0.2/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-07-04
13:13:57 UTC (rev 1463)
+++
branches/3.0.2/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-07-04
14:40:56 UTC (rev 1464)
@@ -1,139 +1,146 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<f:template
-
xmlns:f="http:/jsf.exadel.com/template"
- xmlns:c="
http://java.sun.com/jsf/core"
- xmlns:ui="
http://ajax4jsf.org/cdk/ui"
- xmlns:u="
http://ajax4jsf.org/cdk/u"
- xmlns:x="
http://ajax4jsf.org/cdk/x"
- xmlns:h="
http://ajax4jsf.org/cdk/headers"
- xmlns:vcp="
http://ajax4jsf.org/cdk/vcp"
- class="org.richfaces.renderkit.html.ModalPanelRenderer"
- baseclass="org.richfaces.renderkit.ModalPanelRendererBase"
- component="org.richfaces.component.UIModalPanel"
- >
-
- <h:styles>
- /org/richfaces/renderkit/html/css/modalPanel.xcss
- </h:styles>
- <h:scripts>
- new org.ajax4jsf.framework.resource.PrototypeScript(),
- /org/richfaces/renderkit/html/scripts/utils.js,
- /org/richfaces/renderkit/html/scripts/modalPanel.js,
- /org/richfaces/renderkit/html/scripts/modalPanelBorders.js,
- /org/richfaces/renderkit/html/scripts/browser_info.js
- </h:scripts>
-
- <f:clientid var="clientId"/>
-
- <div id="#{clientId}"
- style="display: none;"
- >
-
- <f:call name="checkOptions" />
- <f:call name="initializeResources" />
-
- <div id="#{clientId}Container"
- style="position: absolute; display: none; z-index: #{component.zindex};
background-color: inherit;"
- class="rich-modalpanel"
- x:passThruWithExclusions="id,style,class"
- >
- <div class="dr-mpnl-mask-div rich-mpnl-mask-div"
id="#{clientId}Div"
- style="z-index: 1;"></div>
- <div class="dr-mpnl-mask-div rich-mpnl-mask-div"
id="#{clientId}CursorDiv"
- style="filter: alpha(opacity=1); opacity: 0.01; z-index:
-200"></div>
-
- <div id="#{clientId}CDiv" class="dr-mpnl-panel rich-mpnl_panel"
style="width: 1px; height: 1px; z-index: 2;">
-
- <jsp:scriptlet>
- <![CDATA[
- if (component.isResizeable()) {
- for (int i = 0; i < RESIZERS.length; i++) {
- variables.setVariable("resizer", RESIZERS[i]);
-
- boolean isHor = i / 3 % 2 == 0;
- String style = isHor ? "width: 40px; height: 4px;" : "height:
40px; width: 4px;";
-
- //higher z-index for corner elements
- style += "z-index: " + (i % 3 == 1 ? 0 : 1) + 3 + ";";
- variables.setVariable("resizerStyle", style);
- ]]>
- </jsp:scriptlet>
- <div id="#{clientId}Resizer#{resizer}" class="dr-mpnl-resizer
rich-mpnl-resizer" style="#{resizerStyle}">
- </div>
- <jsp:scriptlet>
- <![CDATA[
- }
- }
- ]]>
- </jsp:scriptlet>
-
- <div id="#{clientId}ShadowDiv" class="dr-mpnl-shadow
rich-mpnl-shadow"
- style="#{component.shadowStyle}" >
- </div>
-
- <div style="position: absolute; overflow: hidden; z-index: 2;"
+<?xml version="1.0" encoding="UTF-8"?>
+<f:template
+
xmlns:f="http:/jsf.exadel.com/template"
+ xmlns:c="
http://java.sun.com/jsf/core"
+ xmlns:ui="
http://ajax4jsf.org/cdk/ui"
+ xmlns:u="
http://ajax4jsf.org/cdk/u"
+ xmlns:x="
http://ajax4jsf.org/cdk/x"
+ xmlns:h="
http://ajax4jsf.org/cdk/headers"
+ xmlns:vcp="
http://ajax4jsf.org/cdk/vcp"
+ class="org.richfaces.renderkit.html.ModalPanelRenderer"
+ baseclass="org.richfaces.renderkit.ModalPanelRendererBase"
+ component="org.richfaces.component.UIModalPanel"
+ >
+
+ <h:styles>
+ /org/richfaces/renderkit/html/css/modalPanel.xcss
+ </h:styles>
+ <h:scripts>
+ new org.ajax4jsf.framework.resource.PrototypeScript(),
+ /org/richfaces/renderkit/html/scripts/utils.js,
+ /org/richfaces/renderkit/html/scripts/modalPanel.js,
+ /org/richfaces/renderkit/html/scripts/modalPanelBorders.js,
+ /org/richfaces/renderkit/html/scripts/browser_info.js
+ </h:scripts>
+
+ <f:clientid var="clientId"/>
+
+ <div id="#{clientId}"
+ style="display: none;"
+ >
+
+ <f:call name="checkOptions" />
+ <f:call name="initializeResources" />
+
+ <input type="hidden" id="#{clientId}OpenedState"
name="#{clientId}OpenedState" />
+
+ <div id="#{clientId}Container"
+ style="position: absolute; display: none; z-index: #{component.zindex};
background-color: inherit;"
+ class="rich-modalpanel"
+ x:passThruWithExclusions="id,style,class"
+ >
+ <div class="dr-mpnl-mask-div rich-mpnl-mask-div"
id="#{clientId}Div"
+ style="z-index: 1;"></div>
+ <div class="dr-mpnl-mask-div rich-mpnl-mask-div"
id="#{clientId}CursorDiv"
+ style="filter: alpha(opacity=1); opacity: 0.01; z-index:
-200"></div>
+
+ <div id="#{clientId}CDiv" class="dr-mpnl-panel rich-mpnl_panel"
style="width: 1px; height: 1px; z-index: 2;">
+
+ <jsp:scriptlet>
+ <![CDATA[
+ if (component.isResizeable()) {
+ for (int i = 0; i < RESIZERS.length; i++) {
+ variables.setVariable("resizer", RESIZERS[i]);
+
+ boolean isHor = i / 3 % 2 == 0;
+ String style = isHor ? "width: 40px; height: 4px;" : "height:
40px; width: 4px;";
+
+ //higher z-index for corner elements
+ style += "z-index: " + (i % 3 == 1 ? 0 : 1) + 3 + ";";
+ variables.setVariable("resizerStyle", style);
+ ]]>
+ </jsp:scriptlet>
+ <div id="#{clientId}Resizer#{resizer}" class="dr-mpnl-resizer
rich-mpnl-resizer" style="#{resizerStyle}">
+ </div>
+ <jsp:scriptlet>
+ <![CDATA[
+ }
+ }
+ ]]>
+ </jsp:scriptlet>
+
+ <div id="#{clientId}ShadowDiv" class="dr-mpnl-shadow
rich-mpnl-shadow"
+ style="#{component.shadowStyle}" >
+ </div>
+
+ <div style="position: absolute; overflow: hidden; z-index: 2;"
class="dr-mpnl-pnl" id="#{clientId}ContentDiv">
- <a href="#" style="position: absolute; left: -32000"
id="#{clientId}FirstHref" >_</a>
- <table style="height: 100%; width: 100%;" border="0"
cellpadding="0" cellspacing="0">
- <jsp:scriptlet>
- <![CDATA[if(component.getFacet("header")!=null &&
component.getFacet("header").isRendered()) {]]>
- </jsp:scriptlet>
- <tr style="height: 1%;">
- <td class="dr-mpnl-header rich-mpnl-header-cell"
style="position: relative; vertical-align: middle; z-index: 5;"
width="100%">
- <div id="#{clientId}Header" style="position: relative;
white-space: nowrap;" class="dr-mpnl-pnl-text dr-mpnl-pnl-h rich-mpnl-text
rich-mpnl-header #{component.attributes['headerClass']}">
- <u:insertFacet name="header" />
- </div>
-
- <jsp:scriptlet>
- <![CDATA[if(component.getFacet("controls")!=null &&
component.getFacet("controls").isRendered()) {]]>
- </jsp:scriptlet>
- <div style="position: absolute; top: 3px; right: 3px;"
class="dr-mpnl-pnl-text rich-mpnl-text rich-mpnl-controls
#{component.attributes['controlsClass']}">
- <u:insertFacet name="controls" />
- </div>
- <jsp:scriptlet>
- <![CDATA[}]]>
- </jsp:scriptlet>
- </td>
- </tr>
- <jsp:scriptlet>
- <![CDATA[}]]>
- </jsp:scriptlet>
- <tr>
- <td class="dr-mpnl-pnl-b rich-mpnl-body"
valign="top">
- <vcp:body>
- <f:call name="renderChildren" />
+ <a href="#" style="position: absolute; left: -32000"
id="#{clientId}FirstHref" >_</a>
+ <table style="height: 100%; width: 100%;" border="0"
cellpadding="0" cellspacing="0">
+ <jsp:scriptlet>
+ <![CDATA[if(component.getFacet("header")!=null &&
component.getFacet("header").isRendered()) {]]>
+ </jsp:scriptlet>
+ <tr style="height: 1%;">
+ <td class="dr-mpnl-header rich-mpnl-header-cell"
style="position: relative; vertical-align: middle; z-index: 5;"
width="100%">
+ <div id="#{clientId}Header" style="position: relative;
white-space: nowrap;" class="dr-mpnl-pnl-text dr-mpnl-pnl-h rich-mpnl-text
rich-mpnl-header #{component.attributes['headerClass']}">
+ <u:insertFacet name="header" />
+ </div>
+
+ <jsp:scriptlet>
+ <![CDATA[if(component.getFacet("controls")!=null &&
component.getFacet("controls").isRendered()) {]]>
+ </jsp:scriptlet>
+ <div style="position: absolute; top: 3px; right: 3px;"
class="dr-mpnl-pnl-text rich-mpnl-text rich-mpnl-controls
#{component.attributes['controlsClass']}">
+ <u:insertFacet name="controls" />
+ </div>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
+ </td>
+ </tr>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
+ <tr>
+ <td class="dr-mpnl-pnl-b rich-mpnl-body"
valign="top">
+ <vcp:body>
+ <f:call name="renderChildren" />
</vcp:body>
<f:clientid var="clientId"/>
- <a href="#" style="position: absolute; left:
-32001" id="#{clientId}LastHref" >_</a>
- </td>
- </tr>
- </table>
- </div>
- </div>
-
- <script type="text/javascript">
- new ModalPanel('#{clientId}',
- {
- width: #{component.width},
- height: #{component.height},
-
- minWidth: #{component.minWidth},
- minHeight: #{component.minHeight},
-
- resizeable: #{component.resizeable},
- moveable: #{component.moveable},
-
- left: "#{component.left}",
- top: "#{component.top}",
-
- zindex: #{component.zindex},
-
- onshow: #{onshow},
- onhide: #{onhide}
- });
- </script>
- </div>
- </div>
-
+ <a href="#" style="position: absolute; left:
-32001" id="#{clientId}LastHref" >_</a>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+ <script type="text/javascript">
+ new ModalPanel('#{clientId}',
+ {
+ width: #{component.width},
+ height: #{component.height},
+
+ minWidth: #{component.minWidth},
+ minHeight: #{component.minHeight},
+
+ resizeable: #{component.resizeable},
+ moveable: #{component.moveable},
+
+ left: "#{component.left}",
+ top: "#{component.top}",
+
+ zindex: #{component.zindex},
+
+ onshow: #{onshow},
+ onhide: #{onhide},
+
+ keepState: #{component.keepState},
+ showWhenRendered: #{component.showWhenRendered}
+ });
+ </script>
+ </div>
+ </div>
+ <script type="text/javascript" >
+ #{this:getShowScript(context, component)}
+ </script>
</f:template>
\ No newline at end of file