You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by cs...@apache.org on 2006/03/03 19:53:03 UTC

svn commit: r382910 - in /beehive/trunk/netui: src/javascript/tagshtml/ src/tags-html/org/apache/beehive/netui/tags/divpanel/ src/tags-html/org/apache/beehive/netui/tags/javascript/ test/webapps/drt/testRecorder/config/ test/webapps/drt/testRecorder/te...

Author: cschoett
Date: Fri Mar  3 10:53:01 2006
New Revision: 382910

URL: http://svn.apache.org/viewcvs?rev=382910&view=rev
Log:
Fix for beehive-1048, added support for using the netui:divPanel tag when generateIdScope is set to true.
New BVT for this case also added.


Added:
    beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DivPanelScopedId.xml
    beehive/trunk/netui/test/webapps/drt/web/template/divPanel/scopedId.jsp
Modified:
    beehive/trunk/netui/src/javascript/tagshtml/netui-tree.js
    beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/divpanel/DivPanel.java
    beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/javaScript.properties
    beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
    beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DivPanel.xml
    beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DivPanelTree.xml
    beehive/trunk/netui/test/webapps/drt/testRecorder/tests/cr180865.xml
    beehive/trunk/netui/test/webapps/drt/web/template/divPanel/Controller.java

Modified: beehive/trunk/netui/src/javascript/tagshtml/netui-tree.js
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/javascript/tagshtml/netui-tree.js?rev=382910&r1=382909&r2=382910&view=diff
==============================================================================
--- beehive/trunk/netui/src/javascript/tagshtml/netui-tree.js (original)
+++ beehive/trunk/netui/src/javascript/tagshtml/netui-tree.js Fri Mar  3 10:53:01 2006
@@ -33,9 +33,16 @@
     var netUI = new NetUI();
 }
 
-NetUI.prototype.action = function(command)
+NetUI.prototype.action = function(tag, command)
 {
-    var f = new Function("members","members." + command);
+    var sid = getScopeId(tag);
+    var f;
+    if (sid.length > 0) {
+        f = new Function("members","members." + sid + "." + command);
+    } else {
+        f = new Function("members","members." + command);
+    }
+
     f(this.members);
     return false;
 }
