Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.7.2 SP1
-
Component/s: ICE-Components
-
Labels:None
-
Environment:All
-
ICEsoft Forum Reference:
-
Affects:Documentation (User Guide, Ref. Guide, etc.)
Description
Philip has the following application level code which will implement this functionality. There is a request for it to be added to the component code base, perhaps as a new attribute on panelPopup.
String panelPopupClientId = "...";
JavascriptContext
.addJavascriptCall(
FacesContext.getCurrentInstance(),
"var div = document.getElementById('" + panelPopupClientId + "');"
+ "if (div) {"
+ "var x = Math.round((Element.getWidth(document.body) - Element.getWidth(div)) / 2 + scrollX);"
+ "if (x < 0) x = 0;"
+ "var y = Math.round(((window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) - Element.getHeight(div)) / 2 + scrollY);"
+ "if (y < 0) y = 0;"
+ "x = x + 'px';"
+ "y = y + 'px';"
+ "Element.setStyle(div, {position:'absolute'});"
+ "Element.setStyle(div, {left: x});"
+ "Element.setStyle(div, {top:y});"
+ "}");
String panelPopupClientId = "...";
JavascriptContext
.addJavascriptCall(
FacesContext.getCurrentInstance(),
"var div = document.getElementById('" + panelPopupClientId + "');"
+ "if (div) {"
+ "var x = Math.round((Element.getWidth(document.body) - Element.getWidth(div)) / 2 + scrollX);"
+ "if (x < 0) x = 0;"
+ "var y = Math.round(((window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) - Element.getHeight(div)) / 2 + scrollY);"
+ "if (y < 0) y = 0;"
+ "x = x + 'px';"
+ "y = y + 'px';"
+ "Element.setStyle(div, {position:'absolute'});"
+ "Element.setStyle(div, {left: x});"
+ "Element.setStyle(div, {top:y});"
+ "}");
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #18172 | Wed Jan 14 13:06:35 MST 2009 | mark.collette | |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/ice_cust_properties/cust-panelpopup-props.xml
|
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #18169 | Wed Jan 14 10:20:26 MST 2009 | yip.ng | Added ability for ice:panelPopup to center itself once when it loads, but not ever again. |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/renderkit/GroupRenderer.java
MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/panelpopup/PanelPopupRenderer.java MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/panelpopup/PanelPopup.java MODIFY /icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/ice_cust_properties/cust-panelpopup-props.xml |