-
Closing Tornado pages.
How can I close the opened window page from in Tornado.
I would like to be able to close the page based on the lastClick variable.
Something like
if gd.get.lastClick = "applyadd" then
window.close()
endif
This gives me a compilation error because it does not recognizes the window variable.
-
Your problem is that your "if" check is in ASPX code, and your "window.close()" needs to be Javascript.
Try something like
response.write("<script language=javascript>window.close()</script>")
instead.
Thanks,
John
-
Thanks John, it looked promissing, but the </script> in the response.write statement was treated as the end of the <script language="vb" runat="server"> statement at the top of the code and gave me a compilation error.
-
You must have missed a pair of quotes there or something.
When you response.write out "</script>", the ASPX engine doesn't "interpret" that at all, it just sends it out to the browser.
Check your quotes again.
Thanks,
John
-
Here is the line as pasted from the code, I had actualy pasted from your original message.
response.write("<script language=javascript>window.close()</script>" )
Here is the whole code if it helps.
<body onLoad="self.focus()">
<script language="vb" runat="server">
Sub Page_Load(Source as Object, E as EventArgs)
Dim Complaint As New Tornado.Z()
With Complaint
.dbUnit = "7650"
.dbMode = "type=grid| sysind=t"
.dbSkin = "oceanabove"
.dbGridDisplayFlds = "1,2,3,14,4,8,5,6,7"
.dbGridMagicCell = "(;![]^|~/+{})field=14|macro=^9^<br>^10^<br>^11^<br>^12^ ^13^|ty=text|tag=class=ch"
.dbnamemap = "fi=1|alias=First Name,fi=2|alias=Initial,fi=3|alias=Last name,fi=4|alias=Phone,fi=5|alias=Business Name,fi=6|alias=Employer,fi=7|alias=Complainants,f i=8|alias=E-Mail,fi=9|alias=Address 1,fi=10|alias=Address 2,fi=11|alias=City,fi=12|alias=State,fi=13|alias=Z ip,fi=14|alias=Address"
.dbfilterflds = "1,2,3,5,6,7"
.dbValidatorParams = "code=/tornado/Jars|entry=false"
.dbDSN = "pubint"
.dbNavigationItem ="top,bottom,next,prev,filter,add,update,reload "
.dbEditAddFlds = "1,fi=2|type=text|tags=size=1,3,fi=9|type=text|tag s=size=40,fi=10|type=text|tags=size=40,11,fi=12|ty pe=text|tags=size=2,fi=13|type=text|tags=size=10,f i=4|ty=TEXT|mask=USPHONE|event=both|req=false|err= Wrong phone format must be XXX-XXX-XXXX,8,fi=5|type=text|tags=size=40,fi=6|type=text| tags=size=40,fi=7|type=text|tags=size=40"
.dbEditUpdateFlds = "1,fi=2|type=text|tags=size=1,3,fi=9|type=text|tag s=size=40,fi=10|type=text|tags=size=40,11,fi=12|ty pe=text|tags=size=2,fi=13|type=text|tags=size=10,f i=4|ty=TEXT|mask=USPHONE|event=both|req=false|err= Wrong phone format must be XXX-XXX-XXXX,8,fi=5|type=text|tags=size=40,fi=6|type=text| tags=size=40,fi=7|type=text|tags=size=40"
.dbbookmark = "tblOriginator;0"
.dblocaltext = "47=No Complainant found<BR> <BR>Hit the [Back] button to try again"
.dbSQL = "Select * from tblOriginator order by orgID desc"
.dbTextHolder = "Title=Public Integrity Division SYSTEM|subtitle=COMPLAINANT PROCESSING"
.dbpagesize = 10
.ASPdbNET()
End With
Dim GD As New Tornado.Getdata()
if GD.Get_LastClick = "applyadd" then
response.write("<script language=javascript>window.close()</script>" )
end if
End Sub
</script>
If you load this code in FrontPage, you will see that the </script> within the response.write ends the VB script code.
-
I am jumping in here in the middle and trying to understand the application. How can you response.write (JS function) to close a window. I thought JS have to to pre-programmed, send via sendhead or equivalent and then activated by the click. The JS has to check whether click is an 'applyadd' or any designated key then if matched then close window !!!
Am I way off and miss something?
FK
-
OK Let's go back to the beginning, my basic problem is " How can I close a window from tornado". Under certain conditions I want to close the window and go back to the menu(applyadd being one of those conditions). The users find it combersome to have to close the window everytime they add a new client in order to go back to the menu.
I don't really care if it's java or not, I just want to know if I can automaticlly close a window from tornado so it's easier for the users.
-
what mode are you in as you said "close" the window and it sounds like classic but your code indicates a dual display? So, essentially you need an option to close the edit display after the edit action - correct?
FK
-
Here is the scenario, I have a tornado menu opened in it's own window, from this menu I select the client menu item which opens the client window in it's own page leaving the menu opened in the background, they I click the add button to add a new client, I add the data and clik the go button, at this point I want to close the client page so that the menu is now visible and I can select a new menu item. All I want to do is eliminate the manual close they must now do.
-
this situation calls for JS(). I'll look into that (after I launch the new site). But loose windows setup is always not the best as they 'float' and 'hide (covered up)' everywhere. It is a lot easier to keep it in the same wind window as you can make the modules(display or edit) appear and disappear at will by checking on the various stauts which in your case is 'applyadd'.
FK
-
I've looked at another appoach to accomplish what I need, and I looked at your Tab menu with every item openning below the menu. This is perfect for what I need because it makes the menu always available.
Unfortunitely I cannot make it to work, I copied your example and it displays the default page, but the menu does not show, all I get is a gray box above the default page.
I am running version 7.19 and I've runned out of ideas to make it work, do you have an idea of what I could be missing?
Here is my little test code
<script language='vb' runat='server'>
Sub Page_Load(Source as Object, E as EventArgs)
Dim Menu As New Tornado.Z()
With Menu
.dbMenuParams = "ty=3| st=5| Fp=http://www.msn.com | mw=583| mh=60| dw=1000| dh=800 | Ta=left | numberOfRows=1"
.dbMenuData = "l=Home| u=http://www.aspdb.com/default.htm | aspdb | i=Heart , l=ebay| u=http://www.ebay.com/| aspdb | i=Heart, l=PCmag| u=http://www.pcmag.com/| aspdb | i=Heart"
.dbTextHolder = "Title=Tab Menu| sub=Complete multi-row tab menu and display in 3 lines of Code!"
Response.Write("<Center>" & .ASPdbMenu() & "</center>")
End With
End Sub
</script>
-
1. Try the following code by cut and paste. Tell me whether you see 12 tabs in 3 rows of the tab menu.
2. If you do not see that then let me know and we'll sync with the DLL first.
3.If you see the 3 rows then modify the code to fit your need. I do not understand your problem description. Your sample code has only (1) row.
FK
Dim Menu As New Tornado.Z()
With Menu
.dbMenuParams = "type=3| st=aspdbzen| Fp=http://www.yahoo.com | mw=583| mh=60| dw=670| dh=520 | Ta=left | numberOfRows=3"
.dbMenuData = "l=Home| u=http://www.yahoo.com | i=xpicons/new1-05, l=ebay| u=http://www.ebay.com/| i=xpbullets/b05, l=PCmag| u=http://www.pcmag.com/| i=xpshell/new4-096, l=AOL search| u=http://search.aol.com/aolcom/index.jsp| i=xpicons/new1-06, l=FedEX| u=http://www.fedex.com/| i=xpbullets/b06, l=hp| u=http://www.hp.com/| i=xpicons/new1-08, l=SONY| u=http://sony.com/| i=deskpix/desk015, l=wired news| u=http://www.wired.com/news/| i=xpbullets/b09, l=Spencer gifts| u=http://www.spencergifts.com/| i=Heart, l=Grid with user index| u=http://www.aspdb.net/tornado/eg_Gridwithuserindex.aspx| i=xpicons/new2-37, l=Nav Panel #1| u=http://www.aspdb.net/tornado/eg_minibar3.aspx| i=xpicons/new2-01, l=Super Repeater| u=http://www.aspdb.net/tornado/eg_MagicCellRepeater1.aspx| i=xpshell/new4-098"
.dbTextHolder = "Title=Tab Menu| sub=Complete multi-row tab menu and display in 3 lines of Code!"
Response.Write("<Center>" & .ASPdbMenu() & "</center>")
End With
-
Running your code I see the yahoo site with a gray box above it whitout tabs or anything, it just blank.
In my test code, I just wanted one row, it made the code smaller and easier to read.
-
please send me or post here a screen dump. Does not sound right.
FK
-
Here is the source code.
<Center><HEAD><link rel='stylesheet' href='/tornado/css/aspdbzen/Style.css'><link rel='stylesheet' href='/tornado/css/bgcolors3.css'></HEAD>
<div align='center'><table Border=0 cellpadding='1' cellspacing='0' width='70%'><tr><td class='R2'><div align='center'><span class='TL1'>Tab Menu</span></div></td></tr><tr><td class='R1'><div align='center'><p><span class='TL2'>Complete multi-row tab menu and display in 3 lines of Code!</span></p></div></td></tr></table></div><P>
<body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0><center><table class='NB' border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td colspan='2' align='center'><div align='center'><center><table class=NB border='0' cellspacing='0' cellpadding='0' align='center'><tr><td><table class=NB border='0' cellspacing='0' cellpadding='0' width='653' align='center'><tr><td width='100%' align='center'><div align='left'><applet codebase='/tornado/Jars' code='apTabMenu.class' width='583' height='60' mayscript><param name='copyrightnotification' value='ASP-db is copyrighted work, and subjected to full legal protection'>
<param name='pressedItem' value='1'>
<param name='BackColor' value='FFFDF4'>
<param name='tabHighColor' value='E4DFD8'>
<param name='font' value='Arial,10,0'>
<param name='fontColor' value='FFFFFF'>
<param name='fontHighColor' value='46353F'>
<param name='tabColor' value='838087'>
<param name='BorderColor' value='FFFFFF'>
<param name='tabType' value='0'>
<param name='numberOfRows' value='3'>
<param name='bottomLine' value='false'>
<PARAM NAME='st' VALUE='aspdbzen'>
<PARAM NAME='numberOfRows' VALUE='3'>
<PARAM Name='menuitems' value='{Home,http://www.yahoo.com,aspdb,xpicons/new1-05.gif}
{ebay,http://www.ebay.com/,aspdb,xpbullets/b05.gif}
{PCmag,http://www.pcmag.com/,aspdb,xpshell/new4-096.gif}
{AOL search,http://search.aol.com/aolcom/index.j...ns/new1-06.gif}
{FedEX,http://www.fedex.com/,aspdb,xpbullets/b06.gif}
{hp,http://www.hp.com/,aspdb,xpicons/new1-08.gif}
{SONY,http://sony.com/,aspdb,deskpix/desk015.gif}
{wired news,http://www.wired.com/news/,aspdb,xpbullets/b09.gif}
{Spencer gifts,http://www.spencergifts.com/,aspdb,/...Icon/Heart.gif}
{Grid with user index,http://www.aspdb.net/tornado/eg_Grid...ns/new2-37.gif}
{Nav Panel #1,http://www.aspdb.net/tornado/eg_mini...ns/new2-01.gif}
{Super Repeater,http://www.aspdb.net/tornado/eg_Magi...l/new4-098.gif}
'>
</applet></div></td></tr></table></td></tr></table></center></div></td></tr><tr><td width='17'><img src='/tornado/css/aspdbzen/images/spacer.gif' width='17' height='10' border='0'></td><td align='center'><div align='center'><iframe SRC='http://www.yahoo.com' Target='aspdb' width='670' height='520' scrolling='auto' name='aspdb' frameborder='0'></iframe></div></td></tr></table></center></body></center>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|