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/09/08 21:06:26 UTC

svn commit: r441650 - in /incubator/xap/trunk: WebContent/examples/dataBinding/AttributeGetter.js WebContent/examples/dataBinding/mcoAttribute.html WebContent/examples/dataBinding/mcoAttribute.xal src/xap/resolver/AttributeResolutionHandler.js

Author: mturyn
Date: Fri Sep  8 14:06:25 2006
New Revision: 441650

URL: http://svn.apache.org/viewvc?view=rev&rev=441650
Log:
1.)AttributeResolutionHandler:  Removed over-finicky test of bracketed attributes that prevented using (e.g.) <code>this</code> as a value.
2.) Introduced simple example representing mco-scoped values.

Added:
    incubator/xap/trunk/WebContent/examples/dataBinding/AttributeGetter.js   (with props)
    incubator/xap/trunk/WebContent/examples/dataBinding/mcoAttribute.html   (with props)
    incubator/xap/trunk/WebContent/examples/dataBinding/mcoAttribute.xal   (with props)
Modified:
    incubator/xap/trunk/src/xap/resolver/AttributeResolutionHandler.js

Added: incubator/xap/trunk/WebContent/examples/dataBinding/AttributeGetter.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dataBinding/AttributeGetter.js?view=auto&rev=441650
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dataBinding/AttributeGetter.js (added)
+++ incubator/xap/trunk/WebContent/examples/dataBinding/AttributeGetter.js Fri Sep  8 14:06:25 2006
@@ -0,0 +1,8 @@
+function AttributeGetter() { }
+
+AttributeGetter.prototype = new Object() ;
+
+AttributeGetter.prototype.getText = function(){
+	alert("Getting text from MCO.");
+	return "Got this text from an MCO." ;
+}
\ No newline at end of file

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

Added: incubator/xap/trunk/WebContent/examples/dataBinding/mcoAttribute.html
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dataBinding/mcoAttribute.html?view=auto&rev=441650
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dataBinding/mcoAttribute.html (added)
+++ incubator/xap/trunk/WebContent/examples/dataBinding/mcoAttribute.html Fri Sep  8 14:06:25 2006
@@ -0,0 +1,28 @@
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>Getting an attribute from an MCO method:</title>
+
+	<style type="text/css">
+      <!--
+          @import url(../../css/xapDefault.css);
+      -->
+    </style>
+    
+	<!-- Keep dojo from trying to scan this whole page for dojoType'd tags: -->
+	<script type="text/javascript">
+		djConfig = {
+			parseWidgets: false
+		};
+	</script>    
+	
+   <script language="JavaScript" type="text/javascript" src="../../xapcore.js"></script>
+   <script language="JavaScript" type="text/javascript" src="AttributeGetter.js"></script>
+    
+   <script language="JavaScript" src="../../src/xml/sax/SaxParser"> </script>
+</head>
+  
+ <body  onload="Xap.createAllPredefinedSessions();">
+	<div style="left:100px;top:100px" xapId="McoAttributeExample" xapSrc="mcoAttribute.xal" xapToolkit="dojo" xapContext="../../"></div>
+</body>
+</html>

Propchange: incubator/xap/trunk/WebContent/examples/dataBinding/mcoAttribute.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/xap/trunk/WebContent/examples/dataBinding/mcoAttribute.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dataBinding/mcoAttribute.xal?view=auto&rev=441650
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dataBinding/mcoAttribute.xal (added)
+++ incubator/xap/trunk/WebContent/examples/dataBinding/mcoAttribute.xal Fri Sep  8 14:06:25 2006
@@ -0,0 +1,23 @@
+<xal xmlns="http://www.openxal.org/xal" xmlns:xal="http://www.openxal.org/xal"> 
+
+
+	<mco:mco 
+		xmlns:mco="http://www.openxal.org/mco" 
+		id="attributeGetter" 
+		src="AttributeGetter"
+	/>
+
+
+	<xm:modifications xmlns:xm="http://www.openxal.org/xmodify">
+	<xm:append select="/xal">
+	
+		<xal:textField 
+			width="200px" 
+			text="{mco:attributeGetter.getText()}"
+			id="testComponent" 
+		/>
+
+		
+	</xm:append> 	  		
+  	</xm:modifications>
+</xal>
\ No newline at end of file

Propchange: incubator/xap/trunk/WebContent/examples/dataBinding/mcoAttribute.xal
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/xap/trunk/src/xap/resolver/AttributeResolutionHandler.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/resolver/AttributeResolutionHandler.js?view=diff&rev=441650&r1=441649&r2=441650
==============================================================================
--- incubator/xap/trunk/src/xap/resolver/AttributeResolutionHandler.js (original)
+++ incubator/xap/trunk/src/xap/resolver/AttributeResolutionHandler.js Fri Sep  8 14:06:25 2006
@@ -47,13 +47,6 @@
 	// fore and aft, so remove them:
 	attributeValue = attributeValue.substring(1,attributeValue.length-1) ;
 
-	if ( !this.isHandledObjectValuedAttribute(attributeValue) ){
-		return ;
-	}
-
-	// We know that this is of the form xyz:str,
-	// where "xyz" is a known handler:
-
 	// Lifting code from AbstractTagImpl.fireEvent() 
 	// and EventHandler.fireEvent():
 	var handler = this._session.getEventHandler() ;
@@ -100,20 +93,6 @@
 			) ;
 }
 	
-// Replace this a.s.a.p. with something hooked into the handler
-// manager:
-xap.resolver.AttributeResolutionHandler.allowedHandlers = 
-{javascript:true,mco:true,data:true}
-
-xap.resolver.AttributeResolutionHandler.prototype.isHandledObjectValuedAttribute = function(str){
-	var result = false ;
-	var firstColon = str.indexOf(":") ;
-	if ( firstColon != -1){
-		var possibleHandler = str.substring(0,firstColon) ;
-		result = this.constructor.allowedHandlers[possibleHandler] ;
-		result = (typeof result != "undefined") ;
-	}
-	return result ;
-}
+