You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by mt...@apache.org on 2006/10/11 21:59:43 UTC

svn commit: r462986 - in /incubator/xap/trunk/WebContent/examples/dataBinding: Employees.js javascriptDatasource.html javascriptDatasource.xal plus.gif rarrow.gif

Author: mturyn
Date: Wed Oct 11 14:59:41 2006
New Revision: 462986

URL: http://svn.apache.org/viewvc?view=rev&rev=462986
Log:
Trying to better explain what's going on in the select statements.

Added:
    incubator/xap/trunk/WebContent/examples/dataBinding/plus.gif   (with props)
    incubator/xap/trunk/WebContent/examples/dataBinding/rarrow.gif   (with props)
Modified:
    incubator/xap/trunk/WebContent/examples/dataBinding/Employees.js
    incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.html
    incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.xal

Modified: incubator/xap/trunk/WebContent/examples/dataBinding/Employees.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dataBinding/Employees.js?view=diff&rev=462986&r1=462985&r2=462986
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dataBinding/Employees.js (original)
+++ incubator/xap/trunk/WebContent/examples/dataBinding/Employees.js Wed Oct 11 14:59:41 2006
@@ -29,7 +29,7 @@
 	if(!offset){
 		offset = 0 ;
 	}
-	return ""+(offset+((3+anIndex)*50))+"px" ;
+	return ""+(40+offset+((3+anIndex)*50))+"px" ;
 }
 
 Employees.computeX= function(anIndex, offset){
@@ -40,7 +40,7 @@
 }
 
 Employees.prototype.second = function(){
-	return "The second slot in this array will give us: "
+	return "Second slot: "
 			+Employees.array[1]+"." ;
 }
 

Modified: incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.html
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.html?view=diff&rev=462986&r1=462985&r2=462986
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.html (original)
+++ incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.html Wed Oct 11 14:59:41 2006
@@ -27,7 +27,7 @@
 mask forgetting a .require(<className>) in the code:
 -->
 
-    <!--  script language="JavaScript" type="text/javascript">
+    <script language="JavaScript" type="text/javascript">
 
     	Xap._sourceRootDir = "../../" ; 	
 		Xap.addDebuggables(		
@@ -54,11 +54,12 @@
 							"xap.taghandling.AbstractTagImpl",							
 							"xap.taghandling.AttributeConverter",
 							"xap.xml.dom.Document",
+							"xap.xml.sax.SaxParser",
 							"xap.Xap"																							
 							) ;
 		Xap._loadDebuggables() ;
 							
-	</script -->							
+	</script>							
 
 	</head>
 

Modified: incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.xal?view=diff&rev=462986&r1=462985&r2=462986
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.xal (original)
+++ incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.xal Wed Oct 11 14:59:41 2006
@@ -12,7 +12,7 @@
 	<binding 
 		xmlns="http://www.openxal.org/data"
 		dataSource="myDataSource" 
-		select="<currentElement>.second()" 
+		select="&lt;currentElement&gt;.second()" 
 		id="SECOND"
 	/>	
 
@@ -40,19 +40,38 @@
 		
 			<xal:label 
 				y="50px"
-				x="25px"
-				width="280px" 
 				height="40px"
+								
+				x="15px"
+				width="250px" 
+				
 				alignHorizontal="center"
 				backgroundColor="#ddddff" 				
-				text=" {bind(binding:SECOND)} "
+				text="select=&quot;&lt;currentElement&gt;.second()&quot; 	 "				
 			/>
-		
+			
+			<xal:label img="plus.gif"  x="270px" width="25px"   y="50px" height="40px"  alignHorizontal="left"/>			
+			
+			<xal:label 
+				y="50px"
+				height="40px"
+				
+				x="290px"
+				width="450px" 
+				
+				alignVertical="middle"
+				alignHorizontal="center"
+				backgroundColor="#ddddff" 				
+				text="Employees.second()=return &quot;Second slot: &quot;+Employees.array[1]+&quot;.&quot; ;"
+			/>			
+				
+			<xal:label img="rarrow.gif"  x="740px" width="35px" y="50px" height="40px"  alignHorizontal="center" />
+				
 			<xal:label 				
 				y="50px"
-				x="330px"			
-				width="590px" 			
-				height="40px"			
+				height="40px"		
+				x="775px"			
+				width="200px" 			
 				backgroundColor="#ffdddd"			
 				alignHorizontal="center"			
 				text="{bind(binding:SECOND)}"			
