incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmarga...@apache.org
Subject svn commit: r448442 - in /incubator/xap/trunk/WebContent/examples/widgets: TableMco.js table.html table.xal
Date Thu, 21 Sep 2006 03:11:19 GMT
Author: jmargaris
Date: Wed Sep 20 20:11:18 2006
New Revision: 448442

URL: http://svn.apache.org/viewvc?view=rev&rev=448442
Log:
Table test reformatted with new functionalty

Added:
    incubator/xap/trunk/WebContent/examples/widgets/TableMco.js   (with props)
Modified:
    incubator/xap/trunk/WebContent/examples/widgets/table.html
    incubator/xap/trunk/WebContent/examples/widgets/table.xal

Added: incubator/xap/trunk/WebContent/examples/widgets/TableMco.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/TableMco.js?view=auto&rev=448442
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/TableMco.js (added)
+++ incubator/xap/trunk/WebContent/examples/widgets/TableMco.js Wed Sep 20 20:11:18 2006
@@ -0,0 +1,26 @@
+function TableMco() { }
+
+TableMco.prototype = new Object() ;
+
+TableMco.prototype.startUpdates = function( tableElement ){
+	window.tableElement = tableElement;
+	window.intervalId = window.setInterval('tableMcoUpdate()',1000);
+}
+
+TableMco.prototype.stopUpdates= function( ){
+	if (window.intervalId){
+		window.clearInterval(window.intervalId);
+	}
+}
+
+tableMcoUpdate = function( ){
+	var tableElement = window.tableElement;
+	for (var i = 0; i<tableElement.childNodes.length; i++){
+		var row = tableElement.childNodes[i];
+		if (row.nodeName!=="row") continue;
+		
+		if (row.childNodes.length>1){
+			row.childNodes[1].setAttribute("text", "" + (new Date()).getTime());
+		}
+	}
+}
\ No newline at end of file

Propchange: incubator/xap/trunk/WebContent/examples/widgets/TableMco.js
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/xap/trunk/WebContent/examples/widgets/table.html
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/table.html?view=diff&rev=448442&r1=448441&r2=448442
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/table.html (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/table.html Wed Sep 20 20:11:18 2006
@@ -19,6 +19,7 @@
 	
 	<script language="JavaScript" type="text/javascript" src="../../xapcore.js"></script>
   <script language="JavaScript" type="text/javascript" src="AttributeTester.js"></script>
+  <script language="JavaScript" type="text/javascript" src="TableMco.js"></script>
     
  </head>
   

Modified: incubator/xap/trunk/WebContent/examples/widgets/table.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/table.xal?view=diff&rev=448442&r1=448441&r2=448442
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/table.xal (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/table.xal Wed Sep 20 20:11:18 2006
@@ -6,6 +6,12 @@
 		id="attributeSetter" 
 		src="AttributeTester"
 	/>
+	
+	<mco:mco 
+		xmlns:mco="http://www.openxal.org/mco" 
+		id="tableMco" 
+		src="TableMco"
+	/>
 
 
 
@@ -13,8 +19,9 @@
 	<xm:append select="/xal">
 	
 
-	
+	<horizontalPanel>
 
+	<verticalPanel>
 	<table id="testComponent" width="200px" height="100px">
 		<column><header text="Column 1"/></column>
 		<column><header text="Column 2"/></column>
@@ -36,40 +43,18 @@
 		</row>
 	</table>
 
-		<button width="200px" height="50px" alignHorizontal="center" alignVertical="center"
text="Hello World!" 
-		 onCommand="mco:attributeSetter.setAttribute(testComponent, 'text', 'Hello World!!!')"
/>
-		 
-		<button width="200px" height="50px" alignHorizontal="center" alignVertical="center"
text="Hear me roar!" 
-		 onCommand="mco:attributeSetter.setAttribute(testComponent, 'text', 'Hear me roar!!!')"
/>		 
-		 
-		<button width="200px" height="50px" alignHorizontal="center" alignVertical="center"
text="textPlacementVertical = top" 
-		 onCommand="mco:attributeSetter.setAttribute(testComponent, 'textPlacementVertical', 'top')"
/>	
-
-		<button width="200px" height="50px" alignHorizontal="center" alignVertical="center"
text="textPlacementVertical = bottom" 
-		 onCommand="mco:attributeSetter.setAttribute(testComponent, 'textPlacementVertical', 'bottom')"
/>	
-
-		<button width="200px" height="50px" alignHorizontal="center" alignVertical="center"
text="alignHorizontal = left" 
-		 onCommand="mco:attributeSetter.setAttribute(testComponent, 'alignHorizontal', 'left')"
/>	
-
-		<button width="200px" height="50px" alignHorizontal="center" alignVertical="center"
text="alignHorizontal = center" 
-		 onCommand="mco:attributeSetter.setAttribute(testComponent, 'alignHorizontal', 'center')"
/>	
-
-		<button width="200px" height="50px" alignHorizontal="center" alignVertical="center"
text="alignHorizontal = right" 
-		 onCommand="mco:attributeSetter.setAttribute(testComponent, 'alignHorizontal', 'right')"
/>
+		<button width="200px" height="50px" alignHorizontal="center" alignVertical="center"
text="Start table updating" 
+		 onCommand="mco:tableMco.startUpdates(testComponent)" />
 		 
-		<button width="200px" height="50px" alignHorizontal="center" alignVertical="center"
text="alignVertical = top" 
-		 onCommand="mco:attributeSetter.setAttribute(testComponent, 'alignVertical', 'top')" />

-
-		<button width="200px" height="50px" alignHorizontal="center" alignVertical="center"
text="alignVertical = center" 
-		 onCommand="mco:attributeSetter.setAttribute(testComponent, 'alignVertical', 'center')"
/>	
-
-		<button width="200px" height="50px" alignHorizontal="center" alignVertical="center"
text="alignVertical = bottom" 
-		 onCommand="mco:attributeSetter.setAttribute(testComponent, 'alignVertical', 'bottom')"
/>
+		<button width="200px" height="50px" alignHorizontal="center" alignVertical="center"
text="Stop table updating" 
+		 onCommand="mco:tableMco.stopUpdates(testComponent)" />
 		 
+	
 		 
+		 </verticalPanel> 
 		<include href="standardButtons.xal" xmlns="http://www.openxal.org/xinclude"/>
 		 
-		 
+		 </horizontalPanel>
 		
 	</xm:append> 	  		
   	</xm:modifications>



Mime
View raw message