Author: dolander
Date: Tue Apr 12 10:56:49 2005
New Revision: 161078
URL: http://svn.apache.org/viewcvs?view=rev&rev=161078
Log:
Another attempt at fixing J162. Add the name/legacy support to the anchor
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J162.xml
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java?view=diff&r1=161077&r2=161078
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
Tue Apr 12 10:56:49 2005
@@ -558,8 +558,10 @@
// if the tagId was set then rewrite it and output it.
if (_state.id != null) {
- _state.id = getIdForTagId(_state.id);
- renderDefaultNameAndId((HttpServletRequest) req, _state,
_state.id, _state.id);
+ //_state.id = getIdForTagId(_state.id);
+ _state.name = _state.id;
+ renderNameAndId((HttpServletRequest) req, _state,null);
+ //renderDefaultNameAndId((HttpServletRequest) req, _state,
_state.id, _state.id);
}
// write out the tag.
Modified:
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J162.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J162.xml?view=diff&r1=161077&r2=161078
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J162.xml
(original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J162.xml
Tue Apr 12 10:56:49 2005
@@ -2,7 +2,7 @@
<ses:recorderSession
xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session">
<ses:sessionName>J162</ses:sessionName>
<ses:tester>Daryl</ses:tester>
- <ses:startDate>01 Apr 2005, 02:53:08.262 PM MST</ses:startDate>
+ <ses:startDate>12 Apr 2005, 11:46:11.120 AM MDT</ses:startDate>
<ses:description>Daryl</ses:description>
<ses:tests>
<ses:test>
@@ -18,7 +18,7 @@
<ses:cookies>
<ses:cookie>
<ses:name>JSESSIONID</ses:name>
- <ses:value>03EE55AB827FC69162943322438E4AAA</ses:value>
+ <ses:value>5FBED0ACBA2517BDCF679E26CAFD9D0B</ses:value>
</ses:cookie>
</ses:cookies>
<ses:headers>
@@ -44,7 +44,7 @@
</ses:header>
<ses:header>
<ses:name>cookie</ses:name>
- <ses:value>$Version=0;
JSESSIONID=03EE55AB827FC69162943322438E4AAA; $Path=/coreWeb</ses:value>
+ <ses:value>$Version=0;
JSESSIONID=5FBED0ACBA2517BDCF679E26CAFD9D0B; $Path=/coreWeb</ses:value>
</ses:header>
<ses:header>
<ses:name>host</ses:name>
@@ -56,7 +56,7 @@
</ses:header>
<ses:header>
<ses:name>testrecorder.playback.testid</ses:name>
- <ses:value>-15ffc26:102ffbc4ce1:-7bab</ses:value>
+ <ses:value>4656d894:103377f79e4:-7ba9</ses:value>
</ses:header>
<ses:header>
<ses:name>user-agent</ses:name>
@@ -82,12 +82,12 @@
<div netui:idScope="one" >
<a id="one.top"></a>
<h4>Anchor Fragment Identifier Test</h4>
- <a id="one.linkBottom" href="#one.bottom">Bottom</a>
+ <a id="one.linkBottom" name="linkBottom"
href="#one.bottom">Bottom</a>
<div style="border: thin solid;height: 400px;">
<p id="javaOut"></p>
</div>
<a id="one.bottom"></a>
- <a id="one.linkTop" href="#one.top">Top</a>
+ <a id="one.linkTop" name="linkTop" href="#one.top">Top</a>
</div>
<script language="JavaScript" type="text/JavaScript">
<!--
@@ -96,12 +96,36 @@
// Build the netui_names table to map the tagId attributes
// to the real id written into the HTML
-if (netui_tagIdNameMap == null)
- var netui_tagIdNameMap = new Object();
-netui_tagIdNameMap.one___one.linkBottom="one.linkBottom"
-netui_tagIdNameMap.one___one.linkTop="one.linkTop"
+if (netui_names == null)
+ var netui_names = new Object();
+netui_names.one__linkBottom="one.linkBottom"
+netui_names.one__linkTop="one.linkTop"
+// 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)
{
@@ -109,16 +133,6 @@
return (idScope == "") ? id : idScope + id;
}
-// lookup by tagId to "real name"
-function lookupNameByTagId(id, tag)
-{
- var idScope = lookupIdScope(tag,"_");
- if (idScope == "")
- return netui_tagIdNameMap[id];
- else
- return netui_tagIdNameMap[idScope + "__" + id];
-}
-
//Non-Legacy lookup method creating a fully qualified scope id
function lookupIdScope(tag,sep)
{
@@ -169,7 +183,7 @@
<ses:cookies>
<ses:cookie>
<ses:name>JSESSIONID</ses:name>
- <ses:value>03EE55AB827FC69162943322438E4AAA</ses:value>
+ <ses:value>5FBED0ACBA2517BDCF679E26CAFD9D0B</ses:value>
</ses:cookie>
</ses:cookies>
<ses:headers>
@@ -199,7 +213,7 @@
</ses:header>
<ses:header>
<ses:name>cookie</ses:name>
- <ses:value>$Version=0;
JSESSIONID=03EE55AB827FC69162943322438E4AAA; $Path=/coreWeb</ses:value>
+ <ses:value>$Version=0;
JSESSIONID=5FBED0ACBA2517BDCF679E26CAFD9D0B; $Path=/coreWeb</ses:value>
</ses:header>
<ses:header>
<ses:name>host</ses:name>
@@ -211,7 +225,7 @@
</ses:header>
<ses:header>
<ses:name>testrecorder.playback.testid</ses:name>
- <ses:value>-15ffc26:102ffbc4ce1:-7bab</ses:value>
+ <ses:value>4656d894:103377f79e4:-7ba9</ses:value>
</ses:header>
<ses:header>
<ses:name>user-agent</ses:name>
@@ -237,12 +251,12 @@
<div netui:idScope="one" >
<a id="one.top"></a>
<h4>Anchor Fragment Identifier Test</h4>
- <a id="one.linkBottom" href="#one.bottom">Bottom</a>
+ <a id="one.linkBottom" name="linkBottom"
href="#one.bottom">Bottom</a>
<div style="border: thin solid;height: 400px;">
<p id="javaOut"></p>
</div>
<a id="one.bottom"></a>
- <a id="one.linkTop" href="#one.top">Top</a>
+ <a id="one.linkTop" name="linkTop" href="#one.top">Top</a>
</div>
<script language="JavaScript" type="text/JavaScript">
<!--
@@ -251,12 +265,36 @@
// Build the netui_names table to map the tagId attributes
// to the real id written into the HTML
-if (netui_tagIdNameMap == null)
- var netui_tagIdNameMap = new Object();
-netui_tagIdNameMap.one___one.linkBottom="one.linkBottom"
-netui_tagIdNameMap.one___one.linkTop="one.linkTop"
+if (netui_names == null)
+ var netui_names = new Object();
+netui_names.one__linkBottom="one.linkBottom"
+netui_names.one__linkTop="one.linkTop"
+// 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)
{
@@ -264,16 +302,6 @@
return (idScope == "") ? id : idScope + id;
}
-// lookup by tagId to "real name"
-function lookupNameByTagId(id, tag)
-{
- var idScope = lookupIdScope(tag,"_");
- if (idScope == "")
- return netui_tagIdNameMap[id];
- else
- return netui_tagIdNameMap[idScope + "__" + id];
-}
-
//Non-Legacy lookup method creating a fully qualified scope id
function lookupIdScope(tag,sep)
{
@@ -312,7 +340,7 @@
</ses:testResults>
</ses:test>
</ses:tests>
- <ses:endDate>01 Apr 2005, 02:53:08.803 PM MST</ses:endDate>
+ <ses:endDate>12 Apr 2005, 11:46:11.640 AM MDT</ses:endDate>
<ses:sessionStatus>fail</ses:sessionStatus>
<ses:testCount>2</ses:testCount>
<ses:passedCount>0</ses:passedCount>