@@ -65,48 +84,73 @@
 				x="0px"
 				width="990px" 
 				height="40px"
-				backgroundColor="#b0a0b0"						
-				text="[iteration starts]"
+				backgroundColor="#b0a0b0"		
+				alignVertical="middle"				
+				text="[iteration starts] "
 			/>
+			<xal:label 
+				y="150px"
+				x="5px"
+				width="300px" 
+				height="30px"
+				backgroundColor="#d0d0f0"						
+				text=" &quot;Iteration &quot;+&lt;currentCount&gt;+&quot; of   &quot;+&lt;totalCount&gt;"
+			/>			
+			<xal:label 
+				y="150px"
+				x="400px"
+				width="120px" 
+				height="30px"
+				backgroundColor="#d0d0f0"						
+				text="&lt;currentIndex&gt;"
+			/>			
+			<xal:label 
+				y="150px"
+				x="590px"
+				width="340px" 
+				height="30px"
+				backgroundColor="#d0d0f0"						
+				text="&lt;currentElement&gt;.lname+&quot;, &quot;+&lt;currentElement&gt;.fname"
+			/>									
 		
 <!-- Iterator -->
 				<iterator 
 					xmlns="http://www.openxal.org/data" 
 					name="anIterator" 
 					dataSource="myDataSource" 
-					select="<currentElement>.theArray()" 
+					select="&lt;currentElement&gt;.theArray()" 
 					type="ONE_WAY"
 				>
 
 					<xal:label 
-						y="{*('Employees.computeY(<currentIndex>)')}"
+						y="{*('Employees.computeY(&lt;currentIndex&gt;)')}"
 						x="20px"			
 						width="292px" 			
 						height="40px"				
 						backgroundColor="{mco:layout.nextColour()}"
 						alignHorizontal="center" 
-						text="{*('&quot;Iteration &quot;+<currentCount>+&quot; of   &quot;+<totalCount>+&quot;.&quot;')}"
+						text="{*('&quot;Iteration &quot;+&lt;currentCount&gt;+&quot; of   &quot;+<totalCount>+&quot;.&quot;')}"
 					/>
 
 
 					<xal:label 
-						y="{*('Employees.computeY(<currentIndex>)')}"
+						y="{*('Employees.computeY(&lt;currentIndex&gt;)')}"
 						x="318px"		
 						width="288px" 			
 						height="40px"				
 						backgroundColor="{mco:layout.thisColour()}"
 						alignHorizontal="center" 
-						text="{*('<currentElement>.id')}"
+						text="{*('&lt;currentElement&gt;.id')}"
 					/>
 					
 					<xal:label 
-						y="{*('Employees.computeY(<currentIndex>)')}"
+						y="{*('Employees.computeY(&lt;currentIndex&gt;)')}"
 						x="612px"			
 						width="290px" 			
 						height="40px"				
 						backgroundColor="{mco:layout.thisColour()}" 
-						alignHorizontal="left" 
-						text="{*('&quot;. . . &quot;+<currentElement>.lname+&quot;, &quot;+<currentElement>.fname')}"
+						alignHorizontal="center"
+						text="{*('&lt;currentElement&gt;.lname+&quot;, &quot;+&lt;currentElement&gt;.fname')}"
 					/>					
 					
 				</iterator>				
@@ -115,9 +159,9 @@
 					id="iterStopLabel"
 					width="990px" 
 					height="40px"
-					y="600px"
+					y="650px"
 					backgroundColor="#b0a0b0"
-					textAlign="center"						
+					alignHorizontal="center"						
 					text="[iteration ends]"
 				/>	
 								
@@ -129,7 +173,7 @@
 			width="990px" 
 			height="40px"
 			backgroundColor="#b0a0b0"
-			textAlign="center"						
+			alignHorizontal="center"						
 			text="[iteration ends]"
 		/ -->						
 				

Added: incubator/xap/trunk/WebContent/examples/dataBinding/plus.gif
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dataBinding/plus.gif?view=auto&rev=462986
==============================================================================
Binary file - no diff available.

Propchange: incubator/xap/trunk/WebContent/examples/dataBinding/plus.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/xap/trunk/WebContent/examples/dataBinding/rarrow.gif
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dataBinding/rarrow.gif?view=auto&rev=462986
==============================================================================
Binary file - no diff available.

Propchange: incubator/xap/trunk/WebContent/examples/dataBinding/rarrow.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream