1 2 Previous Next 21 Replies Latest reply on Nov 21, 2016 10:44 PM by Markus Schneider

    Scrollable, protected text field

    tays01s

      Is this:

       

           Define a calculation field. If the original field is named GeneralText, then the calculation for this new field would be:

           GeneralText

           Now place this new calculation field on your layout and format it with a scroll bar.

       

      Still the best way to have a protected text field that you can scroll?

        • 1. Re: Scrollable, protected text field
          Johan Hedman

          In Inspector you just do

          Skärmavbild 2016-11-02 kl. 20.11.08.png

           

          Then people can search in the Field, but can not do any changes

          • 2. Re: Scrollable, protected text field
            beverly

            but does it still scroll if the "Browse Mode" is unchecked?

            I don't believe it does. No-entry also disables the scroll if applied to the field in Inspector.

             

            beverly

            1 of 1 people found this helpful
            • 3. Re: Scrollable, protected text field
              Markus Schneider

              no, not accessible, no scrolling

              - create a script-trigger on field/object exit that does a revert record, set that trigger on the fields in a specific layout

              • 4. Re: Scrollable, protected text field
                CICT

                We use an OnObjectEnter trigger to set a global variable to the contents of the field, OnObjectModify to activate if anyone presses a key, warns the user that the field isn't modifiable and resets the field to the value of the global variable and an OnObjectExit to clear the global variable, so the field is protected, but scrolling and selecting the content is still available.

                 

                The advantage of this is that we can selectively let some people edit and others not without worrying about security access privileges. For instance, we have a system where people can leave notes for each other, each user can edit their own notes, but not those added by others.

                 

                Just another approach (p.s. we don't like calculation fields).

                 

                Regards

                Andy

                • 5. Re: Scrollable, protected text field
                  tays01s

                  Exactly, if you uncheck 'Browse' say goodbye to scrolling.

                   

                  Markus: I was indeed intending that 'no access but usable scroll' be on the User-accessible layout, and full access on the developer layout. But could you add a bit of detail to what "create a script-trigger on field/object exit that does a revert record" is to do re. the field on the User layout.

                  • 6. Re: Scrollable, protected text field
                    alecgregory

                    tays01s wrote:

                     

                    Is this:

                     

                    Define a calculation field. If the original field is named GeneralText, then the calculation for this new field would be:

                    GeneralText

                    Now place this new calculation field on your layout and format it with a scroll bar.

                     

                    Still the best way to have a protected text field that you can scroll?

                     

                    If the field is only updated via a script then you can tick the "Prohibit Modification During data entry" auto-enter option to prevent editing and get the scroll bar to work.

                     

                    You can also use a web viewer, but they tend to be a little tricky to integrate into a regular FileMaker layout as fonts / spacing don't always behave as they do in FMPro. It can work well in some circumstances though.

                    • 7. Re: Scrollable, protected text field
                      coherentkris

                      drop a completely empty webviewer over the text box but not the scroll bar. Make sure the z for the webviewer is on top.

                      It may be tricky to size and position the webviewer it right but it can be done

                      • 8. Re: Scrollable, protected text field
                        wimdecorte

                        Or use a web viewer to show the content of the field, that saves having to create another field,

                        1 of 1 people found this helpful
                        • 9. Re: Scrollable, protected text field
                          philmodjunk

                          A word of warning about using the OnObjectEnter trigger to protect a field. You can use drag and drop to modify a field without tripping OnObjectEnter.

                           

                          For FM Go, a popover can be used to produce a scrollable, protected view of a field for which Browse mode access has been blocked via the inspector.

                          1 of 1 people found this helpful
                          • 10. Re: Scrollable, protected text field
                            Markus Schneider

                            OnObjectExit - seems better in this perspective

                            • 11. Re: Scrollable, protected text field
                              alecgregory

                              OnObjectExit doesn't work either. Drag-and-Drop is the worst. Here's what happens when you drag and drop text:

                              1. Text is inserted into field bypassing all triggers
                              2. If the record is not open, the change is committed without firing the OnRecordCommit trigger
                              3. If there is an OnObjectModify trigger on the field then this is fired, but remember that if the record was not already open the drag-and-drop change will have already been committed and fields such as last modification date and any auto-enters will have already been updated. So while you know the field has been modified you are limited in what you can do about it. You can't revert it to it's previous state because the "Revert" script step won't have anything to Revert to because of the implicit commit.

                               

                              There is a partial work around, but it involves putting data validation on every field where drag-and-drop text selection might occur. At least the validation is simple:

                              Get ( RecordOpenState )

                               

                              This will not allow text to be entered into a field via drag-and-drop unless the record is already open. However, you still can't stop users getting that data into the field.

                               

                              There is a FileMaker preference to turn on Drag-and-Drop text selection, but this only affects drag-and-drop within FileMaker, it doesn't prevent users dragging in data from outside the application into fields.

                              1 of 1 people found this helpful
                              • 12. Re: Scrollable, protected text field
                                alecgregory

                                alecgregory wrote:

                                 

                                At least the validation is simple:

                                Get ( RecordOpenState )

                                Though, come to think of it this is fairly likely to cause things like Replace Field Contents, Relookup Field Contents and Import Records to fail. So you'd probably need to script all these things and use a a variable or global field as an additional validation criteria:

                                Get ( RecordOpenState )

                                     or $allowChange_b

                                Alternatively, if you don't care what script is running you can just use:

                                Get ( RecordOpenState )

                                     or Get ( ScriptName )

                                • 13. Re: Scrollable, protected text field
                                  tays01s

                                  I've not understood all the above, but am I correct there are at least 2 choices:

                                  1. On field entry pass contents to a global var and on exit pass contents back so that if the user has messed with them, they are as on entry.

                                  2. Put a blank webviewer over the field. I've never used one of these before; how do I get field contents into it? BTW, this will be on a standalone RunTime solution if that makes a difference.

                                  • 14. Re: Scrollable, protected text field
                                    user19752
                                    There is a FileMaker preference to turn on Drag-and-Drop text selection, but this only affects drag-and-drop within FileMaker, it doesn't prevent users dragging in data from outside the application into fields.

                                    Once I thought this is a bug, but changing this can't protect data since it is preference (user's choice). It is need in file option, layout setting, or field option.

                                    1 2 Previous Next