Details
-
Type: New Feature
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.7DR#2
-
Fix Version/s: 1.7Beta1
-
Component/s: ICE-Components
-
Labels:None
-
Environment:n/a
-
Assignee Priority:P2
-
Affects:Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial
Description
autoCentre:
This new attribute would have the effect of maintaining the popup in the centre of the screen whether the user resized the browser or scrolled the document.
autoPosition:
This attribute, declaring an x & y value for the placement of the popup in px, would have the effect of maintaining the position through scroll events
This new attribute would have the effect of maintaining the popup in the centre of the screen whether the user resized the browser or scrolled the document.
autoPosition:
This attribute, declaring an x & y value for the placement of the popup in px, would have the effect of maintaining the position through scroll events
Issue Links
- is duplicated by
-
ICE-2592 Always visible component/panel
- Closed
Activity
Philip Breau
created issue -
Philip Breau
made changes -
Field | Original Value | New Value |
---|---|---|
Summary | PanelPopup keepCentered attribute | PanelPopup autoCenre attribute |
Philip Breau
made changes -
Summary | PanelPopup autoCenre attribute | PanelPopup autoCentre attribute |
Philip Breau
made changes -
Summary | PanelPopup autoCentre attribute | PanelPopup autoCentre and autoPosition attributes |
Philip Breau
made changes -
Description | This new attribute would have the effect of maintaining the popup in the centre of the screen whether the user resized the browser or scrolled the document. |
autoCentre: This new attribute would have the effect of maintaining the popup in the centre of the screen whether the user resized the browser or scrolled the document. autoPosition: This attribute, declaring an x & y value for the placement of the popup in px, would have the effect of maintaining the position through scroll events |
Philip Breau
made changes -
Attachment | Test_AutoPositionAndAutoCentre.war [ 10744 ] |
Ken Fyten
made changes -
Fix Version/s | 1.7 [ 10080 ] |
Ken Fyten
made changes -
Affects | [Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial] | |
Assignee | Adnan Durrani [ adnan.durrani ] |
Adnan Durrani
made changes -
Assignee | Adnan Durrani [ adnan.durrani ] | Philip Breau [ philip.breau ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #15508 | Fri Jan 04 16:32:10 MST 2008 | philip.breau | New autoCentre and autoPosition attributes for the panelPopup component |
Files Changed | ||||
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 MODIFY /icefaces/trunk/icefaces/bridge/lib/extras/style.js |
Philip Breau
made changes -
Status | Open [ 1 ] | In Progress [ 3 ] |
Philip Breau
made changes -
Status | In Progress [ 3 ] | Open [ 1 ] |
Philip Breau
made changes -
Assignee | Philip Breau [ philip.breau ] | Adnan Durrani [ adnan.durrani ] |
Philip Breau
made changes -
Ken Fyten
made changes -
Assignee | Adnan Durrani [ adnan.durrani ] | Patrick Corless [ patrick.corless ] |
Ken Fyten
made changes -
Assignee Priority | P1 |
Patrick Corless
made changes -
Status | Open [ 1 ] | In Progress [ 3 ] |
Ken Fyten
made changes -
Fix Version/s | 1.7Beta1 [ 10121 ] | |
Fix Version/s | 1.7 [ 10080 ] |
Ken Fyten
made changes -
Assignee | Patrick Corless [ patrick.corless ] | Yip Ng [ yip.ng ] |
Ken Fyten
made changes -
Assignee | Yip Ng [ yip.ng ] | Philip Breau [ philip.breau ] |
Philip Breau
made changes -
Status | In Progress [ 3 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Philip Breau
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Ken Fyten
made changes -
Assignee | Philip Breau [ philip.breau ] | Adnan Durrani [ adnan.durrani ] |
Ken Fyten
made changes -
Resolution | Fixed [ 1 ] | |
Status | Closed [ 6 ] | Reopened [ 4 ] |
Assignee Priority | P1 | P2 |
Ken Fyten
made changes -
Assignee | Adnan Durrani [ adnan.durrani ] | Mircea Toma [ mircea.toma ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #15738 | Wed Feb 06 17:48:41 MST 2008 | mircea.toma | Keep popup panel invisible while calculating its postion. |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/bridge/lib/extras/style.js
|
Mircea Toma
made changes -
Status | Reopened [ 4 ] | Closed [ 6 ] |
Resolution | Fixed [ 1 ] |
suggested impl:
Index: D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/panelpopup/PanelPopup.java
===================================================================
— D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/panelpopup/PanelPopup.java (revision 15197)
+++ D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/panelpopup/PanelPopup.java (working copy)
@@ -100,8 +100,40 @@
*/
private Boolean modal = null;
+ /**
+ * The current autoCentre state.
+ */
+ private Boolean autoCentre = null;
+ public boolean isAutoCentre()
+
{ + this.autoCentre = Boolean.valueOf(autoCentre); + }+ public void setAutoCentre(boolean autoCentre)
+
+ private String autoPosition = null;
+
+ public String getAutoPosition()
+
{ + this.autoPosition = val; + }+ public void setAutoPosition(String val)
+
+ /**
*/
public PanelPopup() { Index: D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/panelpopup/PanelPopupRenderer.java =================================================================== --- D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/panelpopup/PanelPopupRenderer.java (revision 15197) +++ D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/panelpopup/PanelPopupRenderer.java (working copy) @@ -223,6 +223,32 @@ String call = addJavascriptCalls(uiComponent, "DRAG", handleId, facesContext); JavascriptContext.addJavascriptCall(facesContext, call); }
+
{ + String positions = panelPopup.getAutoPosition(); + String x = positions.substring(0,positions.indexOf(',')); + String y = positions.substring(positions.indexOf(',')+1); + autoPositionJS = "Ice.autoPosition.start('" + clientId + "'," + x + "," + y +");"; + }+ //autoPosition handling
+ String autoPositionJS = null;
+ if( panelPopup.getAutoPosition() != null )
+ else
{ + autoPositionJS = "Ice.autoPosition.stop('" + clientId + "');"; + }+ JavascriptContext.addJavascriptCall(facesContext, autoPositionJS);
{ + centreJS = "Ice.autoCentre.start('" + clientId + "');"; + + }+
+ //autoCentre handling
+ boolean autoCentre = panelPopup.isAutoCentre();
+ String centreJS;
+ if( autoCentre )
+ else
{ + centreJS = "Ice.autoCentre.stop('" + clientId + "');"; + }+ JavascriptContext.addJavascriptCall(facesContext, centreJS);
+
}
private String modalJavascript(Boolean modal, Boolean visible,
@@ -230,7 +256,8 @@
String call = null;
if (modal != null) {
if (modal.booleanValue() && visible.booleanValue()) {
+ call = "Ice.modal.start('" + clientId + "');";
+
if (log.isTraceEnabled()) { log.trace("Starting Modal Function"); }
Index: D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/ice_cust_properties/cust-panelpopup-props.xml
===================================================================
— D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/ice_cust_properties/cust-panelpopup-props.xml (revision 15197)
+++ D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/ice_cust_properties/cust-panelpopup-props.xml (working copy)
@@ -111,4 +111,24 @@
<property-extension>
<category>ICE_LAYOUT</category>
</property-extension>
+</property>
+<property>
+ <description>Used to keep the popup centred on the screen through
+ scrolling and window resizing events.
+ </description>
+ <property-name>autoCentre</property-name>
+ <property-class>boolean</property-class>
+ <property-extension>
+ <category>ICE_LAYOUT</category>
+ </property-extension>
+</property>
+<property>
+ <description>Used to keep the popup positioned on the screen through
+ scrolling events. Use a string of x and y px values (e.g. autoPostion="35,200").
+ </description>
+ <property-name>autoPosition</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <category>ICE_LAYOUT</category>
+ </property-extension>
</property>
\ No newline at end of file
Index: D:/Documents and Settings/pbreau/workspace/ICEfaces/bridge/lib/extras/style.js
===================================================================
— D:/Documents and Settings/pbreau/workspace/ICEfaces/bridge/lib/extras/style.js (revision 15197)
+++ D:/Documents and Settings/pbreau/workspace/ICEfaces/bridge/lib/extras/style.js (working copy)
@@ -139,9 +139,11 @@
}
var modal = document.getElementById(target);
{ @@ -200,3 +203,73 @@ }-
+
+
modal.style.zIndex = parseInt(iframe.style.zIndex) + 1;
Ice.modal.target = modal;
+
Ice.modal.id = target;
Ice.modal.running = true;
modal.style.visibility = 'visible';
@@ -155,6 +157,7 @@
logger.debug('removed modal iframe for : ' + target);
}
Ice.modal.running = false;
+
}
},
keypress:function(event)
;
+Ice.autoCentre = Class.create();
{position:'absolute'}+Ice.autoCentre = {
+ id:null,
+ keepCentred:function(){
+ var scrollX = window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft;
+ var scrollY = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
+ var div = document.getElementById(Ice.autoCentre.id);
+ 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,
);
{left: x}+ Element.setStyle(div,
);
{top:y}+ Element.setStyle(div,
);
{ + Ice.autoCentre.id = target; + Ice.autoCentre.keepCentred(); + Event.observe(window, 'resize', Ice.autoCentre.keepCentred); + Event.observe(window, 'scroll', Ice.autoCentre.keepCentred); + }+ }
+
+
+ },
+ start:function(target)
,
{ + Event.stopObserving(window, 'resize', Ice.autoCentre.keepCentred); + Event.stopObserving(window, 'scroll', Ice.autoCentre.keepCentred); + }+ stop:function(target) {
+ if (Ice.autoCentre.id == target)
+ }
{position:'absolute'}+};
+
+
+Ice.autoPosition = Class.create();
+Ice.autoPosition = {
+ id:null,
+ xPos:null,
+ yPos:null,
+ keepPositioned:function(){
+ var scrollX = window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft;
+ var scrollY = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
+ var div = document.getElementById(Ice.autoPosition.id);
+ if( div ){
+ var x = Math.round( Ice.autoPosition.xPos + scrollX ) + "px";
+ var y = Math.round( Ice.autoPosition.yPos + scrollY ) + "px";
+ Element.setStyle(div,
);
{left: x}+ Element.setStyle(div,
);
{top:y}+ Element.setStyle(div,
);
{ + Ice.autoPosition.id = target; + Ice.autoPosition.xPos = x; + Ice.autoPosition.yPos = y; + Ice.autoPosition.keepPositioned(); + Event.observe(window, 'scroll', Ice.autoPosition.keepPositioned); + }+ }
+
+
+ },
+ start:function(target,x,y)
,
{ + Event.stopObserving(window, 'scroll', Ice.autoPosition.keepPositioned); + }+ stop:function(target) {
+ if (Ice.autoPosition.id == target)
+ }
+};
+
+
+