@@ -595,10 +602,21 @@
             var attr = node.getAttribute("netui-div-panel");
             if (attr != null) {
                 //alert("here:" + node.id);
-		attr = node.getAttribute("netui:divName");
+		        attr = node.getAttribute("netui:divName");
                 var dp = new NetUIDivPanelInstance();
-		dp.divPanelName = attr;
-                netUI.members[node.id] = dp;
+		        dp.divPanelName = attr;
+
+                var sid = getScopeId(node);
+                if (sid.length > 0) {
+                    var nid = node.id.substring(sid.length + 1);
+                    if (netUI.members[sid] == null) {
+                        netUI.members[sid] = new Object();
+                    }
+                    netUI.members[sid][nid] = dp;
+                } else {
+                    netUI.members[node.id] = dp;
+                }
+                
                 this.panels[node.id] = dp;
                 this.createDivPanel(node,dp);
 

Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/divpanel/DivPanel.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/divpanel/DivPanel.java?rev=382910&r1=382909&r2=382910&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/divpanel/DivPanel.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/divpanel/DivPanel.java Fri Mar  3 10:53:01 2006
@@ -22,6 +22,7 @@
 import org.apache.beehive.netui.script.IllegalExpressionException;
 import org.apache.beehive.netui.tags.AbstractClassicTag;
 import org.apache.beehive.netui.tags.ExpressionHandling;
+import org.apache.beehive.netui.tags.TagConfig;
 import org.apache.beehive.netui.tags.javascript.CoreScriptFeature;
 import org.apache.beehive.netui.tags.javascript.IScriptReporter;
 import org.apache.beehive.netui.tags.javascript.ScriptRequestState;
@@ -218,6 +219,12 @@
     {
         HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
         if (!hasErrors()) {
+            if (TagConfig.isDefaultJavaScript()) {
+                if (_divState.id != null) {
+                    ScriptRequestState srs = ScriptRequestState.getScriptRequestState(req);
+                    srs.mapTagId(getScriptReporter(), _divState.id, _divState.id, null);
+                }
+            }
             WriteRenderAppender writer = new WriteRenderAppender(pageContext);
             TagRenderingBase divRenderer = TagRenderingBase.Factory.getRendering(TagRenderingBase.DIV_TAG, req);
             divRenderer.doEndTag(writer);

Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/javaScript.properties
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/javaScript.properties?rev=382910&r1=382909&r2=382910&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/javaScript.properties (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/javascript/javaScript.properties Fri Mar  3 10:53:01 2006
@@ -336,10 +336,10 @@
 
 #This method will invoke the NetUICommand infrastructure
 netuiAction=\
-return netUI.action(''{0}'');
+return netUI.action(this, ''{0}'');
 
 legacyNetuiAction=\
-return netUI.action("{0}");
+return netUI.action(this, "{0}");
 
 
 #initialization code for the tree

Modified: beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml?rev=382910&r1=382909&r2=382910&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml (original)
+++ beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml Fri Mar  3 10:53:01 2006
@@ -3753,6 +3753,19 @@
          </features>
       </test>
       <test>
+         <name>DivPanelScopedId</name>
+         <description>Basic test of the DivPanel with netui:html attribute generateIdScope</description>
+         <webapp>coreWeb</webapp>
+         <categories>
+            <category>bvt</category>
+            <category>bvt.struts11</category>
+            <category>templates</category>
+         </categories>
+         <features>
+            <feature>DivPanel</feature>
+         </features>
+      </test>
+      <test>
          <name>DivPanelTree</name>
          <description>Test of the tree driving the DivPanel</description>
          <webapp>coreWeb</webapp>

Modified: beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DivPanel.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DivPanel.xml?rev=382910&r1=382909&r2=382910&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DivPanel.xml (original)
+++ beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DivPanel.xml Fri Mar  3 10:53:01 2006
@@ -85,22 +85,22 @@
                 <td colspan="2" align="center">Page 1</td>
             </tr><tr>
                 <td width="100pt">&nbsp</td>
-                <td width="100pt"><a href="" onclick="return netUI.action('divPanel.showPage(&quot;page2&quot;);');">Next</a></td>
+                <td width="100pt"><a href="" onclick="return netUI.action(this, 'divPanel.showPage(&quot;page2&quot;);');">Next</a></td>
             </tr></table>
             </div>
             <div  id="page2">
             <table><tr>
                 <td colspan="2" align="center">Page 2</td>
             </tr><tr>
-                <td width="100pt"><a href="" onclick="return netUI.action('divPanel.showPage(&quot;page1&quot;);');">Previous</a></td>
-                <td width="100pt"><a href="" onclick="return netUI.action('divPanel.showPage(&quot;page3&quot;);');">Next</a></td>
+                <td width="100pt"><a href="" onclick="return netUI.action(this, 'divPanel.showPage(&quot;page1&quot;);');">Previous</a></td>
+                <td width="100pt"><a href="" onclick="return netUI.action(this, 'divPanel.showPage(&quot;page3&quot;);');">Next</a></td>
             </tr></table>
             </div>
              <div  id="page3">
             <table><tr>
                 <td colspan="2" align="center">Page 3</td>
             </tr><tr>
-                <td width="100pt"><a href="" onclick="return netUI.action('divPanel.showPage(&quot;page2&quot;);');">Previous</a></td>
+                <td width="100pt"><a href="" onclick="return netUI.action(this, 'divPanel.showPage(&quot;page2&quot;);');">Previous</a></td>
                 <td width="100pt">&nbsp;</td>
             </tr></table>
             </div>
@@ -148,6 +148,29 @@
       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 && 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;
+}
 -->
 </script></body>
 
@@ -163,4 +186,4 @@
    <ses:testCount>1</ses:testCount>
    <ses:passedCount>0</ses:passedCount>
    <ses:failedCount>1</ses:failedCount>
-</ses:recorderSession>
\ No newline at end of file
+</ses:recorderSession>

Added: beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DivPanelScopedId.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DivPanelScopedId.xml?rev=382910&view=auto
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DivPanelScopedId.xml (added)
+++ beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DivPanelScopedId.xml Fri Mar  3 10:53:01 2006
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<recorderSession xmlns="http://beehive.apache.org/netui/tools/testrecorder/2004/session">
+<sessionName>DivPanelScopedId</sessionName>
+<tester>cschoett</tester>
+<startDate>03 Mar 2006, 10:14:01.252 AM MST</startDate>
+<description>DivPanel test using the netui:html attribute generateIdScope = true</description>
+<tests>
+<test>
+<testNumber>1</testNumber>
+<request>
+<protocol>HTTP</protocol>
+<protocolVersion>1.1</protocolVersion>
+<host>localhost</host>
+<port>8080</port>
+<uri>/coreWeb/template/divPanel/beginScopedId.do</uri>
+<method>GET</method>
+<parameters>
+</parameters>
+<cookies>
+<cookie>
+<name>JSESSIONID</name>
+<value>110776711A1DB35C51B7C9F1996ED304</value>
+</cookie>
+</cookies>
+<headers>
+<header>
+<name>---------------</name>
+<value>------------</value>
+</header>
+<header>
+<name>accept</name>
+<value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</value>
+</header>
+<header>
+<name>accept-charset</name>
+<value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</value>
+</header>
+<header>
+<name>accept-language</name>
+<value>en-us,en;q=0.5</value>
+</header>
+<header>
+<name>connection</name>
+<value>keep-alive</value>
+</header>
+<header>
+<name>cookie</name>
+<value>JSESSIONID=110776711A1DB35C51B7C9F1996ED304</value>
+</header>
+<header>
+<name>host</name>
+<value>localhost:8080</value>
+</header>
+<header>
+<name>keep-alive</name>
+<value>300</value>
+</header>
+<header>
+<name>user-agent</name>
+<value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915</value>
+</header>
+</headers>
+</request>
+<response>
+<statusCode>200</statusCode>
+<reason></reason>
+<responseBody>
+<![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+	"http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en" netui:idScope="n0">
+
+    <head>
+        <title>
+            Basic DivPanel 
+        </title>
+        <script language="JavaScript" type="text/JavaScript" src="/coreWeb/resources/beehive/version1/javascript/netui-tree.js"></script>
+    </head>
+    <body>
+    <h4>Basic DivPanel with generateIdScope</h4>
+        <div id="n0.divPanel" netui-div-panel="true">
+            <div  id="page1">
+            <table><tr>
+                <td colspan="2" align="center">Page 1</td>
+            </tr><tr>
+                <td width="100pt">&nbsp</td>
+                <td width="100pt"><a href="" onclick="return netUI.action(this, 'divPanel.showPage(&quot;page2&quot;);');">Next</a></td>
+            </tr></table>
+            </div>
+            <div  id="page2">
+            <table><tr>
+                <td colspan="2" align="center">Page 2</td>
+            </tr><tr>
+                <td width="100pt"><a href="" onclick="return netUI.action(this, 'divPanel.showPage(&quot;page1&quot;);');">Previous</a></td>
+                <td width="100pt"><a href="" onclick="return netUI.action(this, 'divPanel.showPage(&quot;page3&quot;);');">Next</a></td>
+            </tr></table>
+            </div>
+             <div  id="page3">
+            <table><tr>
+                <td colspan="2" align="center">Page 3</td>
+            </tr><tr>
+                <td width="100pt"><a href="" onclick="return netUI.action(this, 'divPanel.showPage(&quot;page2&quot;);');">Previous</a></td>
+                <td width="100pt">&nbsp;</td>
+            </tr></table>
+            </div>
+        </div>
+    <script language="JavaScript" type="text/JavaScript">
+<!--
+
+// **** Start the NetUI Framework Generated JavaScript ****
+
+// write out the webapp name
+netUI.webAppName = "/coreWeb";
+
+netUI.netUIDivPanel = new NetUIDivPanel();
+netUI.netUIDivPanel.init();
+
+// 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__page2="page2"
+netui_names.n0__page3="page3"
+netui_names.n0__page1="page1"
+
+
+// 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 && 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;
+}
+-->
+</script></body>
+</html>]]>
+</responseBody>
+</response>
+</test>
+</tests>
+<endDate>03 Mar 2006, 10:14:21.370 AM MST</endDate>
+<testCount>1</testCount>
+</recorderSession>

Modified: beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DivPanelTree.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DivPanelTree.xml?rev=382910&r1=382909&r2=382910&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DivPanelTree.xml (original)
+++ beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DivPanelTree.xml Fri Mar  3 10:53:01 2006
@@ -78,60 +78,60 @@
         <div netui:treeName="Tree233">
    <div netui:treeLevel="0">
       <a href="#" netui:imageCollapse="/coreWeb/resources/beehive/version1/images/rootCollapsed.gif" netui:treeAnchor="expand" netui:treeAnchorInit="true" netui:treeId="0" netui:expandLast="true" netui:imageExpand="/coreWeb/resources/beehive/version1/images/rootExpanded.gif"><img src="/coreWeb/resources/beehive/version1/images/rootExpanded.gif" style="vertical-align:bottom;" border="0" alt="Collapse Tree Element"></a>
-      <a href="" class="unselected" onclick="return netUI.action('divPanel.showPage(&quot;RootPage&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="Tree">&nbsp;Tree&nbsp;</a>
+      <a href="" class="unselected" onclick="return netUI.action(this, 'divPanel.showPage(&quot;RootPage&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="Tree">&nbsp;Tree&nbsp;</a>
    </div>
       <div netui:treeLevel="1">
       <img src="/coreWeb/resources/beehive/version1/images/spacer.gif" width="16px" border="0" alt="">
       <a href="#" netui:treeAnchor="expand" netui:treeAnchorInit="true" netui:treeId="0.0"><img src="/coreWeb/resources/beehive/version1/images/nodeExpanded.gif" style="vertical-align:bottom;" border="0" alt="Collapse Tree Element"></a>
-      <a href="" class="unselected" onclick="return netUI.action('divPanel.showPage(&quot;Page1&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="1">&nbsp;1&nbsp;</a>
+      <a href="" class="unselected" onclick="return netUI.action(this, 'divPanel.showPage(&quot;Page1&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="1">&nbsp;1&nbsp;</a>
    </div>
       <div netui:treeLevel="2">
       <img src="/coreWeb/resources/beehive/version1/images/spacer.gif" width="16px" border="0" alt="">
       <img src="/coreWeb/resources/beehive/version1/images/verticalLine.gif" style="vertical-align:bottom;" width="16px" border="0" alt="">
       <img src="/coreWeb/resources/beehive/version1/images/lineJoin.gif" style="vertical-align:bottom;" border="0" alt="">
-      <a href="" class="unselected" onclick="return netUI.action('divPanel.showPage(&quot;Page11&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="1.1">&nbsp;1.1&nbsp;</a>
+      <a href="" class="unselected" onclick="return netUI.action(this, 'divPanel.showPage(&quot;Page11&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="1.1">&nbsp;1.1&nbsp;</a>
    </div>
       <div netui:treeLevel="2">
       <img src="/coreWeb/resources/beehive/version1/images/spacer.gif" width="16px" border="0" alt="">
       <img src="/coreWeb/resources/beehive/version1/images/verticalLine.gif" style="vertical-align:bottom;" width="16px" border="0" alt="">
       <img src="/coreWeb/resources/beehive/version1/images/lineJoin.gif" style="vertical-align:bottom;" border="0" alt="">
-      <a href="" class="unselected" onclick="return netUI.action('divPanel.showPage(&quot;Page12&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="1.2">&nbsp;1.2&nbsp;</a>
+      <a href="" class="unselected" onclick="return netUI.action(this, 'divPanel.showPage(&quot;Page12&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="1.2">&nbsp;1.2&nbsp;</a>
    </div>
       <div netui:treeLevel="2">
       <img src="/coreWeb/resources/beehive/version1/images/spacer.gif" width="16px" border="0" alt="">
       <img src="/coreWeb/resources/beehive/version1/images/verticalLine.gif" style="vertical-align:bottom;" width="16px" border="0" alt="">
       <a href="#" netui:treeAnchor="expand" netui:treeAnchorInit="true" netui:treeId="0.0.2"><img src="/coreWeb/resources/beehive/version1/images/nodeExpanded.gif" style="vertical-align:bottom;" border="0" alt="Collapse Tree Element"></a>
-      <a href="" class="unselected" onclick="return netUI.action('divPanel.showPage(&quot;Page13&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="1.3">&nbsp;1.3&nbsp;</a>
+      <a href="" class="unselected" onclick="return netUI.action(this, 'divPanel.showPage(&quot;Page13&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="1.3">&nbsp;1.3&nbsp;</a>
    </div>
       <div netui:treeLevel="3">
       <img src="/coreWeb/resources/beehive/version1/images/spacer.gif" width="16px" border="0" alt="">
       <img src="/coreWeb/resources/beehive/version1/images/verticalLine.gif" style="vertical-align:bottom;" width="16px" border="0" alt="">
       <img src="/coreWeb/resources/beehive/version1/images/verticalLine.gif" style="vertical-align:bottom;" width="16px" border="0" alt="">
       <img src="/coreWeb/resources/beehive/version1/images/lineJoin.gif" style="vertical-align:bottom;" border="0" alt="">
-      <a href="" class="unselected" onclick="return netUI.action('divPanel.showPage(&quot;Page131&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="1.3.1">&nbsp;1.3.1&nbsp;</a>
+      <a href="" class="unselected" onclick="return netUI.action(this, 'divPanel.showPage(&quot;Page131&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="1.3.1">&nbsp;1.3.1&nbsp;</a>
    </div>
       <div netui:treeLevel="3">
       <img src="/coreWeb/resources/beehive/version1/images/spacer.gif" width="16px" border="0" alt="">
       <img src="/coreWeb/resources/beehive/version1/images/verticalLine.gif" style="vertical-align:bottom;" width="16px" border="0" alt="">
       <img src="/coreWeb/resources/beehive/version1/images/verticalLine.gif" style="vertical-align:bottom;" width="16px" border="0" alt="">
       <img src="/coreWeb/resources/beehive/version1/images/lastLineJoin.gif" style="vertical-align:bottom;" border="0" alt="">
-      <a href="" class="unselected" onclick="return netUI.action('divPanel.showPage(&quot;Page132&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="1.3.2">&nbsp;1.3.2&nbsp;</a>
+      <a href="" class="unselected" onclick="return netUI.action(this, 'divPanel.showPage(&quot;Page132&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="1.3.2">&nbsp;1.3.2&nbsp;</a>
    </div>
       <div netui:treeLevel="2">
       <img src="/coreWeb/resources/beehive/version1/images/spacer.gif" width="16px" border="0" alt="">
       <img src="/coreWeb/resources/beehive/version1/images/verticalLine.gif" style="vertical-align:bottom;" width="16px" border="0" alt="">
       <img src="/coreWeb/resources/beehive/version1/images/lastLineJoin.gif" style="vertical-align:bottom;" border="0" alt="">
-      <a href="" class="unselected" onclick="return netUI.action('divPanel.showPage(&quot;Page14&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="1.4">&nbsp;1.4&nbsp;</a>
+      <a href="" class="unselected" onclick="return netUI.action(this, 'divPanel.showPage(&quot;Page14&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="1.4">&nbsp;1.4&nbsp;</a>
    </div>
       <div netui:treeLevel="1">
       <img src="/coreWeb/resources/beehive/version1/images/spacer.gif" width="16px" border="0" alt="">
       <img src="/coreWeb/resources/beehive/version1/images/lineJoin.gif" style="vertical-align:bottom;" border="0" alt="">
-      <a href="" class="unselected" onclick="return netUI.action('divPanel.showPage(&quot;Page2&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="2">&nbsp;2&nbsp;</a>
+      <a href="" class="unselected" onclick="return netUI.action(this, 'divPanel.showPage(&quot;Page2&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="2">&nbsp;2&nbsp;</a>
    </div>
       <div netui:treeLevel="1">
       <img src="/coreWeb/resources/beehive/version1/images/spacer.gif" width="16px" border="0" alt="">
       <img src="/coreWeb/resources/beehive/version1/images/lastLineJoin.gif" style="vertical-align:bottom;" border="0" alt="">
-      <a href="" class="unselected" onclick="return netUI.action('divPanel.showPage(&quot;Page3&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="3">&nbsp;3&nbsp;</a>
+      <a href="" class="unselected" onclick="return netUI.action(this, 'divPanel.showPage(&quot;Page3&quot;);');">&nbsp;<img src="/coreWeb/resources/beehive/version1/images/folder.gif" style="vertical-align:text-top" border="0" alt="3">&nbsp;3&nbsp;</a>
    </div>
    </div>
 
@@ -215,6 +215,29 @@
    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 && 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;
 }
 -->
 </script></body>

