Adam,

Try use the <netui:scriptBlock/> tag. Using this tag you have control
over where you want to put your script relative to the framework
generated scripts. Hope it works out for you. -Julie

<netui:scriptBlock placement="before">
    function refreshPage() {
        window.location.reload(true);
    }  
</netui:scriptBlock>      

-----Original Message-----
From: Adam Jenkins [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 01, 2005 4:28 PM
To: Julie Zhuo
Cc: Beehive Users
Subject: RE: popup onPopupDone example

Do you have to do anything special in the page flow?

I have:

        <netui:imageAnchor border="0" style="float:right"
src="${pageContext.request.contextPath}/${bundle.app.newRequestButton}"
styleClass="imagebutton" action="addNew" popup="true">
                <netui:configurePopup width="300" height="300"
left="100" top="100" resizable="false" onPopupDone="refreshPage"/>
        </netui:imageAnchor>${bundle.app.certificateRequestsLabel}
    </netui-data:caption>

I have a javascript method in the html <head> thus:

    <script language="JavaScript" type="text/JavaScript">
    function refreshPage() {
        window.location.reload(true);
    }
    </script>

The rendered code is:

<a
href="/ConfigurationManager/certs/requests/addNew.do?_netui%3AreturnActi
onViewRenderer=org.apache.beehive.netui.tags.internal.ReturnActionViewRe
nderer&amp;_netui%3AreturnActionCallback=refreshPage"
class="imagebutton" style="float:right"
onclick="Netui_Popup('/ConfigurationManager/certs/requests/addNew.do?_ne
tui%3AreturnActionViewRenderer=org.apache.beehive.netui.tags.internal.Re
turnActionViewRenderer&amp;_netui%3AreturnActionCallback=refreshPage',''
,'top=100,width=300,resizable=0,height=300,left=100',false);return
false;"><img src="/ConfigurationManager/images/new_request_button.png"
border="0"></a>

addNew is just a standard action that sets some page variables and
redirects to a jsp page that closes itself with 'window.close()' when
the user clicks the close button.

When the window closes, nothing happens...the 'onPopupDone' method isn't
called...do I have to declare the jsp page being opened as a popup page?
Or do anything in the action (I can see that
returnActionCallback=refreshPage is being passed into the action...do I
have to do anything special with that to get it working?

Thanks for the assistence
Adam

On Thu, 2005-09-01 at 15:25 -0600, Julie Zhuo wrote:
> Here is a simple example that I has a while ago. It looks you have an
> extra ";" in your onPopupDone attribute. Also, I don't believe we have
a
> way to specify the popup location that is relative to the browser
> window. I hope this is helpful to you.
> 
> Julie
> 
> ******************************
> 
> <netui:html>
>   <head>
>     <title>Page Flow popupFunc Test</title>
>     <netui:base/>
>   </head>
>   <netui:body>
>           <h3>${pageFlow.URI}</h3>
>           
>         <br/>
>         anchor: launch popup with the default onPopupDone funtion
>         <netui:anchor action="goNested" popup="true">
>             <netui:configurePopup width="500" height="500"/>
>             goNested in popup
>         </netui:anchor>
>           
>         <br/>
>         anchor: launch popup with a custom onPopupDone function
>         <netui:anchor action="goNested" popup="true">
>             <netui:configurePopup width="500" height="500"
>                                   onPopupDone="myPopupDoneFunc"/>
>             goNested in popup
>         </netui:anchor>
>         <br/>
>         <p id="javaOut"></p>
>         
>         <netui:scriptBlock placement="before">
>  
>         function myPopupDoneFunc()
>         {
>             var p = document.getElementById("javaOut");
>             var val = "<b>Done function called succesfully!</b><br/>";
>             p.innerHTML = val;
>         }
>  
>         </netui:scriptBlock>      
>  
>   </netui:body>
>   
> 
>  
> </netui:html>
> 
> -----Original Message-----
> From: Adam Jenkins [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, September 01, 2005 2:54 PM
> To: Beehive Users
> Subject: popup onPopupDone example
> 
> Hi All,
> 
> Congrats on making it out of the incubator...well done.
> 
> Does anyone have an example of using onPopupDone in
> netui:configurePopup.  I can't get the following to refresh the page
> when the popup closes:
> 
> <netui:imageAnchor border="0" style="float:right"
>
src="${pageContext.request.contextPath}/${bundle.app.newRequestButton}"
> styleClass="imagebutton" action="addNew" popup="true">
> 
>       <netui:configurePopup width="300" height="300" left="100"
> top="100"
> resizable="false" onPopupDone="window.location.reload( true );"/>
> 
> </netui:imageAnchor>${bundle.app.certificateRequestsLabel}
> 
> Also...is there any way to center a popup in the middle of the
browser?
> 
> Cheers
> Adam
> 
> 
> 


Reply via email to