CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> IDE/GUI

 Pop up window [Resolved!]

Print topic Send  topic

Author Message
acedrummond


Posts: 90
Posted: 01/08/2011, 8:34 AM

I have an application where I want to be able to apply payments to an invoice that is on screen.

I have added a submit button and can open the payments screen. I did this by configuring the 'return page' value of the submit button.

The payments screen is called by the program as a redirect and there is no option to configure this as a pop up and specify size of the payments page.

While what I have works it requires that the user back arrow to return to the invoice screen.

How can I specify that the return page screen open in a pop up style window along with the size of the window?

Thanks/

_________________
Ace Drummond
View profile  Send private message
andrewi

Posts: 162
Posted: 01/08/2011, 10:36 AM

I guess that the submit button is in a Form on your invoice page. Do you need the Submit button to save data entered into that form before opening the payments page? Or is the invoice page not one you can edit directly.

If you want the button to Submit the Form AND open up another page in a popup window, then that's awkward. (what would you want to be displayed in the original window, for example?)

If you don't need to submit data from the invoice page, then use a Link (can be an image link to look more like a button) to open the popup window. The Link properties do allow you to specify a different target window to open as a popup (or better you can add popup code to the link's onclick event - that allows you to specify size).

This would, of course, leave the invoice page showing in the original window, so when the user closes the popup they see the invoice page as it was.
View profile  Send private message
acedrummond


Posts: 90
Posted: 01/08/2011, 8:53 PM

Hi:

I want to pop up the payments page to enter the payment on top of the invoice page and then once completed close it and return to the invoice p age to update/close out that transaction.

The process is to print the invoice, show it to the client and accept payment. Once payment is in hand and recorded I updae the invoice so that if this client buys any more those transactions already paid for no longer appear on his invoice.

Your solution using a link with an image sounds like it will work for me so I will give that a try and report back once I have done that.

Thanks again,

_________________
Ace Drummond
View profile  Send private message
andrewi

Posts: 162
Posted: 01/09/2011, 4:01 AM

In case it helps, this is the javascript method that I took from CodeCharge's examples.

1. Create a normal link that opens your page with all the parameters you need. Don't set a different target window - for now just get the link working, but opening in the same window.

2. add this javascript code somewhere in the head of the html.
  
<script language="JavaScript" type="text/javascript">  
function popWindow(ctl, intHeight, intWidth, winName){  
        var linkref = ctl.href;  
        var win=window.open(linkref, winName, "left=100,top=10,width="+intWidth+",height="+intHeight+",status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");  
        win.focus();  
        return false;  
}  
</script>  

3. Find your newly created link in the html and add this onclick event:
onclick="JavaScript:return popWindow(this, 100,200, 'WindowName');">  

so the link html ends up looking something like this:
<a href="somepage.asp" onclick="JavaScript:return popWindow(this, 100,200, 'WindowName');">Open Payment Window</a>

Change the "100,200" values in the event to set the popup height and width. The window name is relevant if you have more than one popup link and want them to open in different popup windows.

the popWindow function itself sets the position that the popup window opens, whether it has a toolbar, is sizable, etc which you can change to suit. The function also sets focus on the popup window; without this, its easy for users to lose a popup window behind the main form if they click the link twice.

--- Don't forget that Codecharge has a button image builder if you want to create a button image with text on it.

Andrew
View profile  Send private message
acedrummond


Posts: 90
Posted: 01/09/2011, 9:54 AM


That is very helpful. I actually used the pop up link builder (CCT Pop Up Link) available as a free add on and that work and have been struggling with the image issue.

I want the button look and not the link look for consistency with what I already have on the page.

Was not aware button builder and need to look into that one.

I'll advise once I get a chance to work this through. Thanks again/


_________________
Ace Drummond
View profile  Send private message
acedrummond


Posts: 90
Posted: 01/10/2011, 7:49 AM

Andrew:

The information you gave me put me on the track to solve this and I now have it working.

Given your input I was able to find code that does it all at http://javascript.internet.com/generators/popup-window.html as follows:

<!-- TWO STEPS TO INSTALL POPUP WINDOW:

1. Paste the first into the HEAD of your HTML document
2. Use the code to open the popup page on your site -->

<!-- STEP ONE: Copy this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Idea by: Nic Wolfe -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=1000,height=200');");
}
// End -->
</script>


<!-- STEP TWO: Use the following button code for the new window -->

<form>
<input type=button value="Open the Popup Window" onClick="javascript:popUp('checkout_payment.php')">
</form>

<!-- Script Size: 0.73 KB -->

There is a java code generator there that literally does it all.

My pop up triggered by a button works perfectly now!

Thanks for getting me on the right road.
_________________
Ace Drummond
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.