Modified: beehive/trunk/netui/test/webapps/drt/testRecorder/tests/cr180865.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/cr180865.xml?rev=382910&r1=382909&r2=382910&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/testRecorder/tests/cr180865.xml (original)
+++ beehive/trunk/netui/test/webapps/drt/testRecorder/tests/cr180865.xml Fri Mar  3 10:53:01 2006
@@ -80,9 +80,9 @@
         link and redisplay the page.  What should happen is that the current page inside the &amp;lt;divPanel>
         should still be the same one that was posted back.
         &lt;hr>
-        &lt;a href="" onclick="return netUI.action('divpanel.showPage(&amp;quot;page1&amp;quot;);');">page One&lt;/a>&amp;nbsp;&amp;nbsp;&amp;nbsp;
-        &lt;a href="" onclick="return netUI.action('divpanel.showPage(&amp;quot;page2&amp;quot;);');">page Two&lt;/a>&amp;nbsp;&amp;nbsp;&amp;nbsp;
-        &lt;a href="" onclick="return netUI.action('divpanel.showPage(&amp;quot;page3&amp;quot;);');">page Three&lt;/a>
+        &lt;a href="" onclick="return netUI.action(this, 'divpanel.showPage(&amp;quot;page1&amp;quot;);');">page One&lt;/a>&amp;nbsp;&amp;nbsp;&amp;nbsp;
+        &lt;a href="" onclick="return netUI.action(this, 'divpanel.showPage(&amp;quot;page2&amp;quot;);');">page Two&lt;/a>&amp;nbsp;&amp;nbsp;&amp;nbsp;
+        &lt;a href="" onclick="return netUI.action(this, 'divpanel.showPage(&amp;quot;page3&amp;quot;);');">page Three&lt;/a>
         &lt;hr>
         &lt;div id="divpanel" netui:divName="DivPanel1" netui-div-panel="true">
             &lt;div  id="page1">
