KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Endless loop

 
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic
View previous topic :: View next topic  
Author Message
zymurgist
KiXforms Novice
KiXforms Novice


Joined: 06 Nov 2008
Posts: 2

PostPosted: Thu Nov 06, 2008 11:03 pm    Post subject: Endless loop Reply with quote

When I click the "submit" button I get the message box ""You Chose " + $CELL, "ARE YOU SURE?" which is what I'd expect. I click "ok" and the copy happens, but the same message box and copy occurs. I'm admit that I'm a kix hack, so I know this probably isn't optimal flow. Any suggestions would be appreciated.
Code:



;region ScriptForm Designer

;region Constructor

Break On
$System = CreateObject("KiXtart.System")

;endregion

;region Post-Constructor Custom Code

;endregion

;region Form Creation
;Warning: It is recommended that changes inside this region be handled using the ScriptForm Designer.
;When working with the ScriptForm designer this region and any changes within may be overwritten.

;~~< Form1 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$Form1 = $System.Form()
$Form1.Icon = $System.Icon("Form1.ico")
$Form1.Text = "WCD plugin-cfg.xml changer"
;~~< Button1 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$Button1 = $Form1.Controls.Button()
$Button1.Size = 75, 23
$Button1.Text = "Submit"
$Button1.Location = 120, 93
$Button1.OnClick = "Button1OnClick( $$Button1 )"
;~~< WCD >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$WCD = $Form1.Controls.ComboBox()
$WCD.Cursor = $System.CursorStyle.Hand
$WCD.DropDownStyle = 2
$WCD.Size = 183, 21
$WCD.SelectedIndex = -1
$WCD.List = "CELL01", "CELL02", "LOADBALANCED"
$WCD.Location = 64, 66
;~~< Label1 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$Label1 = $Form1.Controls.Label()
$Label1.Size = 183, 44
$Label1.Text = "Choose the Load Balancing option below that you want traffic routed to."
$Label1.Font = $System.Font("Microsoft Sans Serif", 8.25, 1)
$Label1.Location = 64, 9
;~~< HyperLink1 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$HyperLink1 = $Form1.Controls.HyperLink()
$HyperLink1.Value = "https://bwWCDnd:9043/ibm/console/logon.jsp"
$HyperLink1.Size = 183, 23
$HyperLink1.TabStop = -1
$HyperLink1.Text = "CELL01 WAS ADMIN CONSOLE"
$HyperLink1.Location = 64, 158
;~~< HyperLink2 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$HyperLink2 = $Form1.Controls.HyperLink()
$HyperLink2.Value = "https://bwWCDnd:9044/ibm/console/logon.jsp"
$HyperLink2.Size = 183, 23
$HyperLink2.TabStop = -1
$HyperLink2.Text = "CELL02 WAS ADMIN CONSOLE"
$HyperLink2.Location = 64, 193
$HyperLink2.OnMouseEnter = "Button1OnClick( $$HyperLink2 )"

;endregion

;region Custom Code

;endregion

;region Event Loop

$Form1.Show
While $Form1.Visible
   $ = Execute($System.Application.DoEvents)
Loop
Exit 1

;endregion

;endregion

;region Event Handlers

