myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmarinsc...@apache.org
Subject svn commit: r550632 - in /myfaces/tomahawk/trunk/sandbox: core/src/main/java/org/apache/myfaces/custom/ppr/ core/src/main/resources/org/apache/myfaces/custom/ppr/resource/ core/src/main/tld/ examples/src/main/java/org/apache/myfaces/examples/dojodialog...
Date Mon, 25 Jun 2007 22:52:55 GMT
Author: mmarinschek
Date: Mon Jun 25 15:52:54 2007
New Revision: 550632

URL: http://svn.apache.org/viewvc?view=rev&rev=550632
Log:
TOMAHAWK-1033: enabled partial triggers to start a periodical update - including a new example.
thanks to Stefan Schuster

Added:
    myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/dojodialog/
    myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/dojodialog/DojoDialogBean.java
Modified:
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRPanelGroup.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRPanelGroupRenderer.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRPanelGroupTag.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/ppr/resource/ppr.js
    myfaces/tomahawk/trunk/sandbox/core/src/main/tld/myfaces_sandbox.tld
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/dojo/dojoDialog.jsp

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRPanelGroup.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRPanelGroup.java?view=diff&rev=550632&r1=550631&r2=550632
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRPanelGroup.java
(original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRPanelGroup.java
Mon Jun 25 15:52:54 2007
@@ -38,7 +38,9 @@
 
 	private Integer _periodicalUpdate;
 
-	private String _partialTriggerPattern;
+    private String _periodicalTriggers;
+
+    private String _partialTriggerPattern;
 
 	private String _inlineLoadingMessage;
 
@@ -76,7 +78,18 @@
 		_periodicalUpdate = periodicalUpdate;
 	}
 
