Re: Problem with NW_WIDGET_FACTORY_window and content loading

Alex Russell <[email protected]>
Newsgroups gmane.comp.windows.devel.netwindows
Organization netWindows.org
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 24 July 2003 1:22 pm, Michael Flanagan wrote:
> I've spun my tires on this and can't figure out what's going on.
>
> I'm dynamically creating a new window widget at runtime given a
> user's onclick event.
>
> The following works just as I'd expect (although I patched
> NW_WIDGET_window_create_load_append to not call
> __env__.addToPageQueue() if url was null or blank):

can you commit that patch? Sounds useful.

> _nwSearchWindow = NW_WIDGET_window_create_load_append(
>	500, 
>	400,
>	100,
>	100,
>	"Customer Search",
>	"",
>	"");
>
> __env__.addToPageQueue(
>	"Broker?env="+
>		tscEnvironment+
>		"&portal=none&template=glb/customer/customerSearch.xml",
>	_nwSearchWindow.contentObj.contentNode,
>	false,
>	_customerSearch = new CustomerSearch(),
>	"constructor");

(whitespace added for readability)

> While the following doesn't work:
>
> _nwSearchWindow = NW_WIDGET_FACTORY_window(
> 	"Customer Search",
> 	100,
>	100,
>	500,
>	400);
// assume document.body.append(_nwSearchWindow.domNode);
> __env__.addToPageQueue(
>	"Broker?env="+
>		tscEnvironment+
>		"&portal=none&template=glb/customer/customerSearch.xml",
>	_nwSearchWindow.contentObj.contentNode,
>	false,
>	_customerSearch = new CustomerSearch(),
>	"constructor");
>
> I can't for the life of me figure out why. All create_load_append
> does is call NW_WIDGET_FACTORY_window and return the window ref.

Yeah, that's really odd. I'll look into it tonight. There's really no 
reason this shouldn't work.

> I then modified NW_WIDGET_window_create_load_append so that I could
> pass it two extra parameters (optionally) and have it set a
> callback method on the addToPageQueue() call. The calling code then
> looks like:

Cna you also commit that patch?

> _nwSearchWindow = NW_WIDGET_window_create_load_append(400, 300,
> 100, 100, "Customer Search", "",
>
> "Broker?env="+tscEnvironment+"&portal=none&template=glb/customer/cu
>stomerSearch.xml", _customerSearch = new CustomerSearch(),
> "constructor");
>
> This works like a charm. I'm still miffed about my direct call to
> NW_WIDGET_FACTORY_window, but would like to know what people think
> about adding the two extra (optional) parameters to
> NW_WIDGET_window_create_load_append?

They're good. Let's nail them in.

Thanks.

- -- 
Alex Russell
[email protected]
[email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

iD8DBQE/IHCAoV0dQ6uSmkYRAqDwAJ4rY6KC9dLxrDZfEBXEAsdFcO6rGACfUbME
2sHvQkWy57v+EBckNtL2ZjA=
=d1LP
-----END PGP SIGNATURE-----


_______________________________________________
The netWindows developers list: [email protected]
http://netwindows.org/mailman/listinfo/devel_netwindows.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.