Function Button1OnClick($object)
   $Cell = $WCD.Text
   Select
      Case $cell = "CELL01"
         MessageBox("You Chose " + $CELL, "ARE YOU SURE?", "4")
         If @ERROR = 6
            Copy "\\LOSRV1\e$\IBMHTTPSERVER\Plugins\config\LOSRV1\PluginCopies\plugin-cfg.node1.xml" "\\LOSRV1\e$\IBMHTTPSERVER\Plugins\config\LOSRV1\plugin-cfg.xml"
            If @ERROR <> 0
               MessageBox("FAILED on LOSRV1", "FAILED", "16")
            Else
               MessageBox("SUCCESSFULLY MOVED TRAFFIC ON LOSRV1 TO  " + $CELL, "SUCCESS", "48")
            EndIf
                                                
            Copy "\\LOSRV2\e$\IBMHTTPSERVER\Plugins\config\LOSRV2\PluginCopies\plugin-cfg.node1.xml" "\\LOSRV2\e$\IBMHTTPSERVER\Plugins\config\LOSRV2\plugin-cfg.xml"
            If @ERROR <> 0
               MessageBox("FAILED on LOSRV2", "FAILED", "16")
            Else
               MessageBox("SUCCESSFULLY MOVED TRAFFIC ON LOSRV2 TO  " + $CELL, "SUCCESS", "48")
            EndIf
         EndIf   
      Case $cell = "CELL02"
         MessageBox("You Chose " + $CELL, "ARE YOU SURE?", "4")
         If @ERROR = 6
            Copy "\\LOSRV1\e$\IBMHTTPSERVER\Plugins\config\LOSRV1\PluginCopies\plugin-cfg.node2.xml" "\\LOSRV1\e$\IBMHTTPSERVER\Plugins\config\LOSRV1\plugin-cfg.xml"
            If @ERROR <> 0
               MessageBox("FAILED on LOSRV1", "FAILED", "16")
            Else
               MessageBox("SUCCESSFULLY MOVED TRAFFIC ON LOSRV1 TO  " + $CELL, "SUCCESS", "48")
            EndIf
                                                
            Copy "\\LOSRV2\e$\IBMHTTPSERVER\Plugins\config\LOSRV2\PluginCopies\plugin-cfg.node2.xml" "\\LOSRV2\e$\IBMHTTPSERVER\Plugins\config\LOSRV2\plugin-cfg.xml"
            If @ERROR <> 0
               MessageBox("FAILED on LOSRV2", "FAILED", "16")
            Else
               MessageBox("SUCCESSFULLY MOVED TRAFFIC ON LOSRV2 TO  " + $CELL, "SUCCESS", "48")
            EndIf
         EndIf
      Case $cell = "LOADBALANCED"
         MessageBox("You Chose " + $CELL, "ARE YOU SURE?", "4")
         If @ERROR = 6
            Copy "\\LOSRV1\e$\IBMHTTPSERVER\Plugins\config\LOSRV1\PluginCopies\plugin-cfg.node0.xml" "\\LOSRV1\e$\IBMHTTPSERVER\Plugins\config\LOSRV1\plugin-cfg.xml"
            If @ERROR <> 0
               MessageBox("FAILED on LOSRV1", "FAILED", "16")
            Else
               MessageBox("SUCCESSFULLY MOVED TRAFFIC ON LOSRV1 TO  " + $CELL, "SUCCESS", "48")
            EndIf
                                                
            Copy "\\LOSRV2\e$\IBMHTTPSERVER\Plugins\config\LOSRV2\PluginCopies\plugin-cfg.node0.xml" "\\LOSRV2\e$\IBMHTTPSERVER\Plugins\config\LOSRV2\plugin-cfg.xml"
            If @ERROR <> 0
               MessageBox("FAILED on LOSRV2", "FAILED", "16")
            Else
               MessageBox("SUCCESSFULLY MOVED TRAFFIC ON LOSRV2 TO  " + $CELL, "SUCCESS", "48")
            EndIf
         EndIf
      Case 1
   EndSelect
                  
                        
EndFunction

;endregion
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri Nov 07, 2008 12:36 am    Post subject: Reply with quote

Try commenting-out this line as a test:

$HyperLink2.OnMouseEnter = "Button1OnClick( $$HyperLink2 )"

OnMouseEnter might be a bit overkill ...

-Shawn
Back to top
View user's profile Send private message
zymurgist
KiXforms Novice
KiXforms Novice


Joined: 06 Nov 2008
Posts: 2

PostPosted: Fri Nov 07, 2008 2:32 am    Post subject: Reply with quote

Duh! I didn't realize that I added that! Thank you. That was the issue.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group