-	public String getPartialTriggerPattern() {
+    public String getPeriodicalTriggers() {
+		if (_periodicalTriggers != null)
+			return _periodicalTriggers;
+		ValueBinding vb = getValueBinding("periodicalTriggers");
+		return (vb != null) ? (String) vb.getValue(getFacesContext()) : null;
+	}
+
+	public void setPeriodicalTriggers(String periodicalTriggers) {
+		_periodicalTriggers = periodicalTriggers;
+	}
+
+    public String getPartialTriggerPattern() {
 		if (_partialTriggerPattern != null)
 			return _partialTriggerPattern;
 		ValueBinding vb = getValueBinding("partialTriggerPattern");
@@ -129,19 +142,21 @@
 		_partialTriggers = (String) values[1];
 		_partialTriggerPattern = (String) values[2];
 		_periodicalUpdate = (Integer) values[3];
-		_showDebugMessages = (Boolean) values[4];
-		_stateUpdate = (Boolean) values[5];
+        _periodicalTriggers = (String) values[4];
+        _showDebugMessages = (Boolean) values[5];
+		_stateUpdate = (Boolean) values[6];
 
 	}
 
 	public Object saveState(FacesContext context) {
-		Object[] values = new Object[6];
+		Object[] values = new Object[7];
 		values[0] = super.saveState(context);
 		values[1] = _partialTriggers;
 		values[2] = _partialTriggerPattern;
 		values[3] = _periodicalUpdate;
-		values[4] = _showDebugMessages;
-		values[5] = _stateUpdate;
+        values[4] = _periodicalTriggers;
+        values[5] = _showDebugMessages;
+		values[6] = _stateUpdate;
 		return values;
 	}
 }

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRPanelGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRPanelGroupRenderer.java?view=diff&rev=550632&r1=550631&r2=550632
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRPanelGroupRenderer.java
(original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRPanelGroupRenderer.java
Mon Jun 25 15:52:54 2007
@@ -52,7 +52,9 @@
 
 	private static final String ADD_PARTIAL_TRIGGER_FUNCTION = "addPartialTrigger";
 
-	private static final String ADD_PARTIAL_TRIGGER_PATTERN_FUNCTION = "addPartialTriggerPattern";
+    private static final String ADD_PERIODICAL_TRIGGER_FUNCTION = "addPeriodicalTrigger";
+
+    private static final String ADD_PARTIAL_TRIGGER_PATTERN_FUNCTION = "addPartialTriggerPattern";
 
 	private static final String ADD_INLINE_LOADING_MESSAGE_FUNCTION = "addInlineLoadingMessage";
 
@@ -115,8 +117,38 @@
 		String clientId = pprGroup.getClientId(facesContext);
 
 		if (pprGroup.getPeriodicalUpdate() != null) {
-			script.append(pprCtrlReference + ".startPeriodicalUpdate(" + pprGroup.getPeriodicalUpdate()
+ ",'" + clientId
+            String periodicalTriggers = pprGroup.getPeriodicalTriggers();
+            //If no periodicalTriggers are set just start the periodical update
+            if (periodicalTriggers == null || periodicalTriggers.trim().length() <= 0)
{
+                script.append(pprCtrlReference + ".startPeriodicalUpdate(" + pprGroup.getPeriodicalUpdate()
+ ",'" + clientId
 					+ "');");
+            }
+            //Otherwise start it when the trigger happens
+            else {
+                StringTokenizer st = new StringTokenizer(periodicalTriggers, ",; ", false);
+                String periodicalTriggerId;
+                String periodicalTriggerClientId;
+                UIComponent periodicalTriggerComponent;
+                while (st.hasMoreTokens()) {
+                    periodicalTriggerId = st.nextToken();
+                    periodicalTriggerComponent = pprGroup.findComponent(periodicalTriggerId);
+                    if (periodicalTriggerComponent == null) {
+                        periodicalTriggerComponent = facesContext.getViewRoot().findComponent(periodicalTriggerId);
+                    }
+
+                    //Component found
+                    if (periodicalTriggerComponent != null) {
+                        periodicalTriggerClientId = periodicalTriggerComponent.getClientId(facesContext);
+                        script.append(pprCtrlReference + "." + ADD_PERIODICAL_TRIGGER_FUNCTION
+ "('" + periodicalTriggerClientId + "','"
+                                + clientId + "', " + pprGroup.getPeriodicalUpdate() + ");");
+                    //Component missing
+                    } else {
+                        if (log.isDebugEnabled()) {
+                            log.debug("PPRPanelGroupRenderer Component with id " + periodicalTriggerId
+ " not found!");
+                        }
+                    }
+                }
+            }
 		}
 
 		String partialTriggerId;

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRPanelGroupTag.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRPanelGroupTag.java?view=diff&rev=550632&r1=550631&r2=550632
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRPanelGroupTag.java
(original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRPanelGroupTag.java
Mon Jun 25 15:52:54 2007
@@ -34,7 +34,9 @@
 
 	private String _periodicalUpdate;
 
-	private String _showDebugMessages;
+    private String _periodicalTriggers;
+
+    private String _showDebugMessages;
 
 	private String _stateUpdate;
 
@@ -50,7 +52,8 @@
 		super.release();
 		_partialTriggers = null;
 		_periodicalUpdate = null;
-		_showDebugMessages = null;
+        _periodicalTriggers = null;
+        _showDebugMessages = null;
 		_stateUpdate = null;
 	}
 
@@ -61,7 +64,8 @@
 		setStringProperty(component, "partialTriggerPattern", _partialTriggerPattern);
 		setStringProperty(component, "inlineLoadingMessage", _inlineLoadingMessage);
 		setIntegerProperty(component, "periodicalUpdate", _periodicalUpdate);
-		setBooleanProperty(component, "showDebugMessages", _showDebugMessages);
+        setStringProperty(component, "periodicalTriggers", _periodicalTriggers);
+        setBooleanProperty(component, "showDebugMessages", _showDebugMessages);
 		setBooleanProperty(component, "stateUpdate", _stateUpdate);
 	}
 
@@ -93,7 +97,15 @@
 		_periodicalUpdate = periodicalUpdate;
 	}
 
