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 jm...@apache.org on 2006/11/17 20:45:46 UTC

svn commit: r476308 - in /incubator/xap/trunk/WebContent/examples/widgets: tableSorting.html tableSorting.xal

Author: jmargaris
Date: Fri Nov 17 12:45:45 2006
New Revision: 476308

URL: http://svn.apache.org/viewvc?view=rev&rev=476308
Log: (empty)

Added:
    incubator/xap/trunk/WebContent/examples/widgets/tableSorting.html   (with props)
    incubator/xap/trunk/WebContent/examples/widgets/tableSorting.xal   (with props)

Added: incubator/xap/trunk/WebContent/examples/widgets/tableSorting.html
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/tableSorting.html?view=auto&rev=476308
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/tableSorting.html (added)
+++ incubator/xap/trunk/WebContent/examples/widgets/tableSorting.html Fri Nov 17 12:45:45 2006
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
+		"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+	<head>
+	    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+	    <title>Simple XAP Widget Example</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="AttributeTester.js"></script>    
+	    <script language="JavaScript" type="text/javascript" src="TableMco.js"></script>    
+	</head>
+	  
+	<body onload="Xap.createEmbeddedApplications();">
+		<div startPage="tableSorting.xal"></div>
+	</body>
+</html>
+

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

Added: incubator/xap/trunk/WebContent/examples/widgets/tableSorting.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/tableSorting.xal?view=auto&rev=476308
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/tableSorting.xal (added)
+++ incubator/xap/trunk/WebContent/examples/widgets/tableSorting.xal Fri Nov 17 12:45:45 2006
@@ -0,0 +1,118 @@
+<xal xmlns="http://openxal.org/ui" xmlns:xal="http://openxal.org/ui"> 
+
+	<xm:modifications xmlns:xm="http://openxal.org/core/xmodify">
+	<xm:append select="/xal">
+		<table id="testComponent" width="300px" height="500px">
+			<column dataType="string"><header text="Strings"/></column>
+			<column dataType="string"><header text="Strings"/></column>
+			<column dataType="number"><header text="Numbers"/></column>
+			<column dataType="number"><header text="Numbers"/></column>
+			<row>
+				<cell text="Aardvark"/><cell text="45"/><cell text="Aardvark"/><cell text="45"/>
+			</row>
+			<row>
+				<cell text="Zebra"/><cell text="450"/><cell text="Zebra"/><cell text="450"/>
+			</row>
+			<row>
+				<cell text="Gazelle"/><cell text="2.5"/><cell text="Gazelle"/><cell text="2.5"/>
+			</row>
+			<row>
+				<cell text="Bear"/><cell text="1000"/><cell text="Bear"/><cell text="1000"/>
+			</row>
+			<row>
+				<cell text="Panther"/><cell text="11"/><cell text="Panther"/><cell text="11"/>
+			</row>
+			<row>
+				<cell text="Aardvark"/><cell text="45"/><cell text="Aardvark"/><cell text="45"/>
+			</row>
+			<row>
+				<cell text="Zebra"/><cell text="450"/><cell text="Zebra"/><cell text="450"/>
+			</row>
+			<row>
+				<cell text="Gazelle"/><cell text="2.5"/><cell text="Gazelle"/><cell text="2.5"/>
+			</row>
+			<row>
+				<cell text="Bear"/><cell text="1000"/><cell text="Bear"/><cell text="1000"/>
+			</row>
+			<row>
+				<cell text="Panther"/><cell text="11"/><cell text="Panther"/><cell text="11"/>
+			</row>
+			<row>
+				<cell text="Aardvark"/><cell text="45"/><cell text="Aardvark"/><cell text="45"/>
+			</row>
+			<row>
+				<cell text="Zebra"/><cell text="450"/><cell text="Zebra"/><cell text="450"/>
+			</row>
+			<row>
+				<cell text="Gazelle"/><cell text="2.5"/><cell text="Gazelle"/><cell text="2.5"/>
+			</row>
+			<row>
+				<cell text="Bear"/><cell text="1000"/><cell text="Bear"/><cell text="1000"/>
+			</row>
+			<row>
+				<cell text="Panther"/><cell text="11"/><cell text="Panther"/><cell text="11"/>
+			</row>
+			<row>
+				<cell text="Aardvark"/><cell text="45"/><cell text="Aardvark"/><cell text="45"/>
+			</row>
+			<row>
+				<cell text="Zebra"/><cell text="450"/><cell text="Zebra"/><cell text="450"/>
+			</row>
+			<row>
+				<cell text="Gazelle"/><cell text="2.5"/><cell text="Gazelle"/><cell text="2.5"/>
+			</row>
+			<row>
+				<cell text="Bear"/><cell text="1000"/><cell text="Bear"/><cell text="1000"/>
+			</row>
+			<row>
+				<cell text="Panther"/><cell text="11"/><cell text="Panther"/><cell text="11"/>
+			</row>
+			<row>
+				<cell text="Aardvark"/><cell text="45"/><cell text="Aardvark"/><cell text="45"/>
+			</row>
+			<row>
+				<cell text="Zebra"/><cell text="450"/><cell text="Zebra"/><cell text="450"/>
+			</row>
+			<row>
+				<cell text="Gazelle"/><cell text="2.5"/><cell text="Gazelle"/><cell text="2.5"/>
+			</row>
+			<row>
+				<cell text="Bear"/><cell text="1000"/><cell text="Bear"/><cell text="1000"/>
+			</row>
+			<row>
+				<cell text="Panther"/><cell text="11"/><cell text="Panther"/><cell text="11"/>
+			</row>
+			<row>
+				<cell text="Aardvark"/><cell text="45"/><cell text="Aardvark"/><cell text="45"/>
+			</row>
+			<row>
+				<cell text="Zebra"/><cell text="450"/><cell text="Zebra"/><cell text="450"/>
+			</row>
+			<row>
+				<cell text="Gazelle"/><cell text="2.5"/><cell text="Gazelle"/><cell text="2.5"/>
+			</row>
+			<row>
+				<cell text="Bear"/><cell text="1000"/><cell text="Bear"/><cell text="1000"/>
+			</row>
+			<row>
+				<cell text="Panther"/><cell text="11"/><cell text="Panther"/><cell text="11"/>
+			</row>
+			<row>
+				<cell text="Aardvark"/><cell text="45"/><cell text="Aardvark"/><cell text="45"/>
+			</row>
+			<row>
+				<cell text="Zebra"/><cell text="450"/><cell text="Zebra"/><cell text="450"/>
+			</row>
+			<row>
+				<cell text="Gazelle"/><cell text="2.5"/><cell text="Gazelle"/><cell text="2.5"/>
+			</row>
+			<row>
+				<cell text="Bear"/><cell text="1000"/><cell text="Bear"/><cell text="1000"/>
+			</row>
+			<row>
+				<cell text="Panther"/><cell text="11"/><cell text="Panther"/><cell text="11"/>
+			</row>
+		</table>
+	</xm:append> 	  		
+  	</xm:modifications>
+</xal>
\ No newline at end of file

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



