diff src/org/tn5250j/framework/tn5250/Screen5250.java @ 141:13cea57ac61e

test setfield() cursor movement always sets the field contents
author Carl Byington <carl@five-ten-sg.com>
date Sat, 21 Jun 2014 07:30:09 -0700
parents 4fe73e73d4d7
children 8754f293f2fd
line wrap: on
line diff
--- a/src/org/tn5250j/framework/tn5250/Screen5250.java	Fri Jun 20 19:08:47 2014 -0700
+++ b/src/org/tn5250j/framework/tn5250/Screen5250.java	Sat Jun 21 07:30:09 2014 -0700
@@ -2685,21 +2685,11 @@
         ScreenField cf;
 
         if (l >= 0) {
-            if (screenFields.isCurrentFieldHighlightedEntry())
-                unsetFieldHighlighted(screenFields.getCurrentField());
-            int pos = l * numCols + c;
-            int   n = screenFields.getSize();
-            for (int i=0; i<n; i++) {
-                cf = screenFields.getField(i);
-                if (cf.getStartPos() == pos) {
-                    screenFields.setCurrentField(cf);
-                    if (screenFields.isCurrentFieldHighlightedEntry())
-                        setFieldHighlighted(screenFields.getCurrentField());
-                    gotoField(cf);
-                    isInField(pos);
-                    break;
-                }
-            }
+            int position = l * numCols + c;
+            isInField(position, true);
+            cf = screenFields.getCurrentField();
+            lastPos = cf.getStartPos();
+            setDirty(lastPos);
         }
 
         if ((data != null) && (data.length > 0)) {