4 Replies Latest reply on Mar 17, 2012 3:46 PM by philmodjunk

    Trap data entry into drop down panel

    dzittin

      Title

      Trap data entry into drop down panel

      Post

      I have a drop down panel to fill in a field. The value list used by the drop down is populated via a table field which can be added to by the user (another interface).

      One of my users had managed some data corruptions (in the sense of violating proper joins). I discovered that this user typed into the drop down window panel - I had no idea this could be done. I cannot figure out how to prevent this. Is there a way to insist only the value list be used? Some of the things I tried:

      • Manage data base: validation, only allow list. This does not work because it tells you the value is not ok and ask if you want to use it anyway or if I ask for strict typing and the user closes the layout, an apparent default revert occurs leaving the field blank - not good: it has to be a valid member of the list
      • I tried a script trigger: OnObjectKeystroke. For some reason nothing I have tried works properly. The keystroke is intercepted and the user is warned to stick with the drop down list, but the character that was typed in is appended to the valid value or replaces the valid value.
      • I have tried clearing the field by setting it and using clear script step.
      • I have tried, commits, reverts, you name it.
      • Not allowing input through the inspector, but this prevents the drop down from working. Is there a way to tell the inspector to only allow drop down values, no keystrokes?

      There must be a pre-commit buffer where the keystroke is stored - right? How do I clear that if it exists? 

      Ideas appreciated.

      -D

        • 1. Re: Trap data entry into drop down panel
          philmodjunk

          The simplest would be to use a pop up menu instead of a drop down list. If you don't like the beveled block look of the pop up menu, you can hide that look by using transparent borders.

          Validation by value list should work, but you may want to add a validation that the field not be empty.

          You can also use a script trigger but not OnObjectKeystroke. OnObjectKeystroke is tripped again and again for every key that is pressed. Instead, use onObjectExit, OnObjectSave or OnObjectValidate to check the value in the field against the values in the value list at the moment the user exits the field.

          • 2. Re: Trap data entry into drop down panel
            dzittin

            Thanks PMJ, the pop up is simplest way to handle this and I guess I do not have a problem except that I will likely have to revist all layouts with pull downs and change them to be consistent.

            • 3. Re: Trap data entry into drop down panel
              dzittin

              This isn't a big deal, but it is a cosmetic issue for naive users using pop ups.

              My current set up has a panel/button pair. The panel is a popup allows a user to enter size from a value list. The button immediately to the right is titled "Enter New Size" prompts for a new size and does some checking then adds the entry to the size value list. I cannot supply a list of sizes because this is very much a personal thing and will vary from user to user.

              The cosmetic problem is when my product is used for the first time and the tables are clean. When a user clicks on the pop panel the internal message "<no values defined>" occurs. Is there anyway I can change this message so something like: "No size values, click on button to create a new size value"? I suppose I can do this with a trigger that examines for an empty list and somehow prevents the default. I tried the usual trigger conditions and the <no values defined> superceeds anything I do with triggers.

              Again, not a deal breaker, but I am trying to be nice to folks who aren't especially computer literate.

               

              TIA,

              -D

               

              • 4. Re: Trap data entry into drop down panel
                philmodjunk

                Since this value list is based on values from a table, could you add a record to that table with the message you want as the initial configuration for your solution? Once they start to add their own values, a script can remove this record from the solution.