Default .xal page?

Posted by Michael Turyn <MT...@nexaweb.com>.
Currently, to run XAP an HTML page must specify a .xal uri.  Since it is
quite possible that much of the time people will want to run Foo.xal
from Foo.html, this suggests the following:

How about this default?  When Xap.createEmbeddedApplications() is run,
if it finds an element with an applicationName attribute but no
startPage, e.g.
          <div id="myId"  applicationName="MyApp" />
that it will look for the current URI up to its last period, with ".xal"
appended, e.g.
         http://foobar.org/tester.html ---> http://foobar.org/tester.xal
         http://foobar.org/tester.yet.another.bit.html --->
http://foobar.org/tester.yet.another.bit.xal
and so on.  (We can do this because every web page knows its own URI:
"location.href" in browser Javascript.)  The XAP-created elements will
end up within the div specified.  

This seems pretty straightforward and useful to me.



Less straightforward, but still useful:  if _no_ element can be found
with either an applicationName or a startPage, generate an
applicationName, look at the .xal page found as above, and make the
XAP-derived elements descendants of the page's <body/> tag.  This would
have the effect of allowing a very simple html page to call the xal:


Foo.html
========
<html>
   <head>
	<!-- Ideally, we can even set the page title from the .xal
page---we can already do 
		this for Firefox, though IE balks at it.
	-->
	<script language="JavaScript" type="text/javascript"
src="../../xapcore.js"></script>
   </head>
   <body onload="Xap.createEmbeddedApplications()"/>
</html>

Foo.xal would then be loaded and the html elements created from it
placed under <body/>.