care for hidden editFields with acceptChannel
authorClaus Gittinger <cg@exept.de>
Mon, 11 Oct 1999 17:54:39 +0200
changeset 1256 38ff328f119b
parent 1255 d5616023622e
child 1257 acb8c0a58ef3
care for hidden editFields with acceptChannel (prevent accept from invisible fields)
MenuEditor.st
--- a/MenuEditor.st	Sat Oct 09 14:21:55 1999 +0200
+++ b/MenuEditor.st	Mon Oct 11 17:54:39 1999 +0200
@@ -2308,7 +2308,7 @@
 tabSelection: aSelection
     "put the section aSelection into the note book
     "
-    |view|
+    |view canvasView|
 
     tabSelection = aSelection ifTrue:[
         ^ self
@@ -2325,7 +2325,21 @@
             view := listOfCanvas at:typeOfCanvas ifAbsentPut:[View new client:self spec:typeOfCanvas].
         ]
     ].
-    self tabCanvasHolder value:view
+
+    "/ before bringing up the new notebook page,
+    "/ we must disable all now invisible input fields ...
+    "/ (otherwise, those would fire on #accept.
+
+    canvasView := self tabCanvasHolder value.
+    canvasView notNil ifTrue:[
+        canvasView allSubViewsDo:[:aComponent |
+            aComponent isInputField ifTrue:[
+                aComponent disableIfInvisible:true
+            ]
+        ]
+    ].
+
+    self tabCanvasHolder value:view.
 
 ! !