Configuration Screen

Hi,

I need configuration propertys with SourceType.DATABASE
just for storing default textvalues. So far so good. But now
my problem is:
I did not found a way, to enter longtext-values (multiline) into the
standard application configuration.

Is there a way, to force multiline input in the configuration values ?

Thanks
Martin

Hi @martin4977,
I don’t know if I understood exactly what you want to do.

Do you mean being able to set a multiline string in the standard cuba application property editor?
image

If that is the case, there are some alternatives:

  1. Insert the config value directly in database (table SYS_CONFIG).

  2. Use the EntityInspector to create/edit the value you want.
    image

Then I used the property above as a default value for new entities:

    @Inject
    private VisitConfig visitConfig;

    @Subscribe
    public void onInitEntity(InitEntityEvent<Visit> event) {
        event.getEntity().setDescription(visitConfig.getDefaultDescription());
    }

image
3. Create a custom property editor (extend cuba application properties default screen to display a multiline Textfield - AppPropertiesEdit.java and appproperties-edit.xml files).

I recommend the alternatives 1 and 2 because you don’t have to implement anything (but you’ll have to restart the application to update the client cache). Number 3 only if non-admin users will need to update the property values.

Hope it helps.

Regards,
Peterson.

1 Like

Hi Peterson,

thanks for your help.

I think, I am using variant 2. The values are only for sysadmin.

Martin