-	public void setShowDebugMessages(String showDebugMessages) {
+    public String getPeriodicalTriggers() {
+		return _periodicalTriggers;
+	}
+
+    public void setPeriodicalTriggers(String periodicalTriggers) {
+		_periodicalTriggers = periodicalTriggers;
+	}
+
+    public void setShowDebugMessages(String showDebugMessages) {
 		_showDebugMessages = showDebugMessages;
 	}
 

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/ppr/resource/ppr.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/ppr/resource/ppr.js?view=diff&rev=550632&r1=550631&r2=550632
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/ppr/resource/ppr.js
(original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/ppr/resource/ppr.js
Mon Jun 25 15:52:54 2007
@@ -41,6 +41,10 @@
 	{
     	window.myFacesInlineLoadingMessage = new Array;
     }
+    if(typeof window.oamRefreshTimeoutForZoneId == "undefined")
+	{
+    	window.oamRefreshTimeoutForZoneId = new Array;
+    }
 
     this.replaceFormSubmitFunction(formId);
 
@@ -80,6 +84,29 @@
     this._addEventHandler(dojo.byId(inputElementId));
 };
 
+//Method for JSF Components to register their Periodical Triggers
+
+org.apache.myfaces.PPRCtrl.prototype.addPeriodicalTrigger = function(inputElementId, refreshZoneId,
refreshTimeout)
+{
+    if (window.oamPartialTriggersToZoneIds[inputElementId] === undefined)
+    {
+        window.oamPartialTriggersToZoneIds[inputElementId] = refreshZoneId;
+    }
+    else
+    {
+        window.oamPartialTriggersToZoneIds[inputElementId] =
+        window.oamPartialTriggersToZoneIds[inputElementId] +
+        "," +
+        refreshZoneId;
+    }
+
+    if (window.oamRefreshTimeoutForZoneId[refreshZoneId] === undefined) {
+        window.oamRefreshTimeoutForZoneId[refreshZoneId] = refreshTimeout;
+    }
+
+    this._addPeriodicalEventHandler(dojo.byId(inputElementId));
+};
+
 // registering a function (called before submit) on each form to block periodical refresh
during request-response cycle
 
 org.apache.myfaces.PPRCtrl.prototype.registerOnSubmitInterceptor = function()
@@ -429,6 +456,25 @@
 
 }
 
+org.apache.myfaces.PPRCtrl.prototype._addPeriodicalEventHandler = function(formElement) {
+    var eventHandler = null;
+    if (this._isButton(formElement) || this._isCheckbox(formElement) || this._isRadio(formElement))
{
+        //for these element-types, onclick is appropriate
+        eventHandler = "onclick";
+    }
+    else if(this._isText(formElement) || this._isDropdown(formElement)) {
+        //for these element-types, onblur will be working.
+        //attention: onchange won't work properly in IE6 at least (field will never loose
focus)
+        eventHandler = "onblur";
+    }
+
+    if (!eventHandler) {
+        return;
+    }
+
+    dojo.event.connect(formElement, eventHandler, this, "elementOnPeriodicalEventHandler");
+}
+
 
 //PointCutAdvisor which invokes the AJAX Submit Method of the PPR Controller after custom
 //onclick-handlers for submit-buttons and submit-images
@@ -441,6 +487,25 @@
 		    return false;
     }
     return this.myFacesPPRCtrl.ajaxSubmitFunction(this);
