JBoss Rich Faces SVN: r79 - trunk/richfaces/modal-panel/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-15 14:52:17 -0400 (Thu, 15 Mar 2007)
New Revision: 79
Modified:
trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
Log:
Predefined classes renamed
Modified: trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
--- trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-03-15 18:45:51 UTC (rev 78)
+++ trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-03-15 18:52:17 UTC (rev 79)
@@ -77,8 +77,8 @@
<![CDATA[if(component.getFacet("header")!=null && component.getFacet("header").isRendered()) {]]>
</jsp:scriptlet>
<tr style="height: 1%;">
- <td class="dr-mpnl-header rich-mpnl-header" style="position: relative; vertical-align: middle; z-index: #{component.zindex + 2 }" width="100%">
- <div id="#{clientId}Header" style="position: relative;" class="dr-mpnl-pnl-text dr-mpnl-pnl-h rich-mpnl-pnl-text rich-mpnl-pnl-h #{component.attributes['headerClass']}"
+ <td class="dr-mpnl-header rich-mpnl-header-cell" style="position: relative; vertical-align: middle; z-index: #{component.zindex + 2 }" width="100%">
+ <div id="#{clientId}Header" style="position: relative;" class="dr-mpnl-pnl-text dr-mpnl-pnl-h rich-mpnl-text rich-mpnl-header #{component.attributes['headerClass']}"
nowrap="nowrap">
<u:insertFacet name="header" />
</div>
@@ -86,7 +86,7 @@
<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-pnl-text #{component.attributes['controlsClass']}">
+ <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>
@@ -98,7 +98,7 @@
<![CDATA[}]]>
</jsp:scriptlet>
<tr>
- <td class="dr-mpnl-pnl-b rich-mpnl-pnl-b" valign="top">
+ <td class="dr-mpnl-pnl-b rich-mpnl-body" valign="top">
<vcp:body>
<f:call name="renderChildren" />
</vcp:body>
17 years, 2 months
JBoss Rich Faces SVN: r78 - trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-15 14:45:51 -0400 (Thu, 15 Mar 2007)
New Revision: 78
Modified:
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
Check for getElementsByTagName() method existence added to handle #text nodes
Modified: trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-03-15 18:34:33 UTC (rev 77)
+++ trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-03-15 18:45:51 UTC (rev 78)
@@ -198,7 +198,7 @@
var children = document.body.childNodes;
for (var k = 0; k < children.length; k++) {
var child = children[k];
- if (child != this.id) {
+ if (child != this.id && child.getElementsByTagName) {
var selects = child.getElementsByTagName("SELECT");
17 years, 2 months
JBoss Rich Faces SVN: r77 - trunk/richfaces/modal-panel/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-15 14:34:33 -0400 (Thu, 15 Mar 2007)
New Revision: 77
Modified:
trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
Log:
Missing space added
Modified: trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
--- trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-03-15 15:35:15 UTC (rev 76)
+++ trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-03-15 18:34:33 UTC (rev 77)
@@ -78,7 +78,7 @@
</jsp:scriptlet>
<tr style="height: 1%;">
<td class="dr-mpnl-header rich-mpnl-header" style="position: relative; vertical-align: middle; z-index: #{component.zindex + 2 }" width="100%">
- <div id="#{clientId}Header" style="position: relative;" class="dr-mpnl-pnl-text dr-mpnl-pnl-h rich-mpnl-pnl-text rich-mpnl-pnl-h#{component.attributes['headerClass']}"
+ <div id="#{clientId}Header" style="position: relative;" class="dr-mpnl-pnl-text dr-mpnl-pnl-h rich-mpnl-pnl-text rich-mpnl-pnl-h #{component.attributes['headerClass']}"
nowrap="nowrap">
<u:insertFacet name="header" />
</div>
17 years, 2 months
JBoss Rich Faces SVN: r76 - trunk/richfaces-samples/modalpanel-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-15 11:35:15 -0400 (Thu, 15 Mar 2007)
New Revision: 76
Modified:
trunk/richfaces-samples/modalpanel-sample/src/main/webapp/pages/index.jsp
Log:
Handling for short-form clientId added to tests
Modified: trunk/richfaces-samples/modalpanel-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/richfaces-samples/modalpanel-sample/src/main/webapp/pages/index.jsp 2007-03-15 15:34:00 UTC (rev 75)
+++ trunk/richfaces-samples/modalpanel-sample/src/main/webapp/pages/index.jsp 2007-03-15 15:35:15 UTC (rev 76)
@@ -79,7 +79,7 @@
</f:facet>
<f:facet name="controls">
- <h:graphicImage value="/images/ico_close.gif" onclick="Richfaces.hideModalPanel('_form:_panel');"/>
+ <h:graphicImage value="/images/ico_close.gif" onclick="Richfaces.hideModalPanel('_panel');"/>
</f:facet>
<f:verbatim>
@@ -140,10 +140,10 @@
</mp:modalPanel>
<f:verbatim>
- <a href="javascript:Richfaces.showModalPanel('_form:_panel');">Show</a>
- <a href="javascript:Richfaces.showModalPanel('_form:_panel', {left: '120', top: 'auto'});">Show: left = 120; top = auto</a>
- <a href="javascript:Richfaces.showModalPanel('_form:_panel', {top: 'auto', width: 800});">Show: width = 800; top = auto</a>
- <a href="javascript:Richfaces.showModalPanel('_form:_panel', {width: 1});">Show: width = 1</a>
+ <a href="javascript:Richfaces.showModalPanel(':_panel');">Show</a>
+ <a href="javascript:Richfaces.showModalPanel(':_panel', {left: '120', top: 'auto'});">Show: left = 120; top = auto</a>
+ <a href="javascript:Richfaces.showModalPanel(':_panel', {top: 'auto', width: 800});">Show: width = 800; top = auto</a>
+ <a href="javascript:Richfaces.showModalPanel(':_panel', {width: 1});">Show: width = 1</a>
</f:verbatim>
</h:panelGrid>
17 years, 2 months
JBoss Rich Faces SVN: r75 - trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-15 11:34:00 -0400 (Thu, 15 Mar 2007)
New Revision: 75
Modified:
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
Handling for short-form clientId implemented
Modified: trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-03-14 20:00:52 UTC (rev 74)
+++ trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-03-15 15:34:00 UTC (rev 75)
@@ -31,37 +31,29 @@
}
}
-ModalPanel.ajaxListener = {
+ModalPanel.panels = new Array();
+
+A4J.AJAX.AddListener({
onafterajax: function(req, event, data) {
var i = 0;
- while (i < this.panels.length) {
- var panel = this.panels[i];
+ while (i < ModalPanel.panels.length) {
+ var panel = ModalPanel.panels[i];
var elt = panel.markerId;
if (!Richfaces.isNodeInDOMTree(elt)) {
panel.destroy();
- this.panels.splice(i, 1);
+ ModalPanel.panels.splice(i, 1);
//check all panels again. maybe we've removed parent of any panel just now
i = 0;
} else {
i++;
}
}
- },
-
- panels: new Array(),
-
- addPanel: function(panel) {
- if (panel) {
- this.panels.push(panel);
- }
}
-};
+});
-A4J.AJAX.AddListener(ModalPanel.ajaxListener);
-
ModalPanel.Context = Class.create();
ModalPanel.Context.prototype = {
initialize: function(modalPanel) {
@@ -162,15 +154,18 @@
this.cdiv.mpUseExpr = true;
}
+
+ ModalPanel.panels.push(this);
},
destroy: function() {
- var parent = this.id.parentNode;
-
this.traverseSelects(true);
- if (parent) {
- parent.removeChild(this.id);
+ if (this.floatedToBody) {
+ var parent = this.id.parentNode;
+ if (parent) {
+ parent.removeChild(this.id);
+ }
}
},
@@ -259,9 +254,9 @@
},
show: function(opts) {
- if (this.id.parentNode != document.body) {
+ if (!this.floatedToBody) {
document.body.appendChild(this.id.parentNode.removeChild(this.id));
- ModalPanel.ajaxListener.addPanel(this);
+ this.floatedToBody = true;
}
var options = {};
@@ -543,14 +538,41 @@
}
}
+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.modalPanel)
- panel.modalPanel.show(opts);
+ if (!panel) {
+ panel = Richfaces.findModalPanel(id);
+ }
+ panel.modalPanel.show(opts);
}
Richfaces.hideModalPanel = function (id) {
var panel = $(id + "Container");
- if (panel && panel.modalPanel)
- panel.modalPanel.hide();
+ if (!panel) {
+ panel = Richfaces.findModalPanel(id);
+ }
+ panel.modalPanel.hide();
}
17 years, 2 months
JBoss Rich Faces SVN: r74 - trunk/richfaces/modal-panel/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-14 16:00:52 -0400 (Wed, 14 Mar 2007)
New Revision: 74
Modified:
trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
Log:
Added zIndex setup for root MP element
Modified: trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
--- trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-03-14 19:29:43 UTC (rev 73)
+++ trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-03-14 20:00:52 UTC (rev 74)
@@ -32,7 +32,7 @@
<f:call name="checkOptions" />
<div id="#{clientId}Container"
- style="position: relative; display: none;"
+ style="position: relative; display: none; z-index: #{component.zindex};"
class="rich-modalpanel"
x:passThruWithExclusions="id,style,class"
>
17 years, 2 months
JBoss Rich Faces SVN: r73 - in trunk/richfaces-samples/modalpanel-sample/src/main: webapp/pages and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-14 15:29:43 -0400 (Wed, 14 Mar 2007)
New Revision: 73
Modified:
trunk/richfaces-samples/modalpanel-sample/src/main/java/org/richfaces/Bean.java
trunk/richfaces-samples/modalpanel-sample/src/main/webapp/pages/index.jsp
Log:
Test case extended:
1. To check if MP collect its stale elements on AJAX request fine
2. To check if SELECTs inside MP get disabled on show
Modified: trunk/richfaces-samples/modalpanel-sample/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/richfaces-samples/modalpanel-sample/src/main/java/org/richfaces/Bean.java 2007-03-14 19:28:17 UTC (rev 72)
+++ trunk/richfaces-samples/modalpanel-sample/src/main/java/org/richfaces/Bean.java 2007-03-14 19:29:43 UTC (rev 73)
@@ -25,6 +25,8 @@
*
*/
public class Bean {
+ private boolean containerRendered = true;
+
private boolean resizeable = false;
private boolean moveable = true;
public boolean isResizeable() {
@@ -39,4 +41,10 @@
public void setMoveable(boolean moveable) {
this.moveable = moveable;
}
+ public boolean isContainerRendered() {
+ return containerRendered;
+ }
+ public void setContainerRendered(boolean containerRendered) {
+ this.containerRendered = containerRendered;
+ }
}
\ No newline at end of file
Modified: trunk/richfaces-samples/modalpanel-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/richfaces-samples/modalpanel-sample/src/main/webapp/pages/index.jsp 2007-03-14 19:28:17 UTC (rev 72)
+++ trunk/richfaces-samples/modalpanel-sample/src/main/webapp/pages/index.jsp 2007-03-14 19:29:43 UTC (rev 73)
@@ -22,12 +22,33 @@
</head>
<body>
<f:view>
- <h:form id="_form"><a4j:outputPanel ajaxRendered="true">
+ <h:form id="_form">
+
+ <h:selectOneMenu>
+ <f:selectItem itemLabel="item1" itemValue="item1" />
+ <f:selectItem itemLabel="item2" itemValue="item2" />
+ <f:selectItem itemLabel="item3" itemValue="item3" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu disabled="true" style="filter: alpha(opacity=50); background-color: #d0d0d0;">
+ <f:selectItem itemLabel="item1" itemValue="item1" />
+ <f:selectItem itemLabel="item2" itemValue="item2" />
+ <f:selectItem itemLabel="item3" itemValue="item3" />
+ </h:selectOneMenu>
+
+ <a4j:outputPanel ajaxRendered="true">
<h:selectOneRadio binding="#{skinBean.component}" />
<h:commandLink action="#{skinBean.change}" value="set skin" />
- <h:panelGrid columns="2">
+ <h:panelGrid columns="3" cellspacing="20">
+ <h:selectBooleanCheckbox value="#{bean.containerRendered}">
+ <f:verbatim>
+ containerRendered
+ </f:verbatim>
+ <a4j:support event="onchange" />
+ </h:selectBooleanCheckbox>
+
<h:selectBooleanCheckbox value="#{bean.resizeable}">
<f:verbatim>
resizeable
@@ -49,7 +70,7 @@
</f:verbatim>
- <h:panelGrid columns="1" style="position: relative; top: 550px; left: 100px;">
+ <h:panelGrid rendered="#{bean.containerRendered}" columns="1" style="position: relative; top: 550px; left: 100px;">
<mp:modalPanel resizeable="#{bean.resizeable}" moveable="#{bean.moveable}" minHeight="100" top="10" width="450" id="_panel" controlsClass="pointerCursor">
<f:facet name="header">
<f:verbatim>
@@ -64,6 +85,59 @@
<f:verbatim>
Modal panel is here!
</f:verbatim>
+
+ <h:selectOneMenu>
+ <f:selectItem itemLabel="item1" itemValue="item1" />
+ <f:selectItem itemLabel="item2" itemValue="item2" />
+ <f:selectItem itemLabel="item3" itemValue="item3" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu disabled="true" style="filter: alpha(opacity=50); background-color: #d0d0d0;">
+ <f:selectItem itemLabel="item1" itemValue="item1" />
+ <f:selectItem itemLabel="item2" itemValue="item2" />
+ <f:selectItem itemLabel="item3" itemValue="item3" />
+ </h:selectOneMenu>
+
+ <f:verbatim>
+ <a href="javascript:Richfaces.showModalPanel('_form:_panel2');">Show 2nd panel</a>
+ </f:verbatim>
+
+ <mp:modalPanel height="200" top="100" width="450" id="_panel2" controlsClass="pointerCursor" zindex="500">
+ <f:facet name="header">
+ <f:verbatim>
+ Header
+ </f:verbatim>
+ </f:facet>
+
+ <f:facet name="controls">
+ <h:graphicImage value="/images/ico_close.gif" onclick="Richfaces.hideModalPanel('_form:_panel2');"/>
+ </f:facet>
+
+ <h:panelGrid columns="2">
+ <h:selectOneMenu>
+ <f:selectItem itemLabel="item1" itemValue="item1" />
+ <f:selectItem itemLabel="item2" itemValue="item2" />
+ <f:selectItem itemLabel="item3" itemValue="item3" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu disabled="true" style="filter: alpha(opacity=50); background-color: #d0d0d0;">
+ <f:selectItem itemLabel="item1" itemValue="item1" />
+ <f:selectItem itemLabel="item2" itemValue="item2" />
+ <f:selectItem itemLabel="item3" itemValue="item3" />
+ </h:selectOneMenu>
+
+ <f:verbatim>
+ containerRendered
+ </f:verbatim>
+
+ <h:selectBooleanCheckbox value="#{bean.containerRendered}">
+ <a4j:support event="onchange" />
+ </h:selectBooleanCheckbox>
+ </h:panelGrid>
+
+ </mp:modalPanel>
+
+
</mp:modalPanel>
<f:verbatim>
<a href="javascript:Richfaces.showModalPanel('_form:_panel');">Show</a>
@@ -73,18 +147,6 @@
</f:verbatim>
</h:panelGrid>
- <h:selectOneMenu>
- <f:selectItem itemLabel="item1" itemValue="item1" />
- <f:selectItem itemLabel="item2" itemValue="item2" />
- <f:selectItem itemLabel="item3" itemValue="item3" />
- </h:selectOneMenu>
-
- <h:selectOneMenu disabled="true" style="filter: alpha(opacity=50); background-color: #d0d0d0;">
- <f:selectItem itemLabel="item1" itemValue="item1" />
- <f:selectItem itemLabel="item2" itemValue="item2" />
- <f:selectItem itemLabel="item3" itemValue="item3" />
- </h:selectOneMenu>
-
<%--
<mp:modalPanel>
<f:verbatim>
17 years, 2 months
JBoss Rich Faces SVN: r72 - in trunk/richfaces/modal-panel/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-14 15:28:17 -0400 (Wed, 14 Mar 2007)
New Revision: 72
Modified:
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
Log:
ModalPanel functionality reviewed:
1. MP moves its content direct to body DOM element to solve zIndex issues
- MPs collect "space garbage" on every AJAX request
2. Fixed disabling of SELECTs inside the MP
Modified: trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-03-14 19:13:42 UTC (rev 71)
+++ trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-03-14 19:28:17 UTC (rev 72)
@@ -31,6 +31,37 @@
}
}
+ModalPanel.ajaxListener = {
+ onafterajax: function(req, event, data) {
+ var i = 0;
+ while (i < this.panels.length) {
+ var panel = this.panels[i];
+
+ var elt = panel.markerId;
+
+ if (!Richfaces.isNodeInDOMTree(elt)) {
+ panel.destroy();
+
+ this.panels.splice(i, 1);
+ //check all panels again. maybe we've removed parent of any panel just now
+ i = 0;
+ } else {
+ i++;
+ }
+ }
+ },
+
+ panels: new Array(),
+
+ addPanel: function(panel) {
+ if (panel) {
+ this.panels.push(panel);
+ }
+ }
+};
+
+A4J.AJAX.AddListener(ModalPanel.ajaxListener);
+
ModalPanel.Context = Class.create();
ModalPanel.Context.prototype = {
initialize: function(modalPanel) {
@@ -69,8 +100,10 @@
ModalPanel.prototype = {
initialize: function(id, options) {
- this.id = $(id);
+ this.markerId = $(id);
+ this.id = $(id + "Container");
+
this.options = options;
this.baseZIndex = this.options.zindex ? this.options.zindex : 100;
@@ -131,6 +164,16 @@
}
},
+ destroy: function() {
+ var parent = this.id.parentNode;
+
+ this.traverseSelects(true);
+
+ if (parent) {
+ parent.removeChild(this.id);
+ }
+ },
+
initIframe : function() {
if (this.contentWindow) {
Element.setStyle(this.contentWindow.document.body, { "margin" : "0px 0px 0px 0px" });
@@ -157,23 +200,44 @@
return ;
}
- var selects = document.getElementsByTagName("SELECT");
+ var children = document.body.childNodes;
+ for (var k = 0; k < children.length; k++) {
+ var child = children[k];
+ if (child != this.id) {
+
+ 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;
- for (var i = 0; i < selects.length; i++) {
- var elt = selects[i];
-
- if (enable) {
- if (elt._mdwDisabled) {
- elt._mdwDisabled = undefined;
- } else {
- elt.disabled = false;
+ 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;
+ }
+ }
}
- } else {
- if (elt.disabled) {
- elt._mdwDisabled = true;
- } else {
- elt.disabled = true;
- }
}
}
},
@@ -195,6 +259,11 @@
},
show: function(opts) {
+ if (this.id.parentNode != document.body) {
+ document.body.appendChild(this.id.parentNode.removeChild(this.id));
+ ModalPanel.ajaxListener.addPanel(this);
+ }
+
var options = {};
if (!this.cdiv.mpSet) {
@@ -475,13 +544,13 @@
}
Richfaces.showModalPanel = function (id, opts) {
- var panel = $(id);
+ var panel = $(id + "Container");
if (panel && panel.modalPanel)
panel.modalPanel.show(opts);
}
Richfaces.hideModalPanel = function (id) {
- var panel = $(id);
+ var panel = $(id + "Container");
if (panel && panel.modalPanel)
panel.modalPanel.hide();
}
Modified: trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
--- trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-03-14 19:13:42 UTC (rev 71)
+++ trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-03-14 19:28:17 UTC (rev 72)
@@ -26,105 +26,109 @@
<f:clientid var="clientId"/>
<div id="#{clientId}"
- name="#{clientId}"
- x:passThruWithExclusions="value,name,type,id"
- style="position: relative; display: none;"
- class="rich-modalpanel"
+ style="display: none;"
>
<f:call name="checkOptions" />
-
- <div class="dr-mpnl-mask-div rich-mpnl-mask-div" id="#{clientId}Div"
- style="background-color: #d0d0d0; filter: alpha(opacity=50); opacity: 0.5; z-index: #{component.zindex - 2};"></div>
- <div class="dr-mpnl-mask-div rich-mpnl-mask-div" id="#{clientId}CursorDiv"
- style="background-color: #d0d0d0; filter: alpha(opacity=1); opacity: 0.01; z-index: #{component.zindex - 200 }"></div>
-
- <div id="#{clientId}CDiv" class="dr-mpnl-panel rich-mpnl_panel" style="z-index: #{component.zindex - 1};">
-
- <iframe frameborder="0" scrolling="no" id="#{clientId}IFrame"
- style="position: absolute; width: 100%; height: 100%; background-color: white; overflow-y: hidden; z-index: #{component.zindex - 2};">
- </iframe>
-
- <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) + component.getZindex()) + ";";
- variables.setVariable("resizerStyle", style);
- ]]>
- </jsp:scriptlet>
- <div id="#{clientId}Resizer#{resizer}" class="dr-mpnl-resizer rich-mpnl-resizer" style="#{resizerStyle}">
- </div>
- <jsp:scriptlet>
- <![CDATA[
+
+ <div id="#{clientId}Container"
+ style="position: relative; display: none;"
+ class="rich-modalpanel"
+ x:passThruWithExclusions="id,style,class"
+ >
+ <div class="dr-mpnl-mask-div rich-mpnl-mask-div" id="#{clientId}Div"
+ style="background-color: #d0d0d0; filter: alpha(opacity=50); opacity: 0.5; z-index: #{component.zindex - 2};"></div>
+ <div class="dr-mpnl-mask-div rich-mpnl-mask-div" id="#{clientId}CursorDiv"
+ style="background-color: #d0d0d0; filter: alpha(opacity=1); opacity: 0.01; z-index: #{component.zindex - 200 }"></div>
+
+ <div id="#{clientId}CDiv" class="dr-mpnl-panel rich-mpnl_panel" style="z-index: #{component.zindex - 1};">
+
+ <iframe frameborder="0" scrolling="no" id="#{clientId}IFrame"
+ style="position: absolute; width: 100%; height: 100%; background-color: white; overflow-y: hidden; z-index: #{component.zindex - 2};">
+ </iframe>
+
+ <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) + component.getZindex()) + ";";
+ 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 style="position: absolute; width: 100%; height: 100%; overflow: hidden; z-index: #{component.zindex - 1};"
- class="dr-mpnl-pnl" >
- <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" style="position: relative; vertical-align: middle; z-index: #{component.zindex + 2 }" width="100%">
- <div id="#{clientId}Header" style="position: relative;" class="dr-mpnl-pnl-text dr-mpnl-pnl-h rich-mpnl-pnl-text rich-mpnl-pnl-h#{component.attributes['headerClass']}"
- nowrap="nowrap">
- <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-pnl-text #{component.attributes['controlsClass']}">
- <u:insertFacet name="controls" />
+ ]]>
+ </jsp:scriptlet>
+
+ <div style="position: absolute; width: 100%; height: 100%; overflow: hidden; z-index: #{component.zindex - 1};"
+ class="dr-mpnl-pnl" >
+ <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" style="position: relative; vertical-align: middle; z-index: #{component.zindex + 2 }" width="100%">
+ <div id="#{clientId}Header" style="position: relative;" class="dr-mpnl-pnl-text dr-mpnl-pnl-h rich-mpnl-pnl-text rich-mpnl-pnl-h#{component.attributes['headerClass']}"
+ nowrap="nowrap">
+ <u:insertFacet name="header" />
</div>
- <jsp:scriptlet>
- <![CDATA[}]]>
- </jsp:scriptlet>
- </td>
- </tr>
- <jsp:scriptlet>
- <![CDATA[}]]>
- </jsp:scriptlet>
- <tr>
- <td class="dr-mpnl-pnl-b rich-mpnl-pnl-b" valign="top">
- <vcp:body>
- <f:call name="renderChildren" />
- </vcp:body>
- </td>
- </tr>
- </table>
+
+ <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-pnl-text #{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-pnl-b" valign="top">
+ <vcp:body>
+ <f:call name="renderChildren" />
+ </vcp:body>
+ </td>
+ </tr>
+ </table>
+ </div>
</div>
+
+ <f:clientid var="clientId"/>
+
+ <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}
+ });
+ </script>
</div>
-
- <f:clientid var="clientId"/>
+ </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}
- });
- </script>
- </div>
</f:root>
\ No newline at end of file
17 years, 2 months
JBoss Rich Faces SVN: r71 - trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-14 15:13:42 -0400 (Wed, 14 Mar 2007)
New Revision: 71
Modified:
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
Log:
Richfaces.isNodeInDOMTree function added
Modified: trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
--- trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-03-14 14:45:27 UTC (rev 70)
+++ trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-03-14 19:13:42 UTC (rev 71)
@@ -48,3 +48,13 @@
if ( pxIndex == -1 ) return str;
return str.substr(0,pxIndex);
};
+
+Richfaces.isNodeInDOMTree = function(node) {
+ var root = document.documentElement;
+ var elt = node;
+ while (elt && elt != root) {
+ elt = elt.parentNode;
+ }
+
+ return !!elt;
+};
\ No newline at end of file
17 years, 2 months
JBoss Rich Faces SVN: r70 - trunk/richfaces/inputnumber-slider/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: F.antonov
Date: 2007-03-14 10:45:27 -0400 (Wed, 14 Mar 2007)
New Revision: 70
Modified:
trunk/richfaces/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
Log:
Fix for bug RFA-291.
Modified: trunk/richfaces/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
===================================================================
--- trunk/richfaces/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2007-03-14 14:30:41 UTC (rev 69)
+++ trunk/richfaces/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2007-03-14 14:45:27 UTC (rev 70)
@@ -86,7 +86,7 @@
<div style="position : relative">
<div id="#{clientId}Tip" class="dr-insldr-tip rich-inslider-tip #{component.attributes['tipClass']}" style="display: none;#{component.attributes['tipStyle']}">
</div>
- <div class="dr-insldr-handler rich-inslider-handler #{component.attributes['handleClass']}" style="#{component.attributes['handleStyle']}" id="#{clientId}Handle"></div>
+ <div class="dr-insldr-handler rich-inslider-handler #{component.attributes['handleClass']}" id="#{clientId}Handle"></div>
</div>
<div class="dr-insldr-track rich-inslider-track #{component.attributes['barClass']}" style="#{component.attributes['barStyle']}">
<table class="dr-insldr-track-decor-1" cellpadding="0" cellspacing="0">
17 years, 2 months