@@ -143,6 +143,29 @@
       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>
 
@@ -397,9 +420,9 @@
         link and redisplay the page.  What should happen is that the current page inside the &amp;lt;divPanel>
         should still be the same one that was posted back.
         &lt;hr>
-        &lt;a href="" onclick="return netUI.action('divpanel.showPage(&amp;quot;page1&amp;quot;);');">page One&lt;/a>&amp;nbsp;&amp;nbsp;&amp;nbsp;
-        &lt;a href="" onclick="return netUI.action('divpanel.showPage(&amp;quot;page2&amp;quot;);');">page Two&lt;/a>&amp;nbsp;&amp;nbsp;&amp;nbsp;
-        &lt;a href="" onclick="return netUI.action('divpanel.showPage(&amp;quot;page3&amp;quot;);');">page Three&lt;/a>
+        &lt;a href="" onclick="return netUI.action(this, 'divpanel.showPage(&amp;quot;page1&amp;quot;);');">page One&lt;/a>&amp;nbsp;&amp;nbsp;&amp;nbsp;
+        &lt;a href="" onclick="return netUI.action(this, 'divpanel.showPage(&amp;quot;page2&amp;quot;);');">page Two&lt;/a>&amp;nbsp;&amp;nbsp;&amp;nbsp;
+        &lt;a href="" onclick="return netUI.action(this, 'divpanel.showPage(&amp;quot;page3&amp;quot;);');">page Three&lt;/a>
         &lt;hr>
         &lt;div id="divpanel" netui-div-panel-first="page3" netui:divName="DivPanel1" netui-div-panel="true">
             &lt;div  id="page1">
