Problem with NW_WIDGET_FACTORY_window and content loading

Michael Flanagan <[email protected]>
Newsgroups gmane.comp.windows.devel.netwindows
Message-ID <[email protected]>
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):

_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");

While the following doesn't work:

_nwSearchWindow = NW_WIDGET_FACTORY_window("Customer Search", 100, 100, 
500, 400);
__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.

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:

_nwSearchWindow = NW_WIDGET_window_create_load_append(400, 300, 100, 
100, "Customer Search", "",
                    
"Broker?env="+tscEnvironment+"&portal=none&template=glb/customer/customerSearch.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?

--Michael


_______________________________________________
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.