Re: Window widget events not firing
Michael Flanagan <[email protected]>
| Newsgroups | gmane.comp.windows.devel.netwindows |
|---|---|
| Message-ID | <[email protected]> |
Alex Russell wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>On Tuesday 22 July 2003 3:55 pm, Dee Gould wrote:
>
>
>>The buttons are located within the html page that is being loaded
>>into the window widget. netWindows is being loaded into the parent
>>of the iframe ( the window widget ) as well as the iframe itself.
>>
>>
>
>please note that unless you are adding another iframe element into
>your target URL, the contents of the window widget are not in an
>iframe when they display on the page. Just an FYI = )
>
So you can prevent the nw framework from copying the contents out into
the div if you embed another iframe within the content url being loaded?
>we do use an iframe to load the content into the page, but the
>contents are subsequently copied into a content area widget, which is
>just a <div> with smarts. We can use all of these properties to our
>advantage in solving your problem.
>
What about all the app logic that was 'hooked up' using __sig__? Does it
also copy across the instance of customerSearch and any other js objects
instantiated in the window object of the iframe?
>>It's not a cross-frame or cross-window problem. Everything being
>>loaded into the window widget is self contained and I want the
>>window widget to close itself once the cancelButton is clicked.
>>Problem is that the onclick event is not getting fired.
>>
>>
>
>Right. The first problem is that since we don't load things in windows
>into their own iframes (for many reasons, not the least of which is
>memory footprint), a document.getElementById() may not be unique
>should you have multiple windows (or other containers) with that page
>loaded into them. This is a slightly annoying property, but not
>insurmoutable. Instead, netWindows provides you with ways to discover
>your context, and get references to widgets from DOM nodes.
>
>Here's what I'd have your cancelButton call from onClick (directly if
>need be) instead:
>
>onclick="__components__.getComponentFromNode(this).getTopLevelComponent().remove();"
>
This works fine to close the window widget, but doesn't help with the
rest of the app logic which was wired up with stuff like:
__sig__.connectOnceByName(document.getElementById("customerSearch"),
"validate", this, "getCustomer");
__sig__.connectOnceByName(this,"customerGot",
document.getElementById("customerSearch"),
"select");
__sig__.connectOnceByName(document.getElementById("acceptButton"),
"onclick", this, "acceptClicked");
__sig__.connectOnceByName(document.getElementById("addCustomerButton"),
"onclick", this,
"addCustomerClicked");
myTable = new TSCTable( 'customersFound', _drs, _cols, _args );
// 'customersFound' is the id attribute for the table where the results
will be displayed
I guess the question is what is the proper way of writing the
application logic for the front end then if it's contained in a
window_widget?
_______________________________________________
The netWindows developers list: [email protected]
http://netwindows.org/mailman/listinfo/devel_netwindows.org