@@ -460,6 +483,29 @@
       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>
 
@@ -799,9 +845,9 @@
         link and redisplay the page.  What should happen is that the current page inside the &amp;lt;divPanel>
         should still be the same one that was posted back.
         &lt;hr>
-        &lt;a href="" onclick="return netUI.action('divpanel.showPage(&amp;quot;page1&amp;quot;);');">page One&lt;/a>&amp;nbsp;&amp;nbsp;&amp;nbsp;
-        &lt;a href="" onclick="return netUI.action('divpanel.showPage(&amp;quot;page2&amp;quot;);');">page Two&lt;/a>&amp;nbsp;&amp;nbsp;&amp;nbsp;
-        &lt;a href="" onclick="return netUI.action('divpanel.showPage(&amp;quot;page3&amp;quot;);');">page Three&lt;/a>
+        &lt;a href="" onclick="return netUI.action(this, 'divpanel.showPage(&amp;quot;page1&amp;quot;);');">page One&lt;/a>&amp;nbsp;&amp;nbsp;&amp;nbsp;
+        &lt;a href="" onclick="return netUI.action(this, 'divpanel.showPage(&amp;quot;page2&amp;quot;);');">page Two&lt;/a>&amp;nbsp;&amp;nbsp;&amp;nbsp;
+        &lt;a href="" onclick="return netUI.action(this, 'divpanel.showPage(&amp;quot;page3&amp;quot;);');">page Three&lt;/a>
         &lt;hr>
         &lt;div id="divpanel" netui-div-panel-first="page2" netui:divName="DivPanel1" netui-div-panel="true">
             &lt;div  id="page1">
