Author: dolander
Date: Tue Mar 29 15:25:00 2005
New Revision: 159447

URL: http://svn.apache.org/viewcvs?view=rev&rev=159447
Log:
BVT for Jira bug 475


Added:
    incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j475/
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j475/Controller.jpf
    incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j475/Test.jsp
    incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j475/TestXml.jsp
    incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J475.xml
Modified:
    
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j475/Controller.jpf
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j475/Controller.jpf?view=auto&rev=159447
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j475/Controller.jpf 
(added)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j475/Controller.jpf 
Tue Mar 29 15:25:00 2005
@@ -0,0 +1,21 @@
+package bugs.j475;
+
+import org.apache.beehive.netui.pageflow.*;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils;
+
+import javax.servlet.http.HttpServletRequest;
+
[EMAIL PROTECTED]
+public class Controller extends PageFlowController
+{
+    @Jpf.Action
+        (forwards = {
+            @Jpf.Forward(name = "success",
+                     path = "Test.jsp")
+    })
+    public Forward begin ()
+    {
+        return new Forward ("success");
+    }
+}
\ No newline at end of file

Added: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j475/Test.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j475/Test.jsp?view=auto&rev=159447
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j475/Test.jsp 
(added)
+++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j475/Test.jsp 
Tue Mar 29 15:25:00 2005
@@ -0,0 +1,31 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0"; prefix="netui"%>
+<netui:html>
+<head>
+   <title>JavaScript Bug</title>
+</head>
+<netui:body>
+<script>
+    function test (element)
+    {
+        var testAttrId = lookupIdByTagId ("testElem", element);
+        alert ("HTML:" + testAttrId);
+        var testAttr = document.getElementById (testAttrId);
+        alert ("HTML:" + testAttr.innerHTML);
+    }
+</script>
+<netui:anchor href="TestXml.jsp">Xml Document</netui:anchor>
+<table>
+    <tr>
+        <td>
+            <netui:scriptContainer generateIdScope="true">
+                <a href="Test.jsp" onClick="test (this);">bar</a><br>
+                <netui:span tagId="testElem" value="span" />
+            </netui:scriptContainer>
+        </td>
+    </tr>
+</table>
+</netui:body>
+</netui:html>
+
+

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j475/TestXml.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j475/TestXml.jsp?view=auto&rev=159447
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j475/TestXml.jsp 
(added)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j475/TestXml.jsp 
Tue Mar 29 15:25:00 2005
@@ -0,0 +1,31 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0"; prefix="netui"%>
+<netui:html documentType="xhtml1-transitional">
+<head>
+   <title>JavaScript Bug</title>
+</head>
+<netui:body>
+<script>
+    function test (element)
+    {
+        var testAttrId = lookupIdByTagId ("testElem", element);
+        alert ("XML:" + testAttrId);
+        var testAttr = document.getElementById (testAttrId);
+        alert ("XML:" + testAttr.innerHTML);
+    }
+</script>
+<netui:anchor href="Test.jsp">Html Document</netui:anchor>
+<table>
+    <tr>
+        <td>
+            <netui:scriptContainer generateIdScope="true">
+                <a href="TestXml.jsp" onClick="test (this);">bar</a><br>
+                <netui:span tagId="testElem" value="span" />
+            </netui:scriptContainer>
+        </td>
+    </tr>
+</table>
+</netui:body>
+</netui:html>
+
+

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml?view=diff&r1=159446&r2=159447
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
 (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
 Tue Mar 29 15:25:00 2005
@@ -4230,6 +4230,15 @@
          </categories>
       </test>
       <test>
+         <name>J475</name>
+         <description>Verification that the lookup Javascript works inside of 
a table.</description>
+         <webapp>coreWeb</webapp>
+         <categories>
+            <category>bvt</category>
+            <category>jiriBugs</category>
+         </categories>
+      </test>
+      <test>
          <name>JpfScopedFormsTest49</name>
          <description>JpfScopedFormsTest49</description>
          <webapp>coreWeb</webapp>

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J475.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J475.xml?view=auto&rev=159447
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J475.xml 
(added)
+++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J475.xml 
Tue Mar 29 15:25:00 2005
@@ -0,0 +1,623 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ses:recorderSession 
xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session";>
+   <ses:sessionName>J475</ses:sessionName>
+   <ses:tester>Daryl</ses:tester>
+   <ses:startDate>29 Mar 2005, 03:57:32.838 PM MST</ses:startDate>
+   <ses:description>Verification of Lookup inside of a table.</ses:description>
+   <ses:tests>
+      <ses:test>
+         <ses:testNumber>1</ses:testNumber>
+         <ses:request>
+            <ses:protocol>HTTP</ses:protocol>
+            <ses:protocolVersion>1.1</ses:protocolVersion>
+            <ses:host>localhost</ses:host>
+            <ses:port>8080</ses:port>
+            <ses:uri>/coreWeb/bugs/j475/Controller.jpf</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>571018D468376B8BFB9553380B919048</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <ses:header>
+                  <ses:name>accept</ses:name>
+                  
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-charset</ses:name>
+                  <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-encoding</ses:name>
+                  <ses:value>gzip,deflate</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-language</ses:name>
+                  <ses:value>en-us,en;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>connection</ses:name>
+                  <ses:value>keep-alive</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>cookie</ses:name>
+                  
<ses:value>JSESSIONID=571018D468376B8BFB9553380B919048</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>host</ses:name>
+                  <ses:value>localhost:8080</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>keep-alive</ses:name>
+                  <ses:value>300</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>user-agent</ses:name>
+                  <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; 
rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value>
+               </ses:header>
+            </ses:headers>
+         </ses:request>
+         <ses:response>
+            <ses:statusCode>200</ses:statusCode>
+            <ses:reason/>
+            <ses:responseBody>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 
Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd";>
+&lt;html lang="en">
+
+&lt;head>
+   &lt;title>JavaScript Bug&lt;/title>
+&lt;/head>
+&lt;body>
+&lt;script>
+    function test (element)
+    {
+        var testAttrId = lookupIdByTagId ("testElem", element);
+        alert ("HTML:" + testAttrId);
+        var testAttr = document.getElementById (testAttrId);
+        alert ("HTML:" + testAttr.innerHTML);
+    }
+&lt;/script>
+&lt;a href="/coreWeb/bugs/j475/TestXml.jsp">Xml Document&lt;/a>
+&lt;table>
+    &lt;tr>
+        &lt;td>
+            &lt;div netui:idScope="n0" >
+                &lt;a href="Test.jsp" onClick="test (this);">bar&lt;/a>&lt;br>
+                &lt;span id="n0.testElem">span&lt;/span>
+            &lt;/div>
+        &lt;/td>
+    &lt;/tr>
+&lt;/table>
+&lt;script language="JavaScript" type="text/JavaScript">
+&lt;!--
+
+// **** Start the NetUI Framework Generated JavaScript ****
+
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_names == null)
+   var netui_names = new Object();
+netui_names.n0__testElem="n0.testElem"
+
+
+// method which will return a real id for a tagId,
+// the tag parameter will be used to find the idScope for
+// containers that may scope their ids
+function getNetuiTagName(id, tag)
+{
+   var idScope = getScopeId(tag);
+   if (idScope == "")
+      return netui_names[id];
+   else
+      return netui_names[idScope  + "__" + id];
+}
+
+// This method will walk the hierarchy from the pass element looking for a 
idScope.
+// The first idScope found will be returned or the empty string if a idScope 
is not found.
+function getScopeId(tag)
+{
+   if (tag == null || tag.getAttribute == null)
+      return "";
+   var attrVal = tag.getAttribute("netui:idScope");
+   if (attrVal != null)
+      return attrVal;
+   return getScopeId(tag.parentNode);
+}
+
+// lookup by tagId to "real id"
+function lookupIdByTagId(id, tag)
+{
+   var idScope = lookupIdScope(tag,".");
+   return (idScope == "") ? id : idScope + id;
+}
+
+//Non-Legacy lookup method creating a fully qualified scope id
+function lookupIdScope(tag,sep)
+{
+   var val = "";
+   if (sep == null) sep = "";
+   while (tag != null &amp;&amp; tag.getAttribute != null) {
+      try {
+         var attrVal = tag.getAttribute("netui:idScope");
+      } catch (e) { /* ignore, in IE6 calling on a table results in an 
exception */ }
+      if (attrVal != null)
+         val = attrVal + sep + val;
+      tag = tag.parentNode;
+   }
+   return val;
+}
+-->
+&lt;/script>&lt;/body>
+
+&lt;/html></ses:responseBody>
+         </ses:response>
+      </ses:test>
+      <ses:test>
+         <ses:testNumber>2</ses:testNumber>
+         <ses:request>
+            <ses:protocol>HTTP</ses:protocol>
+            <ses:protocolVersion>1.1</ses:protocolVersion>
+            <ses:host>localhost</ses:host>
+            <ses:port>8080</ses:port>
+            <ses:uri>/coreWeb/bugs/j475/Test.jsp</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>571018D468376B8BFB9553380B919048</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <ses:header>
+                  <ses:name>accept</ses:name>
+                  
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-charset</ses:name>
+                  <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-encoding</ses:name>
+                  <ses:value>gzip,deflate</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-language</ses:name>
+                  <ses:value>en-us,en;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>connection</ses:name>
+                  <ses:value>keep-alive</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>cookie</ses:name>
+                  
<ses:value>JSESSIONID=571018D468376B8BFB9553380B919048</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>host</ses:name>
+                  <ses:value>localhost:8080</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>keep-alive</ses:name>
+                  <ses:value>300</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>referer</ses:name>
+                  
<ses:value>http://localhost:8080/coreWeb/bugs/j475/Controller.jpf</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>user-agent</ses:name>
+                  <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; 
rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value>
+               </ses:header>
+            </ses:headers>
+         </ses:request>
+         <ses:response>
+            <ses:statusCode>200</ses:statusCode>
+            <ses:reason/>
+            <ses:responseBody>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 
Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd";>
+&lt;html lang="en">
+
+&lt;head>
+   &lt;title>JavaScript Bug&lt;/title>
+&lt;/head>
+&lt;body>
+&lt;script>
+    function test (element)
+    {
+        var testAttrId = lookupIdByTagId ("testElem", element);
+        alert ("HTML:" + testAttrId);
+        var testAttr = document.getElementById (testAttrId);
+        alert ("HTML:" + testAttr.innerHTML);
+    }
+&lt;/script>
+&lt;a href="/coreWeb/bugs/j475/TestXml.jsp">Xml Document&lt;/a>
+&lt;table>
+    &lt;tr>
+        &lt;td>
+            &lt;div netui:idScope="n0" >
+                &lt;a href="Test.jsp" onClick="test (this);">bar&lt;/a>&lt;br>
+                &lt;span id="n0.testElem">span&lt;/span>
+            &lt;/div>
+        &lt;/td>
+    &lt;/tr>
+&lt;/table>
+&lt;script language="JavaScript" type="text/JavaScript">
+&lt;!--
+
+// **** Start the NetUI Framework Generated JavaScript ****
+
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_names == null)
+   var netui_names = new Object();
+netui_names.n0__testElem="n0.testElem"
+
+
+// method which will return a real id for a tagId,
+// the tag parameter will be used to find the idScope for
+// containers that may scope their ids
+function getNetuiTagName(id, tag)
+{
+   var idScope = getScopeId(tag);
+   if (idScope == "")
+      return netui_names[id];
+   else
+      return netui_names[idScope  + "__" + id];
+}
+
+// This method will walk the hierarchy from the pass element looking for a 
idScope.
+// The first idScope found will be returned or the empty string if a idScope 
is not found.
+function getScopeId(tag)
+{
+   if (tag == null || tag.getAttribute == null)
+      return "";
+   var attrVal = tag.getAttribute("netui:idScope");
+   if (attrVal != null)
+      return attrVal;
+   return getScopeId(tag.parentNode);
+}
+
+// lookup by tagId to "real id"
+function lookupIdByTagId(id, tag)
+{
+   var idScope = lookupIdScope(tag,".");
+   return (idScope == "") ? id : idScope + id;
+}
+
+//Non-Legacy lookup method creating a fully qualified scope id
+function lookupIdScope(tag,sep)
+{
+   var val = "";
+   if (sep == null) sep = "";
+   while (tag != null &amp;&amp; tag.getAttribute != null) {
+      try {
+         var attrVal = tag.getAttribute("netui:idScope");
+      } catch (e) { /* ignore, in IE6 calling on a table results in an 
exception */ }
+      if (attrVal != null)
+         val = attrVal + sep + val;
+      tag = tag.parentNode;
+   }
+   return val;
+}
+-->
+&lt;/script>&lt;/body>
+
+&lt;/html></ses:responseBody>
+         </ses:response>
+      </ses:test>
+      <ses:test>
+         <ses:testNumber>3</ses:testNumber>
+         <ses:request>
+            <ses:protocol>HTTP</ses:protocol>
+            <ses:protocolVersion>1.1</ses:protocolVersion>
+            <ses:host>localhost</ses:host>
+            <ses:port>8080</ses:port>
+            <ses:uri>/coreWeb/bugs/j475/TestXml.jsp</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>571018D468376B8BFB9553380B919048</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <ses:header>
+                  <ses:name>accept</ses:name>
+                  
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-charset</ses:name>
+                  <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-encoding</ses:name>
+                  <ses:value>gzip,deflate</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-language</ses:name>
+                  <ses:value>en-us,en;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>connection</ses:name>
+                  <ses:value>keep-alive</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>cookie</ses:name>
+                  
<ses:value>JSESSIONID=571018D468376B8BFB9553380B919048</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>host</ses:name>
+                  <ses:value>localhost:8080</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>keep-alive</ses:name>
+                  <ses:value>300</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>referer</ses:name>
+                  
<ses:value>http://localhost:8080/coreWeb/bugs/j475/Test.jsp</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>user-agent</ses:name>
+                  <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; 
rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value>
+               </ses:header>
+            </ses:headers>
+         </ses:request>
+         <ses:response>
+            <ses:statusCode>200</ses:statusCode>
+            <ses:reason/>
+            <ses:responseBody>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 
Transitional//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
+&lt;html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml";>
+
+&lt;head>
+   &lt;title>JavaScript Bug&lt;/title>
+&lt;/head>
+&lt;body>
+&lt;script>
+    function test (element)
+    {
+        var testAttrId = lookupIdByTagId ("testElem", element);
+        alert ("XML:" + testAttrId);
+        var testAttr = document.getElementById (testAttrId);
+        alert ("XML:" + testAttr.innerHTML);
+    }
+&lt;/script>
+&lt;a href="/coreWeb/bugs/j475/Test.jsp">Html Document&lt;/a>
+&lt;table>
+    &lt;tr>
+        &lt;td>
+            &lt;div netui:idScope="n0" >
+                &lt;a href="TestXml.jsp" onClick="test 
(this);">bar&lt;/a>&lt;br>
+                &lt;span id="n0.testElem">span&lt;/span>
+            &lt;/div>
+        &lt;/td>
+    &lt;/tr>
+&lt;/table>
+&lt;script language="JavaScript" type="text/JavaScript">
+&lt;!--
+
+// **** Start the NetUI Framework Generated JavaScript ****
+
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_names == null)
+   var netui_names = new Object();
+netui_names.n0__testElem="n0.testElem"
+
+
+// method which will return a real id for a tagId,
+// the tag parameter will be used to find the idScope for
+// containers that may scope their ids
+function getNetuiTagName(id, tag)
+{
+   var idScope = getScopeId(tag);
+   if (idScope == "")
+      return netui_names[id];
+   else
+      return netui_names[idScope  + "__" + id];
+}
+
+// This method will walk the hierarchy from the pass element looking for a 
idScope.
+// The first idScope found will be returned or the empty string if a idScope 
is not found.
+function getScopeId(tag)
+{
+   if (tag == null || tag.getAttribute == null)
+      return "";
+   var attrVal = tag.getAttribute("netui:idScope");
+   if (attrVal != null)
+      return attrVal;
+   return getScopeId(tag.parentNode);
+}
+
+// lookup by tagId to "real id"
+function lookupIdByTagId(id, tag)
+{
+   var idScope = lookupIdScope(tag,".");
+   return (idScope == "") ? id : idScope + id;
+}
+
+//Non-Legacy lookup method creating a fully qualified scope id
+function lookupIdScope(tag,sep)
+{
+   var val = "";
+   if (sep == null) sep = "";
+   while (tag != null &amp;&amp; tag.getAttribute != null) {
+      try {
+         var attrVal = tag.getAttribute("netui:idScope");
+      } catch (e) { /* ignore, in IE6 calling on a table results in an 
exception */ }
+      if (attrVal != null)
+         val = attrVal + sep + val;
+      tag = tag.parentNode;
+   }
+   return val;
+}
+-->
+&lt;/script>&lt;/body>
+
+&lt;/html></ses:responseBody>
+         </ses:response>
+      </ses:test>
+      <ses:test>
+         <ses:testNumber>4</ses:testNumber>
+         <ses:request>
+            <ses:protocol>HTTP</ses:protocol>
+            <ses:protocolVersion>1.1</ses:protocolVersion>
+            <ses:host>localhost</ses:host>
+            <ses:port>8080</ses:port>
+            <ses:uri>/coreWeb/bugs/j475/TestXml.jsp</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>571018D468376B8BFB9553380B919048</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <ses:header>
+                  <ses:name>accept</ses:name>
+                  
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-charset</ses:name>
+                  <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-encoding</ses:name>
+                  <ses:value>gzip,deflate</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-language</ses:name>
+                  <ses:value>en-us,en;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>connection</ses:name>
+                  <ses:value>keep-alive</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>cookie</ses:name>
+                  
<ses:value>JSESSIONID=571018D468376B8BFB9553380B919048</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>host</ses:name>
+                  <ses:value>localhost:8080</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>keep-alive</ses:name>
+                  <ses:value>300</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>referer</ses:name>
+                  
<ses:value>http://localhost:8080/coreWeb/bugs/j475/TestXml.jsp</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>user-agent</ses:name>
+                  <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; 
rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value>
+               </ses:header>
+            </ses:headers>
+         </ses:request>
+         <ses:response>
+            <ses:statusCode>200</ses:statusCode>
+            <ses:reason/>
+            <ses:responseBody>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 
Transitional//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
+&lt;html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml";>
+
+&lt;head>
+   &lt;title>JavaScript Bug&lt;/title>
+&lt;/head>
+&lt;body>
+&lt;script>
+    function test (element)
+    {
+        var testAttrId = lookupIdByTagId ("testElem", element);
+        alert ("XML:" + testAttrId);
+        var testAttr = document.getElementById (testAttrId);
+        alert ("XML:" + testAttr.innerHTML);
+    }
+&lt;/script>
+&lt;a href="/coreWeb/bugs/j475/Test.jsp">Html Document&lt;/a>
+&lt;table>
+    &lt;tr>
+        &lt;td>
+            &lt;div netui:idScope="n0" >
+                &lt;a href="TestXml.jsp" onClick="test 
(this);">bar&lt;/a>&lt;br>
+                &lt;span id="n0.testElem">span&lt;/span>
+            &lt;/div>
+        &lt;/td>
+    &lt;/tr>
+&lt;/table>
+&lt;script language="JavaScript" type="text/JavaScript">
+&lt;!--
+
+// **** Start the NetUI Framework Generated JavaScript ****
+
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_names == null)
+   var netui_names = new Object();
+netui_names.n0__testElem="n0.testElem"
+
+
+// method which will return a real id for a tagId,
+// the tag parameter will be used to find the idScope for
+// containers that may scope their ids
+function getNetuiTagName(id, tag)
+{
+   var idScope = getScopeId(tag);
+   if (idScope == "")
+      return netui_names[id];
+   else
+      return netui_names[idScope  + "__" + id];
+}
+
+// This method will walk the hierarchy from the pass element looking for a 
idScope.
+// The first idScope found will be returned or the empty string if a idScope 
is not found.
+function getScopeId(tag)
+{
+   if (tag == null || tag.getAttribute == null)
+      return "";
+   var attrVal = tag.getAttribute("netui:idScope");
+   if (attrVal != null)
+      return attrVal;
+   return getScopeId(tag.parentNode);
+}
+
+// lookup by tagId to "real id"
+function lookupIdByTagId(id, tag)
+{
+   var idScope = lookupIdScope(tag,".");
+   return (idScope == "") ? id : idScope + id;
+}
+
+//Non-Legacy lookup method creating a fully qualified scope id
+function lookupIdScope(tag,sep)
+{
+   var val = "";
+   if (sep == null) sep = "";
+   while (tag != null &amp;&amp; tag.getAttribute != null) {
+      try {
+         var attrVal = tag.getAttribute("netui:idScope");
+      } catch (e) { /* ignore, in IE6 calling on a table results in an 
exception */ }
+      if (attrVal != null)
+         val = attrVal + sep + val;
+      tag = tag.parentNode;
+   }
+   return val;
+}
+-->
+&lt;/script>&lt;/body>
+
+&lt;/html></ses:responseBody>
+         </ses:response>
+      </ses:test>
+   </ses:tests>
+   <ses:endDate>29 Mar 2005, 03:57:47.439 PM MST</ses:endDate>
+   <ses:testCount>4</ses:testCount>
+</ses:recorderSession>
\ No newline at end of file


Reply via email to