+}
+
+org.apache.myfaces.PPRCtrl.prototype.elementOnPeriodicalEventHandler = function(_event) {
+    if (_event.target.oam_periodicalStarted) {
+        return false;
+    }
+    else {
+        var zoneIds = window.oamPartialTriggersToZoneIds[_event.target.id];
+        if (!zoneIds) return false;
+
+        var zones = zoneIds.split(",");
+        for (var i = 0; i < zones.length; i++) {
+            var zoneId = zones[i];
+            var timeout = window.oamRefreshTimeoutForZoneId[zoneId];
+            if (!timeout) return false;
+            this.startPeriodicalUpdate(timeout, zoneId);
+            _event.target.oam_periodicalStarted = true;
+        }
+    }
 }
 
 //Based on the Component which triggerd the submit this Method returns a comma-seperated

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/tld/myfaces_sandbox.tld
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/tld/myfaces_sandbox.tld?view=diff&rev=550632&r1=550631&r2=550632
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/tld/myfaces_sandbox.tld (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/tld/myfaces_sandbox.tld Mon Jun 25 15:52:54
2007
@@ -1289,6 +1289,14 @@
             </description>
         </attribute>
         <attribute>
+			<name>periodicalTriggers</name>
+			<required>false</required>
+			<rtexprvalue>false</rtexprvalue>
+            <description>If a periodicalUpdate is set this trigger starts the periodical
requests.
+                         No partialTriggers are needed.
+            </description>
+        </attribute>
+        <attribute>
 			<name>showDebugMessages</name>
 			<required>false</required>
 			<rtexprvalue>false</rtexprvalue>

Added: myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/dojodialog/DojoDialogBean.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/dojodialog/DojoDialogBean.java?view=auto&rev=550632
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/dojodialog/DojoDialogBean.java
(added)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/dojodialog/DojoDialogBean.java
Mon Jun 25 15:52:54 2007
@@ -0,0 +1,37 @@
+package org.apache.myfaces.examples.dojodialog;
+
+/**
+ * @author Martin Marinschek
+ */
+public class DojoDialogBean {
+
+    private int progress=-1;
+
+    public boolean isActionRunning() {
+        return progress>=0&&progress<14;
+    }
+
+
+    public int getProgress() {
+        return progress;
+    }
+
+    public String startAction() {
+        Thread thread = new Thread(new Runnable() {
+
+            public void run() {
+                try {
+                    for(progress=0; progress<15; progress++) {
+                        Thread.sleep(900);
+                    }
+                } catch (InterruptedException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        });
+
+        thread.start();
+
+        return null;
+    }
+}

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml?view=diff&rev=550632&r1=550631&r2=550632
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml Mon
Jun 25 15:52:54 2007
@@ -34,6 +34,15 @@
         <managed-bean-scope>request</managed-bean-scope>
     </managed-bean>
 
+
+    <!-- managed bean for singleRowSelectList-->
+
+    <managed-bean>
+        <managed-bean-name>dojoDialogBean</managed-bean-name>
+        <managed-bean-class>org.apache.myfaces.examples.dojodialog.DojoDialogBean</managed-bean-class>
+        <managed-bean-scope>session</managed-bean-scope>
+    </managed-bean>
+
     <!-- managed bean for singleRowSelectList-->
 
     <managed-bean>

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/dojo/dojoDialog.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/dojo/dojoDialog.jsp?view=diff&rev=550632&r1=550631&r2=550632
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/dojo/dojoDialog.jsp (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/dojo/dojoDialog.jsp Mon Jun 25
15:52:54 2007
@@ -1,174 +1,204 @@
-<%@ page session="false" contentType="text/html;charset=iso-8859-1"%>
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
-<%@ taglib uri="http://myfaces.apache.org/sandbox" prefix="s"%>
+<%@ page session="false" contentType="text/html;charset=iso-8859-1" %>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
+<%@ taglib uri="http://myfaces.apache.org/sandbox" prefix="s" %>
 <html>
-	<head>
-		<meta http-equiv="Content-Type"
-			content="text/html; charset=iso-8859-1" />
-		<link type="text/css" rel="stylesheet" href="/css/basic.css" />
-		 <style type="text/css">
-        	.dojoDialog {
-	            background : #eee;
-	            border : 1px solid #999;
-	            -moz-border-radius : 5px;
-	            padding : 4px;
-	            /*positioning outside of the visible scope to prevent some ui glitches visibility
hidden does not work*/
-	            position:absolute;
-	            left: -800px;
-	            top: -800px;
-	        }
-
-			.viewDialog {
-				background : #eee;
-				border : 1px solid #999;
-				-moz-border-radius : 5px;
-				padding : 4px;
-				/*positioning outside of the visible scope to prevent some ui glitches visibility hidden
does not work*/
-				position:absolute;
-				left: -800px;
-				top: -800px;
-			}
-
-			.viewDialogDecoration {
-				width: 600px;
-			}
-
-			.viewDialogContent {
-				width: 600px;
-				height: 500px;
-			}
-
-		</style>
-	</head>
-	<body>
-		<f:view>
-
-			<h:panelGrid columns="2" style="width:700px;">
-				<h:outputLabel value="Email" for="email1" styleClass="label" />
-				<h:panelGrid columns="4" width="180">
-					<t:inputText id="email1" value="Test" forceId="true" size="30" />
-					<f:verbatim>&#160;</f:verbatim>
-					<t:message for="email1" />
-					<h:outputLink value="#"
-						onclick="dojoDialog.show();document.getElementById('filter1').focus();">
-						<h:outputText value="search" />
-					</h:outputLink>
-				</h:panelGrid>
-			</h:panelGrid>
-			<h:panelGrid columns="2" style="width:700px;">
-				<h:outputLabel value="Email" for="email2" styleClass="label" />
-				<h:panelGrid columns="4" width="180">
-					<t:inputText id="email2" value="Test" forceId="true" size="30" />
-					<f:verbatim>&#160;</f:verbatim>
-					<t:message for="email2" />
-					<h:outputLink value="#"
-						onclick="dojoDialog.show();document.getElementById('filter2').focus();">
-						<h:outputText value="search" />
-					</h:outputLink>
-				</h:panelGrid>
-			</h:panelGrid>
-			<h:panelGrid columns="2" style="width:700px;">
-				<h:outputLabel value="Email" for="email3" styleClass="label" />
-				<h:panelGrid columns="4" width="180">
-					<t:inputText id="email3" value="Test" forceId="true" size="30" />
-					<f:verbatim>&#160;</f:verbatim>
-					<t:message for="email3" />
-					<h:outputLink value="#"
-						onclick="dojoDialog.show();document.getElementById('filter3').focus();">
-						<h:outputText value="search" />
-					</h:outputLink>
-					<h:outputLink value="#" onclick="dojoDialogOuterform.show();">
-						<h:outputText value="searchOuterForm" />
-					</h:outputLink>
-
-				</h:panelGrid>
-			</h:panelGrid>
-
-			<h:panelGrid columns="3">
-
-				<t:outputText value="Show dialog using another view in its content" />
-
-				<h:outputLink value="#"
-					onclick="viewDialog.show();">
-					<h:outputText value="open dialog" />
-				</h:outputLink>
-
-				<h:form>
-					<h:commandButton id="dismissAction" value="action after dismiss" />
-				</h:form>
-
-			</h:panelGrid>
-
-			<s:modalDialog dialogId="DialogContent" dialogVar="dojoDialog"
-				dialogAttr="bgColor='white' bgOpacity='0.5' toggle='fade' toggleDuration='250'"
-				hiderIds="cancel1,cancel2,cancel3" styleClass="dojoDialog">
-				<h:panelGrid columns="1">
-					<h:panelGrid columns="2">
-						<t:inputText id="filter1" forceId="true" value="Test" size="25" />
-						<t:commandButton id="cancel1" forceId="true" value="Cancel"
-							onclick="dojo.widget.byId('DialogContent').hide();" />
-					</h:panelGrid>
-					<h:panelGrid columns="2">
-						<t:inputText id="filter2" forceId="true" value="Test" size="25" />
-						<t:commandButton id="cancel2" forceId="true" value="Cancel"
-							onclick="dojo.widget.byId('DialogContent').hide();" />
-					</h:panelGrid>
-					<h:panelGrid columns="2">
-						<t:inputText id="filter3" forceId="true" value="Test" size="25" />
-						<t:commandButton id="cancel3" forceId="true" value="Cancel"
-							onclick="dojo.widget.byId('DialogContent').hide();" />
-					</h:panelGrid>
-				</h:panelGrid>
-			</s:modalDialog>
-
-			<s:modalDialog dialogId="FormDialog" dialogVar="dojoDialogOuterform"
-				dialogAttr="bgColor='white' bgOpacity='0.5' toggle='fade' toggleDuration='250'"
-				styleClass="dojoDialog">
-				<h:form id="dialogform">
-
-					<h:panelGrid columns="1">
-						<h:panelGrid columns="2">
-							<t:inputText id="filter1Outerform" forceId="true" value="Test"
-								size="25" />
-							<t:commandButton id="cancel1Outerform" forceId="true"
-								value="Cancel" onclick="dojo.widget.byId('FormDialog').hide();" />
-						</h:panelGrid>
-						<h:panelGrid columns="2">
-							<t:inputText id="filter2Outerform" forceId="true" value="Test"
-								size="25" />
-							<t:commandButton id="cancel2Outerform" forceId="true"
-								value="Cancel" onclick="dojo.widget.byId('FormDialog').hide();" />
-						</h:panelGrid>
-						<h:panelGrid columns="2">
-							<t:inputText id="filter3Outerform" forceId="true" value="Test"
-								size="25" />
-							<t:commandButton id="cancel3Outerform" forceId="true"
-								value="Cancel" onclick="dojo.widget.byId('FormDialog').hide();" />
-						</h:panelGrid>
-						<h:commandLink id="outerformsubmit">
-							<h:outputFormat value="Submit" />
-						</h:commandLink>
-					</h:panelGrid>
-				</h:form>
-			</s:modalDialog>
-
-
-			<s:modalDialog
-				dialogId="viewDialog"
-				dialogVar="viewDialog"
-				styleClass="viewDialog"
-				dialogTitle="ViewId Dialog"
-				closeButton="true"
-				viewId="dojo/dojoDialogView.jsf">
-
-				<s:submitOnEvent event="dialogok" for="dismissAction" />
-
-			</s:modalDialog>
-
-	  <%@ include file="../inc/page_footer.jsp"%>
-
-		</f:view>
-	</body>
-</html>
+<head>
+   <meta http-equiv="Content-Type"
+         content="text/html; charset=iso-8859-1"/>
+   <link type="text/css" rel="stylesheet" href="/css/basic.css"/>
+   <style type="text/css">
+       .dojoDialog {
+           background: #eee;
+           border: 1px solid #999;
+           -moz-border-radius: 5px;
+           padding: 4px; /*positioning outside of the visible scope
+to prevent some ui glitches visibility hidden does not work*/
+           position: absolute;
+           left: -800px;
+           top: -800px;
+       }
+
+       .viewDialog {
+           background: #eee;
+           border: 1px solid #999;
+           -moz-border-radius: 5px;
+           padding: 4px; /*positioning outside of the visible scope
+to prevent some ui glitches visibility hidden does not work*/
+           position: absolute;
+           left: -800px;
+           top: -800px;
+       }
+
+       .viewDialogDecoration {
+           width: 600px;
+       }
+
+       .viewDialogContent {
+           width: 600px;
+           height: 500px;
+       }
+
+   </style>
+</head>
+<body>
+<f:view>
+
+<h:form id="form">
+
+<h:panelGrid columns="2" style="width:700px;">
+   <h:outputLabel value="Email" for="email1" styleClass="label"/>
+   <h:panelGrid columns="4" width="180">
+       <t:inputText id="email1" value="Test" forceId="true" size="30"/>
+       <f:verbatim>&#160;</f:verbatim>
+       <t:message for="email1"/>
+       <h:outputLink value="#" onclick="dojoDialog.show();document.getElementById('filter1').focus();">
+           <h:outputText value="search"/>
+       </h:outputLink>
+   </h:panelGrid>
+</h:panelGrid>
+<h:panelGrid columns="2" style="width:700px;">
+   <h:outputLabel value="Email" for="email2" styleClass="label"/>
+   <h:panelGrid columns="4" width="180">
+       <t:inputText id="email2" value="Test" forceId="true" size="30"/>
+       <f:verbatim>&#160;</f:verbatim>
+       <t:message for="email2"/>
+       <h:outputLink value="#" onclick="dojoDialog.show();document.getElementById('filter2').focus();">
+           <h:outputText value="search"/>
+       </h:outputLink>
+   </h:panelGrid>
+</h:panelGrid>
+<h:panelGrid columns="2" style="width:700px;">
+   <h:outputLabel value="Email" for="email3" styleClass="label"/>
+   <h:panelGrid columns="4" width="180">
+       <t:inputText id="email3" value="Test" forceId="true" size="30"/>
+       <f:verbatim>&#160;</f:verbatim>
+       <t:message for="email3"/>
+       <h:outputLink value="#" onclick="dojoDialog.show();document.getElementById('filter3').focus();">
+           <h:outputText value="search"/>
+       </h:outputLink>
+       <h:outputLink value="#" onclick="dojoDialogOuterform.show();">
+           <h:outputText value="searchOuterForm"/>
+       </h:outputLink>
+
+   </h:panelGrid>
+</h:panelGrid>
+
+<h:panelGrid columns="3">
+
+   <t:outputText value="Show dialog using another view in its content"/>
+
+   <h:outputLink value="#"
+                 onclick="viewDialog.show();">
+       <h:outputText value="open dialog"/>
+   </h:outputLink>
+
+   <h:commandButton id="dismissAction" value="action after dismiss"/>
+
+</h:panelGrid>
+
+<s:modalDialog dialogId="DialogContent" dialogVar="dojoDialog"
+              dialogAttr="bgColor='white' bgOpacity='0.5' toggle='fade' toggleDuration='250'"
+              hiderIds="cancel1,cancel2,cancel3" styleClass="dojoDialog">
+   <h:panelGrid columns="1">
+       <h:panelGrid columns="2">
+           <t:inputText id="filter1" forceId="true" value="Test" size="25"/>
+           <t:commandButton id="cancel1" forceId="true" value="Cancel" onclick="dojo.widget.byId('DialogContent').hide();"/>
+       </h:panelGrid>
+       <h:panelGrid columns="2">
+           <t:inputText id="filter2" forceId="true" value="Test" size="25"/>
+           <t:commandButton id="cancel2" forceId="true" value="Cancel" onclick="dojo.widget.byId('DialogContent').hide();"/>
+       </h:panelGrid>
+       <h:panelGrid columns="2">
+           <t:inputText id="filter3" forceId="true" value="Test" size="25"/>
+           <t:commandButton id="cancel3" forceId="true" value="Cancel"
+ onclick="dojo.widget.byId('DialogContent').hide();"/>
+       </h:panelGrid>
+   </h:panelGrid>
+</s:modalDialog>
+
+<s:modalDialog dialogId="FormDialog" dialogVar="dojoDialogOuterform"
+              dialogAttr="bgColor='white' bgOpacity='0.5' toggle='fade' toggleDuration='250'"
+              styleClass="dojoDialog">
+
+   <h:panelGrid columns="1">
+       <h:panelGrid columns="2">
+           <t:inputText id="filter1Outerform" forceId="true" value="Test"
+                        size="25"/>
+           <t:commandButton id="cancel1Outerform" forceId="true"
+                            value="Cancel" onclick="dojo.widget.byId('FormDialog').hide();"/>
+       </h:panelGrid>
+       <h:panelGrid columns="2">
+           <t:inputText id="filter2Outerform" forceId="true" value="Test"
+                        size="25"/>
+           <t:commandButton id="cancel2Outerform" forceId="true"
+                            value="Cancel" onclick="dojo.widget.byId('FormDialog').hide();"/>
+       </h:panelGrid>
+       <h:panelGrid columns="2">
+           <t:inputText id="filter3Outerform" forceId="true" value="Test"
+                        size="25"/>
+           <t:commandButton id="cancel3Outerform" forceId="true"
+                            value="Cancel" onclick="dojo.widget.byId('FormDialog').hide();"/>
+       </h:panelGrid>
+       <h:commandLink id="outerformsubmit">
+           <h:outputFormat value="Submit"/>
+       </h:commandLink>
+   </h:panelGrid>
+</s:modalDialog>
+
+
+<s:modalDialog
+       dialogId="viewDialog"
+       dialogVar="viewDialog"
+       styleClass="viewDialog"
+       dialogTitle="ViewId Dialog"
+       closeButton="true"
+       viewId="dojo/dojoDialogView.jsf">
+
+   <s:submitOnEvent event="dialogok" for="dismissAction"/>
+
+</s:modalDialog>
+
+
+<h:outputLink value="#" onclick="updatedDojoDialog.show();">
+   <h:outputText value="Updated Dialog"/>
+</h:outputLink>
+
+<s:modalDialog dialogId="updatedDialogContent"
+dialogVar="updatedDojoDialog"
+              dialogAttr="bgColor='white' bgOpacity='0.5' "
+              hiderIds="cancel1" styleClass="dojoDialog">
+
+   <h:panelGrid columns="1">
+       <t:outputText id="msg" forceId="true"
+                     value="Berechnung kann einige Minuten dauern, wollen Sie trotzdem fortsetzen?"/>
+       <t:commandButton id="cancel1" value="Cancel"
+                        styleClass="Btn2" onclick="dojo.widget.byId('updatedDialogContent').hide();"/>
+       <t:commandButton id="ok1" value="OK" styleClass="Btn2" immediate="true"
+                        action="#{dojoDialogBean.startAction}"/>
+
+
+       <s:pprPanelGroup id="periodicalUpdatedArea"
+                        periodicalUpdate="1000"
+                        periodicalTriggers="ok1">
+           <h:panelGrid columns="1"
+                        style="width:300px;height:100px;text-align:center;">
+               <t:outputText forceId="true" value="Berechnung lauft. Bitte warten... #{dojoDialogBean.progress}"
+                             rendered="#{dojoDialogBean.actionRunning}"/>
+               <t:outputText forceId="true" value="Berechnung beendet..."
+                             rendered="#{!dojoDialogBean.actionRunning && dojoDialogBean.progress>0}"/>
+           </h:panelGrid>
+       </s:pprPanelGroup>
+
+   </h:panelGrid>
+</s:modalDialog>
+
+
+<%@ include file="../inc/page_footer.jsp" %>
+
+</h:form>
+
+</f:view>
+</body>
+</html>
\ No newline at end of file



Mime
View raw message