Ask Reuben – June 12, 2025

BUTTONEDIT … NOTEDITABLE

How can I allow a user to click on a BUTTONEDIT action but not edit the field content directly?

With BUTTONEDIT widgets, a user experience developers wish to cater for is to allow the user to click on a BUTTONEDIT button and trigger the corresponding action, but to prevent the user entering the value directly.

Some user interface needs were …

  • the data is required to be in a complex or certain format and you want to guide the user through selecting a value rather than allowing them to enter the value manually.
  • the value is a summary and you want the user to edit or view the detail in a second screen by clicking on the button.

A typically first approach for this is to make the field NOENTRY or to make a ui.Dialog.setFieldActive call to prevent the user entering a value in this field.  The problem with this approach is that this will also make the buttonedit button inactive as well.  We want the BUTTONEDIT’s button to still be active.

The solution introduced way back in Genero 2.50 was the NOTEDITABLE attribute.  Simply add this attribute to the form item definition in the form file and the action will be active but it will not be possible to edit the field content directly.  The widget will remain in the tab sequence and it will be possible to select and copy to the clipboard the field content.  it will just not be possible to type and change the field value manually, or to paste a value into the field..

The screen snippet below was from this one line of form definition.  The developer does not want the user to edit the location latitude longitude directly, they want the user to click on a button and be directed somewhere where they can enter a valid latitude longitude value, perhaps by clicking on a map.

BUTTONEDIT f01 = formonly.location, NOTEDITABLE, ACTION=map_picker, IMAGE="fa-globe", SCROLL;