Re: Navigating the DOM with netWindows
"David Wynter at roamware" <[email protected]> Thu, 27 Oct 2005 20:01:28 +0100
| Newsgroups | gmane.comp.windows.devel.netwindows |
|---|---|
| Message-ID | <[email protected]> |
Hi,
Not sure if this is now a dead horse, but worth asking the question.
Here is my main screen in it's entirety. I added the example Alert script as
a test. The error the JavaScript debugger gives is
Error ``ReferenceError: __sig__ is not defined'' [xs] in file ``
<http://localhost:8080/secm/servlet/secm>'', line 30, character 0.
Error ``SyntaxError: missing ) after formal parameters'' [xs] in file ``
<http://localhost:8080/secm/resources/global.js>'', line 38, character 27.
Error ``__sig__ is not defined'' [xs] in file ``
<http://localhost:8080/secm/servlet/secm>'', line 25, character 0.
Stopped for error handler.
#0: function (null)() in < <http://localhost:8080/secm/servlet/secm>> line
25
023: alert("...and I feel fine");
024: }
025: __sig__.connectByName(__env__, "onLoad", null, "postOnLoad");
026: __sig__.connectByName(__env__, "onLoad", null, "postOnLoad2");
027: </script>
.
Apart from my included global.js error __sig__ is not defined, I assume it
should be in netWindows.js, because __scripts__ occurs earlier and it is
fine
Also curious about how the urls in my tab elements get resolved, I assume
the first GET fetches this script and then each tab javascript does the GET
necessary to fetch the other ulrs, i.e. 2 round trips to the Servlet?
thanks
David
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
xml:lang="en" lang="en">
<head>
<link rel="stylesheet"
href="http://localhost:8080/secm/resources/style.css.MSIE" type="text/css"
media="screen" title="" ></link>
<script language="JavaScript">
NWconfig = [];
NWconfig["applyThemedStyles"]=false;
NWconfig["widgetPath"]="http://localhost:8080/secm/resources/";
</script>
<script language="JavaScript" type="text/javascript"
src="http://localhost:8080/secm/resources/netWindows.js"></script>
<script language="JavaScript">
//widget includes
__scripts__.require(__config__.widgetPath+"split_pane_widget.js");
__scripts__.require(__config__.widgetPath+"tabbed_pane_widget.js");
__scripts__.require(__config__.widgetPath+"button_widget.js");
</script>
<script language="JavaScript" type="text/javascript" >
function postOnLoad(){
alert("It's the end of the world...");
}
function postOnLoad2(){
alert("...and I feel fine");
}
__sig__.connectByName(__env__, "onLoad", null, "postOnLoad");
__sig__.connectByName(__env__, "onLoad", null, "postOnLoad2");
</script>
<script type="text/javascript"
src="http://localhost:8080/secm/resources/global.js"
language="JavaScript"></script>
<style>
body {
font-size: 11px;
font-family: helvetica, arial, sans-serif;
margin: 0px;
padding: 0px;
background-color: white;
height: 100%;
width: 100%;
position: absolute;
}
div, span, p {
font-size: 11px;
font-family: helvetica, arial, sans-serif;
letter-spacing: 1px;
}
.Button-background-div {
border: 1px solid #dddddd;
background-color: #efefef;
font-size: 10px;
}
.SplitPane-main-table {
position: absolute;
}
.SplitPane-pane-bottom-tr, .SplitPane-pane-bar-tr, .SplitPane-pane-top-tr
{
margin: 0px;
border: 0px;
padding: 0px;
}
.ContentArea-div {
margin: 0px;
padding: 0px;
border: 0px;
}
.SplitPane-pane-td {
margin: 0px;
padding: 0px;
border: 0px;
}
/* A BORDER MUST BE SPECIFIED FOR AT LEAST THE RIGHT TD */
.SplitPane-pane-right-td {
border: 1px solid transparent;
}
.SplitPane-bar-td {
margin: 0px;
padding: 0px;
/* background-color: #c5c5c5; */
background-color: black;
cursor: hand;
}
</style>
</head>
<body>
<div nwType="split_pane" nwAppId="parentPaneSet" vertical="true"
firstPaneSize="600" dragBarWidth="7">
<div nwType="split_pane" nwAppId="childPaneSet" vertical="false"
firstPaneSize="300" dragBarWidth="7">
<div nwType="pane" parseContent="true">
<div nwType="tabbed_pane" width="300" height="600">
<div nwType="tab" name="Search"></div>
<div nwType="split_pane" nwAppId="searchPaneSet" vertical="true"
firstPaneSize="70" dragBarWidth="7">
<div nwType="pane" width="300" url="GeneralSearch.vm"></div>
<div nwType="pane" parseContent="true">
<div nwType="tabbed_pane" width="300" height="523">
<div nwType="tab" name="Stock Search" url="StockSearch.vm"></div>
<div nwType="tab" name="Bond Search" url="BondSearch.vm"></div>
</div>
</div>
</div>
<div nwType="tab" name="Portfolios" url="PortfolioSelect.vm"></div>
<div nwType="tab" name="Schedules" url="ScheduleSelect.vm"></div>
</div>
</div>
<div nwType="pane" parseContent="true">
<div nwType="tabbed_pane" width="100%" height="600">
<div nwType="tab" name="Portfolio Content"
url="PortfolioDetail.vm"></div>
<div nwType="tab" name="Schedule Detail" url="ScheduleDetail.vm"></div>
</div>
</div>
</div>
<div nwType="pane" parseContent="true">
<div nwType="tabbed_pane" width="100%" height="100%">
<div nwType="tab" name="Bond Results" url="BondResults.vm"></div>
<div nwType="tab" name="Stock Results" url="StockResults.vm"></div>
<div nwType="tab" name="Company Results" url="CompanyResults.vm"></div>
</div>
</div>
</div>
</body>
</html>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: 17 October 2005 13:27
> To: netWindws dev list
> Cc: [email protected]
> Subject: [NW-Devel] Navigating the DOM with netWindows
>
> Hi,
>
> Firstly I know that the authors of netWindows have now started
DojoToolkit, but it will not have the widgets I need until v0.3 and my need
is now.
> My question is about how to navigate the DOM.
>
> I have the follow main screen (body only showing)
>
> <body>
> <div nwType="split_pane" nwAppId="parentPaneSet" vertical="true"
firstPaneSize="600" dragBarWidth="7">
> <div nwType="split_pane" nwAppId="childPaneSet" vertical="false"
firstPaneSize="300" dragBarWidth="7">
> <div nwType="pane" parseContent="true">
> <div nwType="tabbed_pane" width="300" height="600">
> <div nwType="tab" name="Search"></div>
> <div nwType="split_pane" nwAppId="searchPaneSet" vertical="true"
firstPaneSize="70" dragBarWidth="7">
> <div nwType="pane" width="300" url="GeneralSearch.vm"></div>
> <div nwType="pane" parseContent="true">
> <div nwType="tabbed_pane" width="300" height="523">
> <div nwType="tab" name="Stock Search" url="StockSearch.vm"></div>
> <div nwType="tab" name="Bond Search" url="BondSearch.vm"></div>
> </div>
> </div>
> </div>
> <div nwType="tab" name="Portfolios" url="PortfolioSelect.vm"></div>
> <div nwType="tab" name="Schedules" url="ScheduleSelect.vm"></div>
> </div>
> </div>
> <div nwType="pane" parseContent="true">
> <div nwType="tabbed_pane" width="100%" height="600">
> <div nwType="tab" name="Portfolio Content"
url="PortfolioDetail.vm"></div>
> <div nwType="tab" name="Schedule Detail"
url="ScheduleDetail.vm"></div>
> </div>
> </div>
> </div>
> <div nwType="pane" parseContent="true">
> <div nwType="tabbed_pane" width="100%" height="100%">
> <div nwType="tab" name="Bond Results" url="BondResults.vm"></div>
> <div nwType="tab" name="Stock Results" url="StockResults.vm"></div>
> <div nwType="tab" name="Company Results" url="CompanyResults.vm"></div>
> </div>
> </div>
> </div>
> </body>
>
> I use Velocity templates to construct my HTML, thus the .vm extensions in
the urls. I have a JSONRPC ( http://oss.metaparadigm.com/jsonrpc/ )
function in each of the *Search.vm that submits an object with search
parameters to the server, which then returns a collection of objects that
will be used to populate the DOM elements in the *Results.vm screens. Not
being particularly > familiiar with JavaScript and netWindows combined I was
wondering how to navigate the DOM to get access to the <table> that will
receive the collection of results object data. all of my tables have an id
set, my plan was to put all RPC and event handling in the main screen.
>
> Is it as simple as document.getElementById('someElementId')? Haven't got
to the point of trying it (more code to write yet) but thought I'd save time
discovering the knowledge by asking.
>
>
> David Wynter
> << File: ATT00156.txt >>
_______________________________________________
The netWindows developers list: [email protected]
http://mail.netwindows.org/mailman/listinfo/devel_netwindows.org