@@ -862,6 +908,29 @@
       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>
 
@@ -962,4 +1031,4 @@
    <ses:testCount>9</ses:testCount>
    <ses:passedCount>6</ses:passedCount>
    <ses:failedCount>3</ses:failedCount>
-</ses:recorderSession>
\ No newline at end of file
+</ses:recorderSession>

Modified: beehive/trunk/netui/test/webapps/drt/web/template/divPanel/Controller.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/web/template/divPanel/Controller.java?rev=382910&r1=382909&r2=382910&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/web/template/divPanel/Controller.java (original)
+++ beehive/trunk/netui/test/webapps/drt/web/template/divPanel/Controller.java Fri Mar  3 10:53:01 2006
@@ -20,52 +20,11 @@
 import org.apache.beehive.netui.pageflow.PageFlowController;
 import org.apache.beehive.netui.pageflow.annotations.Jpf;
 
-/**
- * @jpf:controller
- * @jpf:view-properties view-properties::
- * <view-properties>
- *   <pageflow-object id="action:begin.do">
- *     <property value="80" name="x"/>
- *     <property value="100" name="y"/>
- *   </pageflow-object>
- *   <pageflow-object id="page:index.jsp">
- *     <property value="240" name="x"/>
- *     <property value="100" name="y"/>
- *   </pageflow-object>
- * </view-properties>
- * ::
- */
-@Jpf.Controller(
-    )
-@Jpf.ViewProperties(
-    value = {
-        "<view-properties>",
-        "  <pageflow-object id='action:begin.do'>",
-        "    <property value='80' name='x'/>",
-        "    <property value='100' name='y'/>",
-        "  </pageflow-object>",
-        "  <pageflow-object id='page:index.jsp'>",
-        "    <property value='240' name='x'/>",
-        "    <property value='100' name='y'/>",
-        "  </pageflow-object>",
-        "</view-properties>"
-    })
+@Jpf.Controller()
 public class Controller extends PageFlowController
 {
-
-
-    // Uncomment this declaration to access Global.app.
-    // 
-    //     protected global.Global globalApp;
-    // 
-
-    // For an example of page flow exception handling see the example "catch" and "exception-handler"
-    // annotations in {project}/WEB-INF/src/global/Global.app
-
     /**
      * This method represents the point of entry into the pageflow
-     * @jpf:action
-     * @jpf:forward name="success" path="index.jsp"
      */
     @Jpf.Action(
         forwards = {
@@ -74,6 +33,17 @@
                 path = "index.jsp") 
         })
     protected Forward begin()
