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/18 05:48:20 UTC

svn commit: r465151 - in /incubator/xap/trunk/WebContent/examples/widgets: textArea.html textArea.xal

Author: mturyn
Date: Tue Oct 17 22:48:18 2006
New Revision: 465151

URL: http://svn.apache.org/viewvc?view=rev&rev=465151
Log:
Altered so that the title is set in the XAL document using xmodify to append a script tag.

Modified:
    incubator/xap/trunk/WebContent/examples/widgets/textArea.html
    incubator/xap/trunk/WebContent/examples/widgets/textArea.xal

Modified: incubator/xap/trunk/WebContent/examples/widgets/textArea.html
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/textArea.html?view=diff&rev=465151&r1=465150&r2=465151
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/textArea.html (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/textArea.html Tue Oct 17 22:48:18 2006
@@ -3,7 +3,8 @@
 <html>
 <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-    <title>Button</title>
+
+	<title>Dummy title:</title>
 
 	<style type="text/css">
       <!--
@@ -19,11 +20,25 @@
 	</script>    
 	
 	<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="AttributeTester.js"></script>
+    
+    
+	<script language="JavaScript">
+   		Xap._sourceRootDir = "../../" ; 	
+		Xap.addDebuggables(		
+							"xap.widgets.dojo.TextArea",
+							"xap.bridges.dojo.TextAreaBridge",
+							"xap.bridges.dojo.DojoWidgetBridge",
+							"xap.xml.xmodify.CommandDirective"																
+							) ;
+		Xap._loadDebuggables() ;
+	</script>    
+    
+    
     
- </head>
+	</head>
   
- <body  onload="Xap.createAllPredefinedSessions();">
-	<div xapId="ButtonExample" xapSrc="textArea.xal" xapToolkit="dojo" xapContext="../../"></div>
-</body>
+	<body  onload="Xap.createAllPredefinedSessions();">
+		<div xapId="ButtonExample" xapSrc="textArea.xal" xapToolkit="dojo" xapContext="../../"></div>
+	</body>
 </html>

Modified: incubator/xap/trunk/WebContent/examples/widgets/textArea.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/textArea.xal?view=diff&rev=465151&r1=465150&r2=465151
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/textArea.xal (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/textArea.xal Tue Oct 17 22:48:18 2006
@@ -1,4 +1,7 @@
-<xal xmlns="http://www.openxal.org/xal" xmlns:xal="http://www.openxal.org/xal"> 
+<xal xmlns="http://www.openxal.org/xal" 
+	xmlns:xal="http://www.openxal.org/xal"
+	xmlns:xm="http://www.openxal.org/xmodify"	
+> 
 
 
 	<mco:mco 
@@ -8,28 +11,77 @@
 	/>
 
 
-
-	<xm:modifications xmlns:xm="http://www.openxal.org/xmodify">
-	<xm:append select="/xal">
+	<!-- Page title -->
+	<xm:modifications document="html">
 	
-		<xal:textArea width="200px" text="A text field"
-		id="testComponent" onEdit="mco:attributeSetter.reportEvent(event)"
-		/>
-		
-		
-		<!-- button specific properties -->
-		<xal:button width="200px" height="25px" 
-			text="text -> 'some new text'"
-			onCommand="mco:attributeSetter.setAttribute(testComponent,
-				'text','some new text')"/>
-				
-		
+		<!-- 
+			All of the below seem to to change the HTML DOM, but
+			window doesn't seem to find out about it---a web search 
+			indicates that title setting just doesn't work using direct 
+			manipulation of	the DOM...
+		-->	
+	
+		<!--  Don't use 'replace' in case there's no title to start-with: -->
+        <!--  xm:remove-element select="//HTML/HEAD/TITLE"/ -->	
+		<!--  xm:append select="//HTML/HEAD">
+				<title>Text area testt:</title>
+		</xm:append  -->	
+		<!--  xm:replace select="//HTML/HEAD/TITLE">
+				<title>Text area testttt:</title>
+		</xm:replace -->
 		
-		<!--standard test things -->
+		<xm:append select="//HTML/HEAD">
+			<script> document.title="Text area tests:";</script>
+		</xm:append>
+		<!--  
+			Anybody know a way of forcing (in effect)
+			an invalidation that would make the window
+			look again to the DOM?
+		-->		
 		
-				
-		<include href="standardButtons.xal" xmlns="http://www.openxal.org/xinclude"/>
+	</xm:modifications>
 
-	</xm:append> 	  		
+	<xm:modifications>
+		<xm:append select="/xal">
+		
+			<xal:textArea width="200px" text="A text field"
+			id="testComponent" onEdit="mco:attributeSetter.reportEvent(event)"
+			/>
+			
+			
+			<!-- button specific properties -->
+			<xal:button width="200px" height="25px" 
+				text="text -> 'some new text'"
+				onCommand="mco:attributeSetter.setAttribute(testComponent,
+					'text','some new text')"/>
+					
+			<xal:button width="200px" height="25px" 
+				text="Limit to 8 chars."
+				onCommand="mco:attributeSetter.setAttribute(testComponent,
+					'maxLength','8')"/>			
+					
+			<xal:button width="200px" height="25px" 
+				text="...255 chars."
+				onCommand="mco:attributeSetter.setAttribute(testComponent,
+					'maxLength','255')"/>								
+			<xal:button width="200px" height="25px" 
+				text="Selectability ON"
+				onCommand="mco:attributeSetter.setAttribute(testComponent,
+					'selectable', 'true')"/>
+			<xal:button width="200px" height="25px" 
+				text="Selectability OFF" 
+				onCommand="mco:attributeSetter.setAttribute(testComponent,
+					'selectable','false')"/>
+					
+			<xal:button width="200px" height="25px" 
+				text="Toggle editability"
+				onCommand="mco:attributeSetter.toggleBooleanAttribute(testComponent,
+					'editable')"/>				
+			
+			<!--standard test things -->
+			
+					
+			<include href="standardButtons.xal" xmlns="http://www.openxal.org/xinclude"/>
+		</xm:append> 	  		
   	</xm:modifications>
 </xal>