Monday, March 26, 2012

window.open (javascript function) + atlas

Hi everyone,

I'd like to know how create a simple function under Atlas (I used one before Atlas and it's works very well), like that one:

Sub wOpen(ByVal fWindow As String, ByVal fNameWin As String, ByVal fWidth As Integer, ByVal fHeight As Integer, ByVal fMenu As Boolean, ByVal fResizable As Boolean, ByVal fScroll As Boolean)
Dim strJ As String = "<script language='javascript'>"
strJ &= "window.open('" & fWindow & "', '" & fNameWin & "', "
strJ &= "'width=" & fWidth & ", height=" & fHeight & ", menubar="
If fMenu = True Then
strJ &= "yes"
Else
strJ &= "no"
End If
strJ &= ", resizable="
If fResizable = True Then
strJ &= "yes"
Else
strJ &= "no"
End If
strJ &= ", scrollbars="
If fScroll = True Then
strJ &= "yes"
Else
strJ &= "no"
End If
strJ &= "')<"
strJ &= "/script>"
Page.RegisterClientScriptBlock("wOpen", strJ)
End Sub


But under Atlas when a call it doesn't work:
wOpen(wOpen("http:..", "myWindow", 810, 620, True, True, True)

I really seach about, but I can't find anything about it.

So, if someone can help I really be thanks.

José SP/Brazil

It's me back again, and I've the answer, I just need remove the javascript tag from the code, like that:

Sub wOpen(ByVal fWindowAsString,ByVal fNameWinAsString,ByVal fWidthAsInteger,ByVal fHeightAsInteger,ByVal fMenuAsBoolean,ByVal fResizableAsBoolean,ByVal fScrollAsBoolean)Dim strJAsString

strJ =

"window.open('" & fWindow &"', '" & fNameWin &"', "

strJ &=

"'width=" & fWidth &", height=" & fHeight &", menubar="If fMenu =TrueThen

strJ &=

"yes"Else

strJ &=

"no"EndIf

strJ &=

", resizable="If fResizable =TrueThen

strJ &=

"yes"Else

strJ &=

"no"EndIf

strJ &=

", scrollbars="If fScroll =TrueThen

strJ &=

"yes"Else

strJ &=

"no"EndIf

strJ &=

"')"Me.ClientScript.RegisterStartupScript(Me.GetType(),"wOpen", strJ,True)EndSub

No comments:

Post a Comment