Author: ekoneil
Date: Mon Apr 25 14:54:34 2005
New Revision: 164665

URL: http://svn.apache.org/viewcvs?rev=164665&view=rev
Log:
NetUI bug fixes:

BEEHIVE-340 data grid HTML elements need to support tagId generation

  Implement tagId handling for the various cell HTML types (anchor, image, 
span, etc) and various HTML table elements like <th>, <td>, <caption>, <thead>, 
<tbody>, <tfoot>, and <table>.

  Still need to do more on <tr> elements.

  Have added tests for everything but <th> and <td>.  And, those are coming 
here shortly.

BEEHIVE-548 ActionInterceptor BVTs failing when logging is set to "warn"

  Implement a reasonable toString() on the BundleNode implementations.  
Unfortunately, in the case of a MessageResources object from Struts, it's not 
possible to get the list of message keys, so it's impossible to implement 
entrySet() on Map.  The toString() has a reasonable default message and 
shouldn't stack trace any longer.

BB: self
DRT: NetUI pass
BVT: NetUI pass

Added:
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractDataGridHtmlTag.java
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/Controller.jpf
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/anchorcell-tagid.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/caption-tagid.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/imageanchorcell-tagid.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/imagecell-tagid.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/index.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/legacy-anchorcell.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/legacy-caption.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/legacy-imageanchorcell.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/legacy-imagecell.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/legacy-spancell.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/legacy-table.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/legacy-tbody.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/legacy-tfoot.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/legacy-thead.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/scriptcontainer-anchorcell.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/scriptcontainer-caption.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/scriptcontainer-imageanchorcell.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/scriptcontainer-imagecell.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/scriptcontainer-spancell.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/scriptcontainer-table.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/scriptcontainer-tbody.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/scriptcontainer-tfoot.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/scriptcontainer-thead.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/spancell-tagid.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/table-tagid.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/tbody-tagid.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/tfoot-tagid.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/thead-tagid.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridTagIdMonster.xml
Modified:
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/BundleMap.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/bundle/ResourceBundleNode.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/bundle/StrutsBundleNode.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/model/cell/AnchorCellModel.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/model/cell/ImageCellModel.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/model/cell/SpanCellModel.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/AnchorCellDecorator.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/ImageAnchorCellDecorator.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/ImageCellDecorator.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/SpanCellDecorator.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractCell.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AnchorCell.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Caption.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Footer.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/GetDataGridState.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Header.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/HeaderCell.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageCell.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/RenderPager.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java
    
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/TemplateCell.java
    
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
    
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCustomTagAttributes.xml
    
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridMessageOverrides.xml

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/BundleMap.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/BundleMap.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/BundleMap.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/BundleMap.java
 Mon Apr 25 14:54:34 2005
@@ -386,6 +386,10 @@
                 return false;
             else return _bundle.getString(key.toString()) != null;
         }
+
+        public String toString() {
+            return _bundle != null ? _bundle.toString() : "BundleMap contains 
an empty BundleNode";
+        }
     }
 }
      

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/bundle/ResourceBundleNode.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/bundle/ResourceBundleNode.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/bundle/ResourceBundleNode.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/bundle/ResourceBundleNode.java
 Mon Apr 25 14:54:34 2005
@@ -20,6 +20,8 @@
 import java.util.ResourceBundle;
 import java.util.Enumeration;
 
+import org.apache.beehive.netui.util.internal.InternalStringBuilder;
+
 /**
  */
 class ResourceBundleNode
