Hi

Your code is not logical and does not use PWC convention.
You have to use PWC function to open and close window. In your  
submitResolution you should only do win.close().
But as you have set destroyOnClose:true, your window will be destroy  
(remove from the dom).

So I suggest you if you want to use only one window instance:
- remove destroyOnClose:true to keep the window in the DOM when you  
hide it.
- change if( !$('resolutionPopup') ) to if (!win)
- just call win.hide in your function  submitResolution
- and if you want have a your effect on hide/show set them in  
window's constructor showEffect: and hideEffect:

HTH
Seb

On Mar 16, 2007, at 2:02 PM, Web Developer wrote:

> Hello all,
> hmmm I asked this question at the end of a couple other threads so no
> responses yet, and i see some people get responses quickly. Maybe I
> shoulda included the main code instead of link to my webpage that I
> mayeb scared people off by calling it 'popup.html' in it :) hehe.
> Anyway not sure if this is PWC question or more javascript question.
> Thanks if anyone can help (my code listed at bottom of email):
>
>> Cant get the window to close manually in FF, and IE has a few  
>> problems with it as well, so my procedure to duplicate problem:
>> Click on 'Click Here for Browser-Style Popup.', Enter some info,  
>> and hit
>> the input button in that dialog window (it calls a function which
>> removes the popup).
>> Since the window is removed from DOM, you can click on the hyperlink
>> again to recreate a brand-spanking new popup.
>> So I then Click on 'Click Here for Browser-Style Popup.' again,  
>> and hit the
>> X to close the window. It doesnt close it though and gives a  
>> javascript
>> error after a second: 'element.parentNode has no properties'.
>>
>
> //#####CODE
> //so here is the link tio start the popup...
>
> <a onclick="makeMacStylePopup();">Click Here</a> for Browser-Style  
> Popup.
>
> //Now here is code to create the popup, and i want be able to manually
> close it via scrpting, i thought removing it via DOM absolutely got
> rid of it. Yet it seems like it doesnt remove it if you follow steps i
> mentioned above.
>
> var win;
> function makeMacStylePopup()
> {
>
>       if( !$('resolutionPopup') ) //if not already up on the screen,  
> create it
>       {
>               win = new Window({ id:"resolutionPopup", className: "dialog",
> width:350, height:400, zIndex: 100, resizable: true, title: "Sample
> window", showEffect:Effect.BlindDown, hideEffect: Effect.BlindUp,
> draggable:true, wiredDrag: true ,destroyOnClose:true });
>       
>               win.getContent().innerHTML= "<div>Resolution:<br/><textarea
> id='resolution'></textarea><br/><input type='button' value='Submit'
> onclick='submitResolution(this);'/></div>"; //does some specialized
> coding, and then destroys the popup
>               win.setStatusBar("Enter your text above and submit it.");
>               win.showCenter();
>       }
>       else //remind user he has it already open
>       {
>               Effect.Pulsate(win.getId(), {duration: 2, pulses: 3, from: .8} 
> );
>               win.showCenter();
>       }
>
> }
> function submitResolution(popupObj)
> {
>       //alert( 'resolution=' + $('resolution').value ); Use value later to
> fill database
>       
>       //gets rid of and 'destroys' the popup manually by getting its parent
> and removing the popup from that parent.
>       Effect.BlindUp( win.getId() ,{afterFinish: function(){
> alert('Removing: '+win.getId()); var popup = $(win.getId()); var
> popupParent = popup.parentNode; popupParent.removeChild(popup); win =
> null;  } } );
> }
>
> _______________________________________________
> Javawin mailing list
> [email protected]
> http://mail.xilinus.com/mailman/listinfo/javawin_xilinus.com


_______________________________________________
Javawin mailing list
[email protected]
http://mail.xilinus.com/mailman/listinfo/javawin_xilinus.com

Reply via email to