[ http://issues.apache.org/jira/browse/BEEHIVE-164?page=history ]
     
Daryl Olander resolved BEEHIVE-164:
-----------------------------------

     Assign To: Julie Zhuo  (was: Daryl Olander)
    Resolution: Fixed

This was an unimplemented feature.  It should work correctly now.  I added a 
test to the DRT for this on both Tree and TreeItem:

idmap/tree

> netui treeItem tag does not output non-Legacy id lookup scripts
> ---------------------------------------------------------------
>
>          Key: BEEHIVE-164
>          URL: http://issues.apache.org/jira/browse/BEEHIVE-164
>      Project: Beehive
>         Type: Bug
>   Components: NetUI
>     Versions: V1
>     Reporter: Julie Zhuo
>     Assignee: Julie Zhuo

>
> Here is the JSP used for this test and its html output
> **************** treeItem.jsp ************************
> <%@ page language="java" contentType="text/html;charset=UTF-8"%>
> <%@ taglib prefix="netui" 
> uri="http://beehive.apache.org/netui/tags-html-1.0"%>
> <%@ taglib prefix="netui-data" 
> uri="http://beehive.apache.org/netui/tags-databinding-1.0"%>
> <%@ taglib prefix="netui-template" 
> uri="http://beehive.apache.org/netui/tags-template-1.0"%>
> <netui:html>
>     <head>
>         <netui:base/>
>     </head>
>     <netui:body>
>         <netui:scriptContainer scopeId="one" >
>                 TreeItem(Node) JS Output Test!<br/>
>                 <netui:tree dataSource="pageFlow.tree" selectionAction="back" 
> tagId="t1">
>                     <netui:treeItem expanded="true" 
> tagId="ti1">Item1</netui:treeItem>
>                 </netui:tree>
>        <p id="javaOut"></p>
>        </netui:scriptContainer>
>     </netui:body>
>     <script language="JavaScript" type="text/JavaScript">
>     var p = document.getElementById("javaOut");
>     var tree = document.getElementById("t1");
>     var val = "<b>Document Access</b><br/>";
>     val = val + "TreeItem Scope Id (Legacy Get): <b>" + getScopeId(p) + 
> "</b><br/>";
>     //val = val + "TreeItem Scope Id (non-Legacy Lookup): <b>" + 
> lookupScopeId(document.getElementById(lookupIdByTagId("ti1", p))) + 
> "</b><br/>";
>     val = val + "TreeItem Name: <b>" + getNetuiTagName("ti1", p) + 
> "</b><br/>";
>     //val = val + "TreeItem ID: <b>" + lookupIdByTagId("ti1", p) + 
> "</b><br/>";
>     //val = val + "TreeItem Name By Lookup: <b>" + lookupNameByTagId("ti1", 
> p) + "</b><br/>";
>     p.innerHTML = val;
>     </script>
> </netui:html>
> ********************* html output ****************************
> <!DOCTYPE HTML PUBLIC "//W3C//DTD HTML 4.01 Transitional//EN"
> >
> <html lang="en">
>     <head>
>         <base 
> href="http://localhost:7001/JavaScriptWeb/outputTest/treeItem.jsp";>
>     </head>
>     <body>
>         <div netui:scopeId="one" >
>                 TreeItem(Node) JS Output Test!<br/>
>                 <div>
>    <div id="ti1">
>       <img 
> src="/JavaScriptWeb/resources/beehive/version1/images/linelastnode.gif" 
> style="vertical-align:middle;" border="0" alt="">
>       <a 
> href="/JavaScriptWeb/outputTest/back.do?netui_treeselected=0&netui_treeid=t1">&nbsp;<img
>  src="/JavaScriptWeb/resources/beehive/version1/images/folder_16_pad.gif" 
> style="vertical-align:middle" border="0" alt="Tree Node">&nbsp;Item1&nbsp;</a>
>    </div>
> </div>
>        <p id="javaOut"></p>
>        </div>
> <script language="JavaScript" type="text/JavaScript">
> <!--
> // **** This section contains code that will run when the page is loaded ****
> // 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.one__ti1="ti1"
> // **** This section contains functions typically run as events ****
> // method which will return a real id for a tagId,
> // the tag parameter will be used to find the scopeId for
> // containers that may scope their ids
> function getNetuiTagName(id, tag)
> {
>    var scopeId = getScopeId(tag);
>    if (scopeId == "")
>       return netui_names[id];
>    else
>       return netui_names[scopeId  + "__" + id];
> }
> // This method will walk the hierarchy from the pass element looking for a 
> scopeId.
> // The first scopeId found will be returned or the empty string if a scopeId 
> is not found.
> function getScopeId(tag)
> {
>    if (tag == null || tag.getAttribute == null)
>       return "";
>    var attrVal = tag.getAttribute("netui:scopeId");
>    if (attrVal != null)
>       return attrVal;
>    return getScopeId(tag.parentNode);
> }
> -->
> </script>
> </body>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira

Reply via email to