@@ -41,5 +43,27 @@
 
     public Enumeration getKeys() {
         return _bundle != null ? _bundle.getKeys() : null;
+    }
+
+    public String toString() {
+        InternalStringBuilder sb = new InternalStringBuilder();
+        sb.append("ResourceBundleNode ");
+        Enumeration keys = getKeys();
+        if(keys != null) {
+            boolean first = true;
+            sb.append("{");
+            while(keys.hasMoreElements()) {
+                if(!first)
+                    sb.append(",");
+                else first = false;
+
+                String key = (String)keys.nextElement();
+                sb.append(key);
+                sb.append("=");
+                sb.append(getString(key));
+            }
+            sb.append("}");
+        }
+        return sb.toString();
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/bundle/StrutsBundleNode.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/bundle/StrutsBundleNode.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/bundle/StrutsBundleNode.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/bundle/StrutsBundleNode.java
 Mon Apr 25 14:54:34 2005
@@ -20,8 +20,8 @@
 import java.util.Locale;
 import java.util.Enumeration;
 
-import org.apache.beehive.netui.script.common.bundle.BundleNode;
 import org.apache.struts.util.MessageResources;
+import org.apache.beehive.netui.util.internal.InternalStringBuilder;
 
 /**
  */
@@ -46,5 +46,16 @@
 
     public Enumeration getKeys() {
         throw new UnsupportedOperationException("The getKeys() method is not 
supported on the MessageResources type.");
+    }
+
+    public String toString() {
+        InternalStringBuilder sb = new InternalStringBuilder();
+        sb.append("StrutsBundleNode ");
+        sb.append("messageResource: ");
+        sb.append(_messageResource);
+        sb.append(" ");
+        sb.append("locale: ");
+        sb.append(_locale);
+        return sb.toString();
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/model/cell/AnchorCellModel.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/model/cell/AnchorCellModel.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/model/cell/AnchorCellModel.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/model/cell/AnchorCellModel.java
 Mon Apr 25 14:54:34 2005
@@ -34,6 +34,7 @@
     private String _href = null;
     private String _scopeId = null;
     private String _action = null;
+    private String _javascript = null;
     private HashMap _params = null;
     private AnchorTag.State _anchorState = new AnchorTag.State();
 
@@ -94,5 +95,13 @@
 
     public void setLinkName(String linkName) {
         _linkName = linkName;
+    }
+
+    public String getJavascript() {
+        return _javascript;
+    }
+
+    public void setJavascript(String javascript) {
+        _javascript = javascript;
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/model/cell/ImageCellModel.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/model/cell/ImageCellModel.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/model/cell/ImageCellModel.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/model/cell/ImageCellModel.java
 Mon Apr 25 14:54:34 2005
@@ -28,6 +28,7 @@
     extends CellModel {
 
     private ImageTag.State _imageState = null;
+    private String _javascript = null;
 
     public ImageTag.State getImageState() {
         if(_imageState == null)
@@ -38,5 +39,13 @@
 
     public void setImageState(State imageState) {
         _imageState = imageState;
+    }
+
+    public String getJavascript() {
+        return _javascript;
+    }
+
+    public void setJavascript(String javascript) {
+        _javascript = javascript;
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/model/cell/SpanCellModel.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/model/cell/SpanCellModel.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/model/cell/SpanCellModel.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/model/cell/SpanCellModel.java
 Mon Apr 25 14:54:34 2005
@@ -30,6 +30,7 @@
     private static final SpanTag.State DEFAULT_SPAN_STATE = new 
SpanTag.State();
 
     private String _value = null;
+    private String _javascript = null;
     private SpanTag.State _spanState = new SpanTag.State();
 
     public String getValue() {
@@ -46,5 +47,13 @@
 
     public void setSpanState(State spanState) {
         _spanState = spanState;
+    }
+
+    public String getJavascript() {
+        return _javascript;
+    }
+
+    public void setJavascript(String javascript) {
+        _javascript = javascript;
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/AnchorCellDecorator.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/AnchorCellDecorator.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/AnchorCellDecorator.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/AnchorCellDecorator.java
 Mon Apr 25 14:54:34 2005
@@ -82,5 +82,9 @@
         appender.append(anchorCellModel.getValue());
         spanTag.doEndTag(appender);
         anchorTag.doEndTag(appender);
+
+        String javascript = anchorCellModel.getJavascript();
+        if(javascript != null)
+            appender.append(javascript);
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/ImageAnchorCellDecorator.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/ImageAnchorCellDecorator.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/ImageAnchorCellDecorator.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/ImageAnchorCellDecorator.java
 Mon Apr 25 14:54:34 2005
@@ -44,13 +44,11 @@
 
     public void decorate(JspContext jspContext, AbstractRenderAppender 
appender, CellModel cellModel)
             throws CellDecoratorException {
-
         HttpServletRequest request = JspUtil.getRequest(jspContext);
 
         assert cellModel instanceof ImageAnchorCellModel;
         ImageAnchorCellModel imageAnchorCellModel = 
(ImageAnchorCellModel)cellModel;
 
-
         AnchorTag.State anchorState = imageAnchorCellModel.getAnchorState();
         ImageTag.State imageState = imageAnchorCellModel.getImageState();
 
@@ -68,8 +66,7 @@
         }
         catch(URISyntaxException use) {
             String message = Bundle.getErrorString("Rendering_URLException", 
new Object[]{imageAnchorCellModel.getHref(), imageAnchorCellModel.getAction()});
-            if(LOGGER.isErrorEnabled())
-                LOGGER.error(message, use);
+            LOGGER.error(message, use);
             throw new CellDecoratorException(message, use);
         }
 
@@ -83,6 +80,8 @@
         imageTag.doEndTag(appender);
         anchorTag.doEndTag(appender);
 
-
+        String script = imageAnchorCellModel.getJavascript();
+        if(script != null)
+            appender.append(script);
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/ImageCellDecorator.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/ImageCellDecorator.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/ImageCellDecorator.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/ImageCellDecorator.java
 Mon Apr 25 14:54:34 2005
@@ -45,5 +45,10 @@
         TagRenderingBase br = 
TagRenderingBase.Factory.getRendering(TagRenderingBase.IMAGE_TAG, request);
         br.doStartTag(appender, imageColumnModel.getImageState());
         br.doEndTag(appender);
+
+        String javascript = imageColumnModel.getJavascript();
+        if(javascript != null)
+            appender.append(imageColumnModel.getJavascript());
+
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/SpanCellDecorator.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/SpanCellDecorator.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/SpanCellDecorator.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/runtime/rendering/cell/SpanCellDecorator.java
 Mon Apr 25 14:54:34 2005
@@ -38,15 +38,19 @@
             throws CellDecoratorException {
 
         assert cellModel instanceof SpanCellModel;
-        SpanCellModel literalColumnModel = (SpanCellModel)cellModel;
+        SpanCellModel spanCellModel = (SpanCellModel)cellModel;
 
         HttpServletRequest request = JspUtil.getRequest(jspContext);
         TagRenderingBase span = 
TagRenderingBase.Factory.getRendering(TagRenderingBase.SPAN_TAG, request);
 
-        String formatted = cellModel.formatText(literalColumnModel.getValue());
+        String formatted = cellModel.formatText(spanCellModel.getValue());
 
-        span.doStartTag(appender, literalColumnModel.getSpanState());
+        span.doStartTag(appender, spanCellModel.getSpanState());
         appender.append(formatted);
         span.doEndTag(appender);
+
+        String javascript = spanCellModel.getJavascript();
+        if(javascript != null)
+            appender.append(javascript);
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractCell.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractCell.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractCell.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractCell.java
 Mon Apr 25 14:54:34 2005
@@ -32,12 +32,15 @@
 import org.apache.beehive.netui.tags.html.HtmlConstants;
 import org.apache.beehive.netui.tags.html.FormatTag.Formatter;
 import org.apache.beehive.netui.util.Bundle;
+import org.apache.beehive.netui.util.logging.Logger;
 
 /**
  *
  */
 public abstract class AbstractCell
-        extends AbstractSimpleTag {
+    extends AbstractDataGridHtmlTag {
+
+    private static final Logger LOGGER = 
Logger.getInstance(AbstractCell.class);
 
     /* todo: switch onto ConstantRendering.NBSP */
     private static final String EMPTY_CELL = "&nbsp;";
@@ -51,7 +54,7 @@
      * body text.
      */
     public void formatterHasError() {
-        /* todo: error reporting! */
+        /* todo: error reporting */
     }
 
     /**

Added: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractDataGridHtmlTag.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractDataGridHtmlTag.java?rev=164665&view=auto
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractDataGridHtmlTag.java
 (added)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractDataGridHtmlTag.java
 Mon Apr 25 14:54:34 2005
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.tags.databinding.datagrid;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.JspException;
+
+import org.apache.beehive.netui.tags.AbstractSimpleTag;
+import org.apache.beehive.netui.tags.TagConfig;
+import org.apache.beehive.netui.tags.javascript.ScriptRequestState;
+import org.apache.beehive.netui.tags.html.Form;
+import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
+import org.apache.beehive.netui.tags.rendering.AbstractHtmlControlState;
+import 
org.apache.beehive.netui.databinding.datagrid.api.rendering.DataGridTagModel;
+
+/**
+ *
+ */
+public abstract class AbstractDataGridHtmlTag
+    extends AbstractSimpleTag {
+
+    protected final DataGridTagModel lookupDataGridTagModel() {
+        return DataGridUtil.getDataGridTagModel(getJspContext());
+    }
+
+    protected final void applyIndexedTagId(AbstractHtmlState state, String 
tagId)
+        throws JspException {
+        state.id = indexTagId(generateTagId(tagId));
+    }
+
+    protected final void applyTagId(AbstractHtmlState state, String tagId)
+        throws JspException {
+        state.id = generateTagId(tagId);
+    }
+
+    private final String generateTagId(String tagId)
+        throws JspException {
+        return setRequiredValueAttribute(tagId, "tagId");
+    }
+
+    private final String indexTagId(String tagId) {
+        DataGridTagModel dataGridTagModel = lookupDataGridTagModel();
+        assert dataGridTagModel != null;
+
+        int index = dataGridTagModel.getCurrentIndex();
+        assert index >= 0;
+
+        return tagId + index;
+    }
+
+    /**
+     * Assumptions:
+     * <ul>
+     * <li>The state.name must be fully formed or the "real name" of the 
form.</li>
+     * <li>The state.id is the tagId value set on the tag and <b>has not</b> 
be rewritten yet to form the "real id"</li>
+     * </ul>
+     * @param state
+     * @param parentForm
+     * @return String
+     */
+    protected final String renderNameAndId(HttpServletRequest request, 
AbstractHtmlState state, Form parentForm) {
+        // if id is not set then we need to exit
+        if (state.id == null)
+            return null;
+
+        // check to see if this is an instance of a HTML Control
+        boolean ctrlState = (state instanceof AbstractHtmlControlState);
+
+        // form keeps track of this so that it can add this control to it's 
focus map
+        if (parentForm != null && ctrlState) {
+            AbstractHtmlControlState hcs = (AbstractHtmlControlState) state;
+            if (hcs.name == null && parentForm.isFocusSet())
+                hcs.name = state.id;
+            parentForm.addTagID(state.id, ((AbstractHtmlControlState) 
state).name);
+        }
+
+        // rewrite the id, save the original value so it can be used in maps
+        String id = state.id;
+        state.id = getIdForTagId(id);
+
+        // Legacy Java Script support -- This writes out a single table with 
both the id and names
+        // mixed.  This is legacy support to match the pre beehive behavior.
+        String idScript = null;
+        if (TagConfig.isLegacyJavaScript()) {
+            ScriptRequestState srs = 
ScriptRequestState.getScriptRequestState(request);
+            if (!ctrlState) {
+                idScript = srs.mapLegacyTagId(getScriptReporter(), id, 
state.id);
+            }
+            else {
+                AbstractHtmlControlState cState = (AbstractHtmlControlState) 
state;
+                if (cState.name != null)
+                    idScript = srs.mapLegacyTagId(getScriptReporter(), id, 
cState.name);
+                else
+                    idScript = srs.mapLegacyTagId(getScriptReporter(), id, 
state.id);
+            }
+        }
+
+        // map the tagId to the real id
+        String name = null;
+        if (ctrlState) {
+            AbstractHtmlControlState cState = (AbstractHtmlControlState) state;
+            name = cState.name;
+        }
+
+        String script = renderDefaultNameAndId((HttpServletRequest)request, 
state, id, name);
+        if (script != null) {
+            if (idScript != null)
+                idScript = idScript + script;
+            else idScript = script;
+        }
+        return idScript;
+    }
+
+
+    protected String renderDefaultNameAndId(HttpServletRequest request, 
AbstractHtmlState state, String id, String name) {
+        // map the tagId to the real id
+        String script = null;
+        if (TagConfig.isDefaultJavaScript()) {
+            ScriptRequestState srs = 
ScriptRequestState.getScriptRequestState(request);
+            script = srs.mapTagId(getScriptReporter(), id, state.id, name);
+        }
+        return script;
+    }
+}

Propchange: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractDataGridHtmlTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractHtmlTableCell.java
 Mon Apr 25 14:54:34 2005
@@ -22,25 +22,31 @@
 import java.util.ArrayList;
 import javax.servlet.jsp.tagext.JspFragment;
 import javax.servlet.jsp.JspException;
+import javax.servlet.http.HttpServletRequest;
 
 import 
org.apache.beehive.netui.databinding.datagrid.api.rendering.DataGridTagModel;
 import 
org.apache.beehive.netui.databinding.datagrid.runtime.rendering.table.TableRenderer;
+import org.apache.beehive.netui.databinding.datagrid.runtime.util.JspUtil;
 import org.apache.beehive.netui.databinding.datagrid.api.sort.SortModel;
 import org.apache.beehive.netui.databinding.datagrid.api.filter.FilterModel;
 import org.apache.beehive.netui.tags.IAttributeConsumer;
 import org.apache.beehive.netui.tags.IBehaviorConsumer;
+import org.apache.beehive.netui.tags.TagConfig;
+import org.apache.beehive.netui.tags.javascript.ScriptRequestState;
 import org.apache.beehive.netui.tags.html.HtmlConstants;
+import org.apache.beehive.netui.tags.html.Form;
 import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
 import org.apache.beehive.netui.tags.rendering.TdTag;
 import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender;
+import org.apache.beehive.netui.tags.rendering.AbstractHtmlControlState;
 import org.apache.beehive.netui.util.Bundle;
 
 /**
  *
  */
 public abstract class AbstractHtmlTableCell
-        extends AbstractCell
-        implements IAttributeConsumer, IBehaviorConsumer {
+    extends AbstractCell
+    implements IAttributeConsumer, IBehaviorConsumer {
 
     private String _sortExpression = null;
     private String _filterExpression = null;
@@ -433,6 +439,22 @@
     }
 
     /**
+     * Set the name of the tagId for the Anchor.
+     *
+     * @param tagId - the the name of the tagId for the anchor.
+     * @jsptagref.attributedescription The tagId.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_tagId</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="String value. Sets the id (or name) attribute of the 
rendered HTML tag. "
+     * @netui.tldx:attribute category="general"
+     */
+    public void setAnchorTagId(String tagId)
+        throws JspException {
+        _cellState.id = setRequiredValueAttribute(tagId, "tagId");
+    }
+
+    /**
      * Base support for the <code>attribute</code> tag.  This requires that 
the tag buffer their body and
      * write attribute in the end tag.  For the HTML tags it is not legal to 
set
      * the <code>id</code> or <code>name</code> attributes.  In addition, the 
base tag does
@@ -493,6 +515,15 @@
         tableRenderer.openTableCell(_cellState, appender);
         renderDataCellContents(appender, sw.toString());
         tableRenderer.closeTableCell(appender);
+
+        /* todo: need to add the JavaScript rendering for any tagIds that were 
set on <td>s */
+        if (_cellState.id != null) {
+            HttpServletRequest request = JspUtil.getRequest(getJspContext());
+            String script = renderNameAndId(request, _cellState, null);
+            if(script != null)
+                appender.append(script);
+        }
+
     }
 
     protected abstract void renderDataCellContents(AbstractRenderAppender 
appender, String output)

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AnchorCell.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AnchorCell.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AnchorCell.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AnchorCell.java
 Mon Apr 25 14:54:34 2005
@@ -18,10 +18,12 @@
 package org.apache.beehive.netui.tags.databinding.datagrid;
 
 import javax.servlet.jsp.JspException;
+import javax.servlet.http.HttpServletRequest;
 
 import org.apache.beehive.netui.databinding.datagrid.api.rendering.CellModel;
 import 
org.apache.beehive.netui.databinding.datagrid.runtime.model.cell.AnchorCellModel;
 import 
org.apache.beehive.netui.databinding.datagrid.runtime.rendering.cell.AnchorCellDecorator;
+import org.apache.beehive.netui.databinding.datagrid.runtime.util.JspUtil;
 import org.apache.beehive.netui.tags.html.IUrlParams;
 import org.apache.beehive.netui.tags.html.HtmlConstants;
 import org.apache.beehive.netui.tags.html.IFormattable;
@@ -39,8 +41,8 @@
  * renderer="workshop.netui.jspdesigner.tldx.AnchorColumnRenderer"
  */
 public class AnchorCell
-        extends AbstractHtmlTableCell
-        implements IFormattable, IUrlParams {
+    extends AbstractHtmlTableCell
+    implements IFormattable, IUrlParams {
 
     private static final AnchorCellDecorator DECORATOR = new 
AnchorCellDecorator();
     private static final String REQUIRED_ATTR = "href, action, linkName";
@@ -251,7 +253,7 @@
      * @netui.tldx:attribute category="misc"
      */
     public void setCharSet(String charSet) {
-        
_anchorCellModel.getAnchorState().registerAttribute(AbstractHtmlState.ATTR_GENERAL,
 HtmlConstants.CHARSET, charSet);
+        _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, 
HtmlConstants.CHARSET, charSet);
     }
 
     /**
@@ -266,7 +268,7 @@
      * @netui.tldx:attribute category="misc"
      */
     public void setType(String type) {
-        
_anchorCellModel.getAnchorState().registerAttribute(AbstractHtmlState.ATTR_GENERAL,
 HtmlConstants.TYPE, type);
+        _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, 
HtmlConstants.TYPE, type);
     }
 
     /**
@@ -281,7 +283,7 @@
      * @netui.tldx:attribute category="misc"
      */
     public void setHrefLang(String hreflang) {
-        
_anchorCellModel.getAnchorState().registerAttribute(AbstractHtmlState.ATTR_GENERAL,
 HtmlConstants.HREFLANG, hreflang);
+        _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, 
HtmlConstants.HREFLANG, hreflang);
     }
 
     /**
@@ -296,7 +298,7 @@
      * @netui.tldx:attribute category="misc"
      */
     public void setRel(String rel) {
-        
_anchorCellModel.getAnchorState().registerAttribute(AbstractHtmlState.ATTR_GENERAL,
 HtmlConstants.REL, rel);
+        _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, 
HtmlConstants.REL, rel);
     }
 
     /**
@@ -311,10 +313,9 @@
      * @netui.tldx:attribute category="misc"
      */
     public void setRev(String rev) {
-        
_anchorCellModel.getAnchorState().registerAttribute(AbstractHtmlState.ATTR_GENERAL,
 HtmlConstants.REV, rev);
+        _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, 
HtmlConstants.REV, rev);
     }
 
-
     /**
      * Sets the window target.
      *
@@ -327,7 +328,7 @@
      * @netui.tldx:attribute category="misc"
      */
     public void setTarget(String target) {
-        
_anchorCellModel.getAnchorState().registerAttribute(AbstractHtmlState.ATTR_GENERAL,
 HtmlConstants.TARGET, target);
+        _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, 
HtmlConstants.TARGET, target);
     }
 
     /**
@@ -382,10 +383,26 @@
      * @netui.tldx:attribute reftype="netui-action-url" category="general"
      */
     public void setAction(String action)
-            throws JspException {
+        throws JspException {
         _anchorCellModel.setAction(setRequiredValueAttribute(action, 
"action"));
     }
 
+    /**
+     * Set the name of the tagId for the Anchor.
+     *
+     * @param tagId - the the name of the tagId for the anchor.
+     * @jsptagref.attributedescription The tagId.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_tagId</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="String value. Sets the id (or name) attribute of the 
rendered HTML tag. "
+     * @netui.tldx:attribute category="general"
+     */
+    public void setTagId(String tagId)
+        throws JspException {
+        applyIndexedTagId(_anchorState, tagId);
+    }
+
     public void setAttribute(String name, String value, String facet)
             throws JspException {
         if(facet == null || facet.equals(ANCHOR_FACET_NAME))
@@ -419,6 +436,14 @@
     }
 
     protected void renderDataCellContents(AbstractRenderAppender appender, 
String jspFragmentOutput) {
+
+        /* render any JavaScript needed to support framework features */
+        if (_anchorState.id != null) {
+            HttpServletRequest request = JspUtil.getRequest(getJspContext());
+            String script = renderNameAndId(request, _anchorState, null);
+            _anchorCellModel.setJavascript(script);
+        }
+
         DECORATOR.decorate(getJspContext(), appender, _anchorCellModel);
     }
 

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Caption.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Caption.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Caption.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Caption.java
 Mon Apr 25 14:54:34 2005
@@ -22,6 +22,7 @@
 import javax.servlet.jsp.tagext.JspFragment;
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.JspContext;
+import javax.servlet.http.HttpServletRequest;
 
 import org.apache.beehive.netui.tags.AbstractSimpleTag;
 import org.apache.beehive.netui.tags.html.HtmlConstants;
@@ -32,6 +33,7 @@
 import 
org.apache.beehive.netui.databinding.datagrid.api.rendering.DataGridTagModel;
 import org.apache.beehive.netui.databinding.datagrid.api.rendering.StyleModel;
 import 
org.apache.beehive.netui.databinding.datagrid.runtime.rendering.table.TableRenderer;
+import org.apache.beehive.netui.databinding.datagrid.runtime.util.JspUtil;
 import org.apache.beehive.netui.util.Bundle;
 
 /**
@@ -40,7 +42,7 @@
  * @netui.tldx:tag whitespace="indent" renderer=""
  */
 public class Caption
-        extends AbstractSimpleTag {
+    extends AbstractDataGridHtmlTag {
 
     private CaptionTag.State _captionTag = new CaptionTag.State();
 
@@ -234,6 +236,22 @@
         _captionTag.registerAttribute(AbstractHtmlState.ATTR_GENERAL, 
HtmlConstants.TITLE, title);
     }
 
+    /**
+     * Set the name of the tagId for the caption.
+     *
+     * @param tagId - the the name of the tagId for the caption.
+     * @jsptagref.attributedescription The tagId.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_tagId</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="String value. Sets the id (or name) attribute of the 
rendered HTML tag. "
+     * @netui.tldx:attribute category="general"
+     */
+    public void setTagId(String tagId)
+        throws JspException {
+        applyTagId(_captionTag, tagId);
+    }
+
     public void doTag()
             throws IOException, JspException {
 
@@ -245,6 +263,12 @@
         if(dgm.getRenderState() == DataGridTagModel.RENDER_STATE_CAPTION) {
             JspFragment fragment = getJspBody();
             if(fragment != null) {
+                String captionScript = null;
+                if(_captionTag.id != null) {
+                    HttpServletRequest request = 
JspUtil.getRequest(getJspContext());
+                    captionScript = renderNameAndId(request, _captionTag, 
null);
+                }
+
                 StringWriter sw = new StringWriter();
                 TableRenderer tableRenderer = dgm.getTableRenderer();
                 StyleModel stylePolicy = dgm.getStyleModel();
@@ -259,6 +283,9 @@
                 appender.append(sw.toString());
 
                 tableRenderer.closeCaption(appender);
+
+                if(captionScript != null)
+                    appender.append(captionScript);
             }
         }
     }

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java
 Mon Apr 25 14:54:34 2005
@@ -54,19 +54,20 @@
  * @netui.tldx:tag whitespace="indent" 
renderer="workshop.netui.jspdesigner.tldx.GridRenderer"
  */
 public class DataGrid
-    extends AbstractSimpleTag
+    extends AbstractDataGridHtmlTag
     implements IDataAccessProvider, IBehaviorConsumer {
 
     private static final String FACET_RESOURCE = "resource";
 
+    private boolean _renderRowGroups = false;
     private String _name = null;
     private String _styleClassPrefix = null;
     private String _stylePolicyName = null;
     private String _dataSource = null;
     private String _resourceBundlePath = null;
-    private boolean _renderRowGroups = false;
     private DataGridConfig _dataGridConfig = null;
     private DataGridTagModel _dataGridTagModel = null;
+    private TableTag.State _tableTag = new TableTag.State();
 
     public String getTagName() {
         return "DataGrid";
@@ -144,6 +145,22 @@
     }
 
     /**
+     * Set the name of the tagId for the table tag.
+     *
+     * @param tagId - the the name of the tagId for the table tag.
+     * @jsptagref.attributedescription The tagId.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_tagId</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="String value. Sets the id (or name) attribute of the 
rendered HTML tag. "
+     * @netui.tldx:attribute category="general"
+     */
+    public void setTagId(String tagId)
+        throws JspException {
+        applyTagId(_tableTag, tagId);
+    }
+
+    /**
      * @param name
      * @param value
      * @param facet
@@ -197,6 +214,12 @@
 
         JspFragment fragment = getJspBody();
         if(fragment != null) {
+            String javascript = null;
+            /* render any JavaScript needed to support framework features */
+            if (_tableTag.id != null) {
+                javascript = renderNameAndId(request, _tableTag, null);
+            }
+
             boolean addedDataAccessProvider = false;
             try {
                 InternalStringBuilder builder = new 
InternalStringBuilder(2048);
@@ -226,9 +249,8 @@
                 if(!_dataGridTagModel.isDisableDefaultPagerRendering())
                     _dataGridTagModel.renderPager(appender);
 
-                TableTag.State tableState = new TableTag.State();
-                tableState.styleClass = styleModel.getTableClass();
-                tableRenderer.openTable(tableState, appender);
+                _tableTag.styleClass = styleModel.getTableClass();
+                tableRenderer.openTable(_tableTag, appender);
 
                 /* render the caption */
                 
_dataGridTagModel.changeRenderState(DataGridTagModel.RENDER_STATE_CAPTION);
@@ -284,6 +306,9 @@
 
                 tableRenderer.closeTable(appender);
 
+                if(javascript != null)
+                    appender.append(javascript);
+                
                 
_dataGridTagModel.changeRenderState(DataGridTagModel.RENDER_STATE_END);
 
                 write(builder.toString());

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Footer.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Footer.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Footer.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Footer.java
 Mon Apr 25 14:54:34 2005
@@ -22,6 +22,7 @@
 import javax.servlet.jsp.tagext.JspFragment;
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.JspContext;
+import javax.servlet.http.HttpServletRequest;
 
 import org.apache.beehive.netui.tags.AbstractSimpleTag;
 import org.apache.beehive.netui.tags.IHtmlEvents;
@@ -35,6 +36,7 @@
 import 
org.apache.beehive.netui.databinding.datagrid.api.rendering.DataGridTagModel;
 import org.apache.beehive.netui.databinding.datagrid.api.rendering.StyleModel;
 import 
org.apache.beehive.netui.databinding.datagrid.runtime.rendering.table.TableRenderer;
+import org.apache.beehive.netui.databinding.datagrid.runtime.util.JspUtil;
 import org.apache.beehive.netui.util.Bundle;
 
 /**
@@ -44,8 +46,8 @@
  * @netui.tldx:tag whitespace="indent" renderer=""*
  */
 public class Footer
-        extends AbstractSimpleTag
-        implements IHtmlEvents, IHtmlI18n {
+    extends AbstractDataGridHtmlTag
+    implements IHtmlEvents, IHtmlI18n {
 
     private TFootTag.State _tfootTag = new TFootTag.State();
 
@@ -325,6 +327,22 @@
         _tfootTag.registerAttribute(AbstractHtmlState.ATTR_GENERAL, 
HtmlConstants.DIR, dir);
     }
 
+    /**
+     * Set the name of the tagId for the tfoot tag.
+     *
+     * @param tagId - the the name of the tagId for the tfoot tag.
+     * @jsptagref.attributedescription The tagId.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_tagId</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="String value. Sets the id (or name) attribute of the 
rendered HTML tag. "
+     * @netui.tldx:attribute category="general"
+     */
+    public void setTagId(String tagId)
+        throws JspException {
+        applyTagId(_tfootTag, tagId);
+    }
+
     public void doTag()
             throws IOException, JspException {
 
@@ -337,6 +355,7 @@
         if(dgm.getRenderState() == DataGridTagModel.RENDER_STATE_FOOTER) {
             JspFragment fragment = getJspBody();
             if(fragment != null) {
+
                 StringWriter sw = new StringWriter();
 
                 TableRenderer tableRenderer = dgm.getTableRenderer();
@@ -363,8 +382,18 @@
 
                 tableRenderer.closeFooterRow(appender);
 
-                if(dgm.isRenderRowGroups())
+                if(dgm.isRenderRowGroups()) {
                     tableRenderer.closeTableFoot(appender);
+
+                    String tfootScript = null;
+                    if(_tfootTag.id != null) {
+                        HttpServletRequest request = 
JspUtil.getRequest(getJspContext());
+                        tfootScript = renderNameAndId(request, _tfootTag, 
null);
+                    }
+
+                    if(tfootScript != null)
+                        appender.append(tfootScript);
+                }
             }
         }
     }

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/GetDataGridState.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/GetDataGridState.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/GetDataGridState.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/GetDataGridState.java
 Mon Apr 25 14:54:34 2005
@@ -31,7 +31,7 @@
  * @netui.tldx:tag whitespace="indent"
  */
 public class GetDataGridState
-        extends AbstractSimpleTag {
+    extends AbstractSimpleTag {
 
     private String _var = null;
     private String _name = null;

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Header.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Header.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Header.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Header.java
 Mon Apr 25 14:54:34 2005
@@ -24,6 +24,7 @@
 import javax.servlet.jsp.tagext.JspFragment;
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.JspContext;
+import javax.servlet.http.HttpServletRequest;
 
 import org.apache.beehive.netui.tags.AbstractSimpleTag;
 import org.apache.beehive.netui.tags.IHtmlI18n;
@@ -37,6 +38,7 @@
 import 
org.apache.beehive.netui.databinding.datagrid.api.rendering.DataGridTagModel;
 import org.apache.beehive.netui.databinding.datagrid.api.rendering.StyleModel;
 import 
org.apache.beehive.netui.databinding.datagrid.runtime.rendering.table.TableRenderer;
+import org.apache.beehive.netui.databinding.datagrid.runtime.util.JspUtil;
 import org.apache.beehive.netui.util.Bundle;
 
 /**
@@ -45,8 +47,8 @@
  * @netui.tldx:tag whitespace="indent"
  */
 public class Header
-        extends AbstractSimpleTag
-        implements IHtmlEvents, IHtmlI18n {
+    extends AbstractDataGridHtmlTag
+    implements IHtmlEvents, IHtmlI18n {
 
     private THeadTag.State _theadTag = new THeadTag.State();
 
@@ -326,6 +328,22 @@
         _theadTag.registerAttribute(AbstractHtmlState.ATTR_GENERAL, 
HtmlConstants.DIR, dir);
     }
 
+    /**
+     * Set the name of the tagId for the thead tag.
+     *
+     * @param tagId - the the name of the tagId for the thead tag.
+     * @jsptagref.attributedescription The tagId.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_tagId</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="String value. Sets the id (or name) attribute of the 
rendered HTML tag. "
+     * @netui.tldx:attribute category="general"
+     */
+    public void setTagId(String tagId)
+        throws JspException {
+        applyTagId(_theadTag, tagId);
+    }
+
     public void doTag()
             throws JspException, IOException {
 
@@ -337,7 +355,6 @@
         int gridRenderState = dgm.getRenderState();
         if(gridRenderState == DataGridTagModel.RENDER_STATE_HEADER) {
 
-            /* todo: replace StringBuilderRenderAppender with 
WriteRenderAppender */
             InternalStringBuilder content = new InternalStringBuilder();
             AbstractRenderAppender appender = new 
StringBuilderRenderAppender(content);
 
@@ -365,8 +382,17 @@
 
             tableRenderer.closeHeaderRow(appender);
 
-            if(dgm.isRenderRowGroups())
+            if(dgm.isRenderRowGroups()) {
                 tableRenderer.closeTableHead(appender);
+                String tfootScript = null;
+                if(_theadTag.id != null) {
+                    HttpServletRequest request = 
JspUtil.getRequest(getJspContext());
+                    tfootScript = renderNameAndId(request, _theadTag, null);
+                }
+
+                if(tfootScript != null)
+                    appender.append(tfootScript);
+            }
 
             jspContext.getOut().write(content.toString());
         }

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/HeaderCell.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/HeaderCell.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/HeaderCell.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/HeaderCell.java
 Mon Apr 25 14:54:34 2005
@@ -22,6 +22,7 @@
 import java.util.ArrayList;
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.JspFragment;
+import javax.servlet.http.HttpServletRequest;
 
 import org.apache.beehive.netui.tags.IBehaviorConsumer;
 import org.apache.beehive.netui.tags.IAttributeConsumer;
@@ -514,6 +515,23 @@
         _cellState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, 
HtmlConstants.SCOPE, scope);
     }
 
+    /**
+     * Set the name of the tagId for the th tag.
+     *
+     * @param tagId - the the name of the tagId for the th tag.
+     * @jsptagref.attributedescription The tagId.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_tagId</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="String value. Sets the id (or name) attribute of the 
rendered HTML tag. "
+     * @netui.tldx:attribute category="general"
+     */
+    public void setTagId(String tagId)
+        throws JspException {
+        applyIndexedTagId(_cellState, tagId);
+    }
+
+
     public void setAttribute(String name, String value, String facet) throws 
JspException {
         if(facet != null && facet.equals(ATTRIBUTE_HEADER_NAME)) {
             super.addStateAttribute(_cellState, name, value);
@@ -585,6 +603,16 @@
         tableRenderer.openHeaderCell(_cellState, appender);
         renderHeaderCellContents(appender);
         tableRenderer.closeHeaderCell(appender);
+
+        /* render any JavaScript needed to support framework features */
+        if (_cellState.id != null) {
+            HttpServletRequest request = JspUtil.getRequest(getJspContext());
+            String script = renderNameAndId(request, _cellState, null);
+
+            if(script != null)
+                appender.append(script);
+        }
+
     }
 
     protected void renderHeaderCellContents(AbstractRenderAppender appender)

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java
 Mon Apr 25 14:54:34 2005
@@ -18,6 +18,7 @@
 package org.apache.beehive.netui.tags.databinding.datagrid;
 
 import javax.servlet.jsp.JspException;
+import javax.servlet.http.HttpServletRequest;
 
 import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender;
 import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
@@ -29,6 +30,7 @@
 import org.apache.beehive.netui.databinding.datagrid.api.rendering.CellModel;
 import 
org.apache.beehive.netui.databinding.datagrid.runtime.model.cell.ImageAnchorCellModel;
 import 
org.apache.beehive.netui.databinding.datagrid.runtime.rendering.cell.ImageAnchorCellDecorator;
+import org.apache.beehive.netui.databinding.datagrid.runtime.util.JspUtil;
 import org.apache.beehive.netui.util.ParamHelper;
 
 /**
@@ -37,8 +39,8 @@
  * @netui.tldx:tag whitespace="indent"
  */
 public class ImageAnchorCell
-        extends AbstractHtmlTableCell
-        implements IFormattable, IUrlParams {
+    extends AbstractHtmlTableCell
+    implements IFormattable, IUrlParams {
 
     /*
       todo: support rolloverImage on the <img> tags
@@ -589,6 +591,38 @@
         _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, 
HtmlConstants.WIDTH, width);
     }
 
+    /**
+     * Set the name of the tagId for the image.
+     *
+     * @param tagId - the the name of the tagId for the image.
+     * @jsptagref.attributedescription The tagId.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_tagId</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="String value. Sets the id (or name) attribute of the 
rendered HTML tag. "
+     * @netui.tldx:attribute category="general"
+     */
+    public void setTagId(String tagId)
+        throws JspException {
+        applyIndexedTagId(_imageState, tagId);
+    }
+
+    /**
+     * Set the name of the tagId for the anchor.
+     *
+     * @param tagId - the the name of the tagId for the anchor.
+     * @jsptagref.attributedescription The tagId.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_tagId</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="String value. Sets the id (or name) attribute of the 
rendered HTML tag. "
+     * @netui.tldx:attribute category="general"
+     */
+    public void setAnchorTagId(String tagId)
+        throws JspException {
+        applyIndexedTagId(_anchorState, tagId);
+    }
+
     public void setAttribute(String name, String value, String facet)
             throws JspException {
         if(facet == null || facet.equals(ANCHOR_FACET_NAME))
@@ -608,6 +642,23 @@
         assert DECORATOR != null;
         assert appender != null;
         assert _imageAnchorCellModel != null;
+
+        String script = null;
+        /* render any JavaScript needed to support framework features */
+        if (_imageState.id != null) {
+            HttpServletRequest request = JspUtil.getRequest(getJspContext());
+            script = renderNameAndId(request, _imageState, null);
+        }
+
+        /* render any JavaScript needed to support framework features */
+        if (_anchorState.id != null) {
+            HttpServletRequest request = JspUtil.getRequest(getJspContext());
+            String anchorScript = renderNameAndId(request, _anchorState, null);
+            if(anchorScript != null)
+                script = (script != null ? script += anchorScript : 
anchorScript);                    
+        }
+
+        _imageAnchorCellModel.setJavascript(script);
 
         DECORATOR.decorate(getJspContext(), appender, _imageAnchorCellModel);
     }

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageCell.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageCell.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageCell.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageCell.java
 Mon Apr 25 14:54:34 2005
@@ -18,10 +18,12 @@
 package org.apache.beehive.netui.tags.databinding.datagrid;
 
 import javax.servlet.jsp.JspException;
+import javax.servlet.http.HttpServletRequest;
 
 import org.apache.beehive.netui.databinding.datagrid.api.rendering.CellModel;
 import 
org.apache.beehive.netui.databinding.datagrid.runtime.model.cell.ImageCellModel;
 import 
org.apache.beehive.netui.databinding.datagrid.runtime.rendering.cell.ImageCellDecorator;
+import org.apache.beehive.netui.databinding.datagrid.runtime.util.JspUtil;
 import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
 import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender;
 import org.apache.beehive.netui.tags.rendering.ImageTag;
@@ -320,6 +322,22 @@
         _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, 
HtmlConstants.ALT, alt);
     }
 
+    /**
+     * Set the name of the tagId for the image.
+     *
+     * @param tagId - the the name of the tagId for the image.
+     * @jsptagref.attributedescription The tagId.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_tagId</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="String value. Sets the id (or name) attribute of the 
rendered HTML tag. "
+     * @netui.tldx:attribute category="general"
+     */
+    public void setTagId(String tagId)
+        throws JspException {
+        applyIndexedTagId(_imageState, tagId);
+    }
+
     public void setAttribute(String name, String value, String facet)
             throws JspException {
         if(facet == null || facet.equals(IMAGE_FACET_NAME))
@@ -329,6 +347,13 @@
     }
 
     protected void renderDataCellContents(AbstractRenderAppender appender, 
String jspFragmentOutput) {
+        /* render any JavaScript needed to support framework features */
+        if (_imageState.id != null) {
+            HttpServletRequest request = JspUtil.getRequest(getJspContext());
+            String script = renderNameAndId(request, _imageState, null);
+            _imageCellModel.setJavascript(script);
+        }
+
         DECORATOR.decorate(getJspContext(), appender, _imageCellModel);
     }
 

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/RenderPager.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/RenderPager.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/RenderPager.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/RenderPager.java
 Mon Apr 25 14:54:34 2005
@@ -31,7 +31,7 @@
  * @netui.tldx:tag renderer="" whitespace="indent"
  */
 public class RenderPager
-        extends AbstractSimpleTag {
+        extends AbstractDataGridHtmlTag {
 
     public String getTagName() {
         return "RenderPager";

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/Rows.java
 Mon Apr 25 14:54:34 2005
@@ -24,10 +24,12 @@
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.JspContext;
 import javax.servlet.jsp.tagext.JspFragment;
+import javax.servlet.http.HttpServletRequest;
 
 import 
org.apache.beehive.netui.databinding.datagrid.api.rendering.DataGridTagModel;
 import org.apache.beehive.netui.databinding.datagrid.api.rendering.StyleModel;
 import 
org.apache.beehive.netui.databinding.datagrid.runtime.rendering.table.TableRenderer;
+import org.apache.beehive.netui.databinding.datagrid.runtime.util.JspUtil;
 import org.apache.beehive.netui.tags.AbstractSimpleTag;
 import org.apache.beehive.netui.tags.IHtmlEvents;
 import org.apache.beehive.netui.tags.IHtmlI18n;
@@ -47,8 +49,8 @@
  * whitespace="indent" requiredparent="dataGrid"
  */
 public class Rows
-        extends AbstractSimpleTag
-        implements IHtmlEvents, IHtmlI18n {
+    extends AbstractDataGridHtmlTag
+    implements IHtmlEvents, IHtmlI18n {
 
     private TBodyTag.State _tbodyTag = new TBodyTag.State();
 
@@ -328,8 +330,24 @@
         _tbodyTag.registerAttribute(AbstractHtmlState.ATTR_GENERAL, 
HtmlConstants.DIR, dir);
     }
 
+    /**
+     * Set the name of the tagId for the tbody tag.
+     *
+     * @param tagId - the the name of the tagId for the tbody tag.
+     * @jsptagref.attributedescription The tagId.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_tagId</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="String value. Sets the id (or name) attribute of the 
rendered HTML tag. "
+     * @netui.tldx:attribute category="general"
+     */
+    public void setTagId(String tagId)
+        throws JspException {
+        applyTagId(_tbodyTag, tagId);
+    }
+
     public void doTag()
-            throws IOException, JspException {
+        throws IOException, JspException {
 
         JspContext jspContext = getJspContext();
         DataGridTagModel dataGridModel = 
DataGridUtil.getDataGridTagModel(jspContext);
@@ -337,6 +355,7 @@
             throw new 
JspException(Bundle.getErrorString("DataGridTags_MissingDataGridModel"));
 
         if(dataGridModel.getRenderState() == 
DataGridTagModel.RENDER_STATE_GRID) {
+
             StyleModel styleModel = dataGridModel.getStyleModel();
             assert styleModel != null;
 
@@ -351,24 +370,44 @@
                 tableRenderer.openTableBody(_tbodyTag, appender);
 
             while(dataGridModel.hasNextDataItem()) {
-                StringWriter sw = new StringWriter();
                 TrTag.State trState = new TrTag.State();
 
+                String trScript = null;
+                if(trState.id != null) {
+                    HttpServletRequest request = 
JspUtil.getRequest(getJspContext());
+                    trScript = renderNameAndId(request, trState, null);
+                }
+
+                StringWriter sw = new StringWriter();
+
                 int index = dataGridModel.getCurrentIndex();
                 if(index % 2 == 0)
                     trState.styleClass = styleModel.getRowClass();
                 else
                     trState.styleClass = styleModel.getAltRowClass();
 
-                tableRenderer.openTableRow(trState, appender);
                 dataGridModel.nextDataItem();
                 fragment.invoke(sw);
+                tableRenderer.openTableRow(trState, appender);
                 content.append(sw.toString());
                 tableRenderer.closeTableRow(appender);
+
+                if(trScript != null)
+                    appender.append(trScript);
             }
 
-            if(dataGridModel.isRenderRowGroups())
+            if(dataGridModel.isRenderRowGroups()) {
                 tableRenderer.closeTableBody(appender);
+
+                String tbodyScript = null;
+                if(_tbodyTag.id != null) {
+                    HttpServletRequest request = 
JspUtil.getRequest(getJspContext());
+                    tbodyScript = renderNameAndId(request, _tbodyTag, null);
+                }
+
+                if(tbodyScript != null)
+                    appender.append(tbodyScript);
+            }
 
             jspContext.getOut().write(content.toString());
         }

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java
 Mon Apr 25 14:54:34 2005
@@ -18,10 +18,12 @@
 package org.apache.beehive.netui.tags.databinding.datagrid;
 
 import javax.servlet.jsp.JspException;
+import javax.servlet.http.HttpServletRequest;
 
 import org.apache.beehive.netui.databinding.datagrid.api.rendering.CellModel;
 import 
org.apache.beehive.netui.databinding.datagrid.runtime.model.cell.SpanCellModel;
 import 
org.apache.beehive.netui.databinding.datagrid.runtime.rendering.cell.SpanCellDecorator;
+import org.apache.beehive.netui.databinding.datagrid.runtime.util.JspUtil;
 import org.apache.beehive.netui.tags.html.HtmlConstants;
 import org.apache.beehive.netui.tags.html.IFormattable;
 import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
@@ -234,6 +236,22 @@
     }
 
     /**
+     * Set the name of the tagId for the span.
+     *
+     * @param tagId - the the name of the tagId for the span.
+     * @jsptagref.attributedescription The tagId.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_tagId</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="String value. Sets the id (or name) attribute of the 
rendered HTML tag. "
+     * @netui.tldx:attribute category="general"
+     */
+    public void setTagId(String tagId)
+        throws JspException {
+        applyIndexedTagId(_spanState, tagId);
+    }
+
+    /**
      * @netui:attribute required="true" rtexprvalue="true"
      */
     public void setValue(String value) {
@@ -249,6 +267,14 @@
     }
 
     protected void renderDataCellContents(AbstractRenderAppender appender, 
String jspFragmentOutput) {
+        /* render any JavaScript needed to support framework features */
+        if (_spanState.id != null) {
+            HttpServletRequest request = JspUtil.getRequest(getJspContext());
+            String script = renderNameAndId(request, _spanState, null);
+            if(script != null)
+                _spanCellModel.setJavascript(script);
+        }
+
         DECORATOR.decorate(getJspContext(), appender, _spanCellModel);
     }
 

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/TemplateCell.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/TemplateCell.java?rev=164665&r1=164664&r2=164665&view=diff
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/TemplateCell.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/TemplateCell.java
 Mon Apr 25 14:54:34 2005
@@ -17,9 +17,6 @@
  */
 package org.apache.beehive.netui.tags.databinding.datagrid;
 
-import java.io.IOException;
-import javax.servlet.jsp.JspException;
-
 import org.apache.beehive.netui.databinding.datagrid.api.rendering.CellModel;
 import 
org.apache.beehive.netui.databinding.datagrid.runtime.model.cell.TemplateCellModel;
 import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender;

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/Controller.jpf
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/Controller.jpf?rev=164665&view=auto
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/Controller.jpf
 (added)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/Controller.jpf
 Mon Apr 25 14:54:34 2005
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package databinding.datagrid.tagid;
+
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
+/**
+ *
+ */
[EMAIL PROTECTED]
+public class Controller
+    extends PageFlowController
+{
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "success",
+                path = "index.jsp") 
+        })
+    public Forward begin()
+    {
+        return new Forward("success");
+    }
+}

Propchange: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/Controller.jpf
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/anchorcell-tagid.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/anchorcell-tagid.jsp?rev=164665&view=auto
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/anchorcell-tagid.jsp
 (added)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/anchorcell-tagid.jsp
 Mon Apr 25 14:54:34 2005
@@ -0,0 +1,20 @@
+<netui-data:dataGrid dataSource="pageScope.stocks" name="portfolio">
+    <netui-data:configurePager pageHref="${pageContext.request.contextPath}"/>
+    <netui-data:header>
+        <netui-data:headerCell headerText="Symbol"/>
+        <netui-data:headerCell headerText="Price"/>
+        <netui-data:headerCell headerText="Web"/>
+        <netui-data:headerCell headerText="Web Image (empty cells)"/>
+        <netui-data:headerCell headerText="Web Image Anchor (empty cells)"/>
+    </netui-data:header>
+    <netui-data:rows>
+        <netui-data:spanCell value="${container.item.symbol}"/>
+        <netui-data:spanCell value="${container.item.price}"/>
+        <netui-data:anchorCell value="${container.item.name}" 
href="${container.item.web}" tagId="symbolAnchor">
+            <netui:parameter name="rowid" value="${container.index}"/>
+            <netui:parameter name="symbol" value="${container.item.symbol}"/>
+        </netui-data:anchorCell>
+        <netui-data:imageCell src="no-such-image.gif"/>
+        <netui-data:imageAnchorCell src="no-such-image.gif"/>
+    </netui-data:rows>
+</netui-data:dataGrid>

Propchange: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/anchorcell-tagid.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/caption-tagid.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/caption-tagid.jsp?rev=164665&view=auto
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/caption-tagid.jsp
 (added)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/caption-tagid.jsp
 Mon Apr 25 14:54:34 2005
@@ -0,0 +1,23 @@
+<netui-data:dataGrid dataSource="pageScope.stocks" name="portfolio">
+    <netui-data:configurePager pageHref="${pageContext.request.contextPath}"/>
+    <netui-data:header>
+        <netui-data:headerCell headerText="Symbol"/>
+        <netui-data:headerCell headerText="Price"/>
+        <netui-data:headerCell headerText="Web"/>
+        <netui-data:headerCell headerText="Web Image (empty cells)"/>
+        <netui-data:headerCell headerText="Web Image Anchor (empty cells)"/>
+    </netui-data:header>
+    <netui-data:rows>
+        <netui-data:spanCell value="${container.item.symbol}"/>
+        <netui-data:spanCell value="${container.item.price}"/>
+        <netui-data:anchorCell value="${container.item.name}" 
href="${container.item.web}" tagId="symbolAnchor">
+            <netui:parameter name="rowid" value="${container.index}"/>
+            <netui:parameter name="symbol" value="${container.item.symbol}"/>
+        </netui-data:anchorCell>
+        <netui-data:imageCell src="${container.item.web}"/>
+        <netui-data:imageAnchorCell src="${container.item.web}"/>
+    </netui-data:rows>
+    <netui-data:caption tagId="captionTagId">
+        This caption intentionally left blank
+    </netui-data:caption>
+</netui-data:dataGrid>

Propchange: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/caption-tagid.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/imageanchorcell-tagid.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/imageanchorcell-tagid.jsp?rev=164665&view=auto
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/imageanchorcell-tagid.jsp
 (added)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/imageanchorcell-tagid.jsp
 Mon Apr 25 14:54:34 2005
@@ -0,0 +1,20 @@
+<netui-data:dataGrid dataSource="pageScope.stocks" name="portfolio">
+    <netui-data:configurePager pageHref="${pageContext.request.contextPath}"/>
+    <netui-data:header>
+        <netui-data:headerCell headerText="Symbol"/>
+        <netui-data:headerCell headerText="Price"/>
+        <netui-data:headerCell headerText="Web"/>
+        <netui-data:headerCell headerText="Web Image (empty cells)"/>
+        <netui-data:headerCell headerText="Web Image Anchor (empty cells)"/>
+    </netui-data:header>
+    <netui-data:rows>
+        <netui-data:spanCell value="${container.item.symbol}"/>
+        <netui-data:spanCell value="${container.item.price}"/>
+        <netui-data:anchorCell value="${container.item.name}" 
href="${container.item.web}">
+            <netui:parameter name="rowid" value="${container.index}"/>
+            <netui:parameter name="symbol" value="${container.item.symbol}"/>
+        </netui-data:anchorCell>
+        <netui-data:imageCell src="no-such-image.gif"/>
+        <netui-data:imageAnchorCell src="no-such-image.gif" 
tagId="webImageAnchor_image" anchorTagId="webimageAnchor_anchor"/>
+    </netui-data:rows>
+</netui-data:dataGrid>

Propchange: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/imageanchorcell-tagid.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/imagecell-tagid.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/imagecell-tagid.jsp?rev=164665&view=auto
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/imagecell-tagid.jsp
 (added)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/imagecell-tagid.jsp
 Mon Apr 25 14:54:34 2005
@@ -0,0 +1,20 @@
+<netui-data:dataGrid dataSource="pageScope.stocks" name="portfolio">
+    <netui-data:configurePager pageHref="${pageContext.request.contextPath}"/>
+    <netui-data:header>
+        <netui-data:headerCell headerText="Symbol"/>
+        <netui-data:headerCell headerText="Price"/>
+        <netui-data:headerCell headerText="Web"/>
+        <netui-data:headerCell headerText="Web Image (empty cells)"/>
+        <netui-data:headerCell headerText="Web Image Anchor (empty cells)"/>
+    </netui-data:header>
+    <netui-data:rows>
+        <netui-data:spanCell value="${container.item.symbol}"/>
+        <netui-data:spanCell value="${container.item.price}"/>
+        <netui-data:anchorCell value="${container.item.name}" 
href="${container.item.web}">
+            <netui:parameter name="rowid" value="${container.index}"/>
+            <netui:parameter name="symbol" value="${container.item.symbol}"/>
+        </netui-data:anchorCell>
+        <netui-data:imageCell src="no-such-image.gif" tagId="webImage"/>
+        <netui-data:imageAnchorCell src="no-such-image.gif"/>
+    </netui-data:rows>
+</netui-data:dataGrid>

Propchange: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/imagecell-tagid.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/index.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/index.jsp?rev=164665&view=auto
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/index.jsp
 (added)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/index.jsp
 Mon Apr 25 14:54:34 2005
@@ -0,0 +1,43 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0"; prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"; 
prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"; 
prefix="netui-template"%>
+<netui-template:template templatePage="../site/template.jsp">
+    <netui-template:setAttribute name="title" value="Data Grid TagID Tests"/>
+    <netui-template:section name="body">
+    <p>
+    <table>
+        <tr><td>Anchor Cell</td></tr>
+        <tr><td><netui:anchor href="legacy-anchorcell.jsp" value="Legacy 
AnchorCell"/></td></tr>
+        <tr><td><netui:anchor href="scriptcontainer-anchorcell.jsp" 
value="ScriptContainer AnchorCell"/></td></tr>
+        <tr><td>Image Cell</td></tr>
+        <tr><td><netui:anchor href="legacy-imagecell.jsp" value="Legacy 
ImageCell"/></td></tr>
+        <tr><td><netui:anchor href="scriptcontainer-imagecell.jsp" 
value="ScriptContainer ImageCell"/></td></tr>
+        <tr><td>ImageAnchor Cell</td></tr>
+        <tr><td><netui:anchor href="legacy-imageanchorcell.jsp" value="Legacy 
ImageAnchorCell"/></td></tr>
+        <tr><td><netui:anchor href="scriptcontainer-imageanchorcell.jsp" 
value="ScriptContainer ImageAnchorCell"/></td></tr>
+        <tr><td>Span Cell</td></tr>
+        <tr><td><netui:anchor href="legacy-spancell.jsp" value="Legacy 
SpanCell"/></td></tr>
+        <tr><td><netui:anchor href="scriptcontainer-spancell.jsp" 
value="ScriptContainer SpanCell"/></td></tr>
+        <tr><td>THead</td></tr>
+        <tr><td><netui:anchor href="legacy-thead.jsp" value="Legacy 
THead"/></td></tr>
+        <tr><td><netui:anchor href="scriptcontainer-thead.jsp" 
value="ScriptContainer THead"/></td></tr>
+        <tr><td>TBody</td></tr>
+        <tr><td><netui:anchor href="legacy-tbody.jsp" value="Legacy 
TBody"/></td></tr>
+        <tr><td><netui:anchor href="scriptcontainer-tbody.jsp" 
value="ScriptContainer TBody"/></td></tr>
+        <tr><td>TFoot</td></tr>
+        <tr><td><netui:anchor href="legacy-tfoot.jsp" value="Legacy 
TFoot"/></td></tr>
+        <tr><td><netui:anchor href="scriptcontainer-tfoot.jsp" 
value="ScriptContainer TFoot"/></td></tr>
+        <tr><td>Caption</td></tr>
+        <tr><td><netui:anchor href="legacy-caption.jsp" value="Legacy 
Caption"/></td></tr>
+        <tr><td><netui:anchor href="scriptcontainer-caption.jsp" 
value="ScriptContainer Caption"/></td></tr>
+        <tr><td>Table</td></tr>
+        <tr><td><netui:anchor href="legacy-table.jsp" value="Legacy 
Table"/></td></tr>
+        <tr><td><netui:anchor href="scriptcontainer-table.jsp" 
value="ScriptContainer Table"/></td></tr>
+        <tr><td>All</td></tr>
+        <tr><td><netui:anchor href="legacy-all.jsp" value="Legacy 
All"/></td></tr>
+        <tr><td><netui:anchor href="scriptcontainer-all.jsp" 
value="ScriptContainer All"/></td></tr>
+    </table>
+    </p>
+    </netui-template:section>
+</netui-template:template>

Propchange: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/legacy-anchorcell.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/legacy-anchorcell.jsp?rev=164665&view=auto
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/legacy-anchorcell.jsp
 (added)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/legacy-anchorcell.jsp
 Mon Apr 25 14:54:34 2005
@@ -0,0 +1,18 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0"; prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"; 
prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"; 
prefix="netui-template"%>
+<%@ taglib prefix="datagrid" 
tagdir="/WEB-INF/tags/org/apache/beehive/netui/test/databinding/tagfiles" %>
+<netui-template:template templatePage="../site/template.jsp">
+    <netui-template:setAttribute name="title" value="Basic Data Grid"/>
+    <netui-template:section name="body">
+    <p>
+    <datagrid:portfolioXmlBean/>
+    <br/>
+    <br/>
+    <%@ include file="anchorcell-tagid.jsp" %>
+    <br/>
+    <br/>
+    </p>
+    </netui-template:section>
+</netui-template:template>

Propchange: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/tagid/legacy-anchorcell.jsp
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to