Re: Problem with NW_WIDGET_FACTORY_window and content loading

Michael Flanagan <[email protected]>
Newsgroups gmane.comp.windows.devel.netwindows
Message-ID <[email protected]>
Alex Russell wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>  
>
>>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.
>
committed.

>>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.
>
Don't bother. My appologies for not being clearer. It's not that I 
forgot to copy the:

document.body.append(_nwSearchWindow.domNode);

into my eamil. It's that I didn't have it in my js src file! That's why 
it wasn't working. I resolved the problem I reported by including this 
line into my code. This is probably something that should go into the 
documentation wrt instantiating new widgets dynamically at runtime. Or 
at least the behavior between NW_WIDGET_window_create_load_append and 
NW_WIDGET_INLINE_FACTORY_window should be normalized. The reason I had 
the problem is that b/c I saw that the create_load_append method 
actually displayed a window, I was expecting the INLINE_FACTORY to do 
the same.

On second though, maybe the factory function shouldn't as none of the 
other widgets seem to from what I recall.

>>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?
>  
>
Also committed.



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