+    {
+        return new Forward("success");
+    }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "success",
+                path = "scopedId.jsp") 
+        })
+    protected Forward beginScopedId()
     {
         return new Forward("success");
     }

Added: beehive/trunk/netui/test/webapps/drt/web/template/divPanel/scopedId.jsp
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/web/template/divPanel/scopedId.jsp?rev=382910&view=auto
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/web/template/divPanel/scopedId.jsp (added)
+++ beehive/trunk/netui/test/webapps/drt/web/template/divPanel/scopedId.jsp Fri Mar  3 10:53:01 2006
@@ -0,0 +1,41 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+<netui:html generateIdScope="true">
+    <head>
+        <title>
+            Basic DivPanel 
+        </title>
+        <netui:scriptHeader />
+    </head>
+    <netui:body>
+    <h4>Basic DivPanel with generateIdScope</h4>
+        <netui:divPanel tagId="divPanel">
+            <netui-template:section name="page1">
+            <table><tr>
+                <td colspan="2" align="center">Page 1</td>
+            </tr><tr>
+                <td width="100pt">&nbsp</td>
+                <td width="100pt"><netui:anchor clientAction='divPanel.showPage("page2");'>Next</netui:anchor></td>
+            </tr></table>
+            </netui-template:section>
+            <netui-template:section name="page2">
+            <table><tr>
+                <td colspan="2" align="center">Page 2</td>
+            </tr><tr>
+                <td width="100pt"><netui:anchor clientAction='divPanel.showPage("page1");'>Previous</netui:anchor></td>
+                <td width="100pt"><netui:anchor clientAction='divPanel.showPage("page3");'>Next</netui:anchor></td>
+            </tr></table>
+            </netui-template:section>
+             <netui-template:section name="page3">
+            <table><tr>
+                <td colspan="2" align="center">Page 3</td>
+            </tr><tr>
+                <td width="100pt"><netui:anchor clientAction='divPanel.showPage("page2");'>Previous</netui:anchor></td>
+                <td width="100pt">&nbsp;</td>
+            </tr></table>
+            </netui-template:section>
+        </netui:divPanel>
+    </netui:body>
+</netui:html>