Author: dolander Date: Sun Jan 9 13:43:47 2005 New Revision: 124741 URL: http://svn.apache.org/viewcvs?view=rev&rev=124741 Log: This is a future test of nesting ScriptContainers. Adding it so it doesn't get lost, it's currently not run during the DRTs.
Added: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/nesting/ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/nesting/Controller.jpf incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/nesting/index.jsp Added: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/nesting/Controller.jpf Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/nesting/Controller.jpf?view=auto&rev=124741 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/nesting/Controller.jpf Sun Jan 9 13:43:47 2005 @@ -0,0 +1,139 @@ +package idmap.nesting; + +import javax.servlet.http.HttpSession; +import org.apache.beehive.netui.pageflow.FormData; +import org.apache.beehive.netui.pageflow.PageFlowController; +import org.apache.beehive.netui.pageflow.Forward; +import org.apache.beehive.netui.pageflow.annotations.Jpf; + +/** + * This is the default controller for a blank web application. + */ [EMAIL PROTECTED] +public class Controller extends PageFlowController +{ + private String[] _selectOptions = {"Option 1", "Option 2", "Option 3", "Option 4"}; + private Bean _bean = new Bean(); + + public Bean getBean() { + return _bean; + } + + public String[] getSelectOptions() { + return _selectOptions; + } + + @Jpf.Action( + forwards={ + @Jpf.Forward(name="index", path="index.jsp") + } + ) + protected Forward begin() + { + return new Forward("index"); + } + + + /** + * Callback that is invoked when this controller instance is created. + */ + protected void onCreate() + { + } + + /** + * Callback that is invoked when this controller instance is destroyed. + */ + protected void onDestroy(HttpSession session) + { + } + + + @Jpf.Action(forwards = { + @Jpf.Forward(name = "success", + path = "index.jsp") + }) + protected Forward postForm(Bean form) + { + _bean = form; + Forward forward = new Forward("success"); + return forward; + } + + public static class Bean extends FormData + { + private String text1; + + private String text2; + + private String text3; + + private boolean check1; + + private boolean check2; + + public String getText1() + { + return text1; + } + + public void setText1(String value) + { + text1 = value; + } + + public String getText2() + { + return text2; + } + + public void setText2(String value) + { + text2 = value; + } + + public String getText3() + { + return text3; + } + + public void setText3(String value) + { + text3 = value; + } + + public boolean isCheck1() + { + return check1; + } + + public void setCheck1(boolean value) + { + check1 = value; + } + + public boolean isCheck2() + { + return check2; + } + + public void setCheck2(boolean value) + { + check2 = value; + } + } +} + [EMAIL PROTECTED](value= {"<!-- This data is auto-generated. Hand-editing this section is not recommended. -->", +"<view-properties>", +"<pageflow-object id='pageflow:/idmap/simple/Controller.jpf'/>", +"<pageflow-object id='page:index.jsp'><property value='220' name='x'/><property value='100' name='y'/></pageflow-object>", +"<pageflow-object id='formbean:Bean'/>", +"<pageflow-object id='action:postForm.do#idmap.simple.Controller.Bean'><property name='x' value='340'/><property name='y' value='100'/></pageflow-object>", +"<pageflow-object id='forward:[EMAIL PROTECTED]:postForm.do#idmap.simple.Controller.Bean@'/>", +"<pageflow-object id='action-call:@page:[EMAIL PROTECTED]@action:postForm.do#idmap.simple.Controller.Bean@'><property name='elbowsX' value='256,280,280,304'/><property name='elbowsY' value='92,92,92,92'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/></pageflow-object>", +"<pageflow-object id='action:begin.do'><property value='80' name='x'/><property value='100' name='y'/></pageflow-object>", +"<pageflow-object id='forward:[EMAIL PROTECTED]:begin.do@'><property value='116,140,140,164' name='elbowsX'/><property value='92,92,92,92' name='elbowsY'/><property value='East_1' name='fromPort'/><property value='West_1' name='toPort'/><property value='index' name='label'/></pageflow-object>", +"</view-properties>" +}) +interface VIEW_PROPERTIES { } Added: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/nesting/index.jsp Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/nesting/index.jsp?view=auto&rev=124741 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/nesting/index.jsp Sun Jan 9 13:43:47 2005 @@ -0,0 +1,95 @@ +<%@ page language="java" contentType="text/html;charset=UTF-8"%> +<%@ taglib prefix="netui" uri="http://beehive.apache.org/netui/tags-html-1.0"%> + +<netui:html> + <head> + <netui:base/> + </head> + <netui:body> + <p style="color: green">This test will generate multiple nested ScriptContainers + which requires fully qualifying the lookup to find the proper span. There + are two spans with the same tagId inside a ScriptContainer with the same + scopeId. These are then found in a outer ScriptContainer that has + generateScopeId = 'true' so that we create a unique id. This will not + work in the legacy lookups. + </p> + <netui:scriptContainer generateScopeId="true"> + <netui:scriptContainer scopeId="scope"> + <span id="scopeOneSpan" /> + <netui:span tagId="span" value="span[1] inside scopeOneSpan"> + <netui:attribute name="spanId" value="[1]"/> + </netui:span> + </span> + </netui:scriptContainer> + </netui:scriptContainer> + <netui:scriptContainer generateScopeId="true"> + <netui:scriptContainer scopeId="scope"> + <span id="scopeTwoSpan" /> + <netui:span tagId="span" value="span[2] inside scopeTwoSpan"> + <netui:attribute name="spanId" value="[1]"/> + </netui:span> + </span> + </netui:scriptContainer> + </netui:scriptContainer> + <hr> + <p style="color: green">Below we search for each span by the tagId name. We + should find the individual spans. Below the search results there is a dump + of the lookup tables. + </p> + <p id="javaOut"></p> + </netui:body> + <script language="JavaScript" type="text/JavaScript"> + + var p = document.getElementById("javaOut"); + var s1 = document.getElementById("scopeOneSpan"); + var s1 = document.getElementById("scopeTwoSpan"); + + + var val = "<b>Document Access</b><br>"; + +/* + val = val + "Form by id is null: <b>" + + (document.getElementById(lookupIdByTagId("form",s)) == null) + "</b><br>"; + val = val + "Form by name is null: <b>" + + (document[lookupNameByTagId("form",s)] == null) + "</b><br>"; +*/ + val = val + "<br>"; + if (typeof(netui_tagIdMap) != "undefined") { + val = val + "<b>tagIdMap:</b><br>"; + for (var x in netui_tagIdMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdMap[x] + "'<br>"; + } + val = val + "<br>"; + } + else { + val = val + "tagIdMap is <b>undefined</b><br>"; + } + + if (typeof(netui_tagIdNameMap) != "undefined") { + val = val + "<b>tagIdNameMap:</b><br>"; + for (var x in netui_tagIdNameMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdNameMap[x] + "'"; + } + val = val + "<br>"; + } + else { + val = val + "tagIdNameMap is <b>undefined</b><br><br>"; + } + + if (typeof(netui_names) != "undefined") { + val = val + "<b>netui_names (Legacy):</b><br>"; + for (var x in netui_names) { + val = val + "Name '" + x + "' value '" + netui_names[x] + "'"; + } + val = val + "<br>"; + } + else { + val = val + "netui_name (Legacy) is <b>undefined</b><br>"; + } + + p.innerHTML = val; + + </script> +</netui:html> + + \ No newline at end of file
