How can I set "application.caption" property in my WAR build?

I have several Tasks in my build.gradle that allows me to build different WAR files for different client deployments.

I know the “application.caption” property that stores the application caption. Is it possible for me to set this in my build.gradle so that each of my clients can each have a different caption ?

Hi!
You can use custom Login / Main screens here.

Create new screen -> select Login screen (or some Main screen) -> change screen id
In web-app.properties you can see the new property cuba.web.loginScreenId with newly created screen id.

Then set custom value instead of default caption label in screen controller:

@UiController("login1")
@UiDescriptor("ext-login-screen.xml")
public class ExtLoginScreen extends LoginScreen {
    @Inject
    private Label<String> welcomeLabel;

    @Subscribe
    public void onAfterInit(AfterInitEvent event) {
        welcomeLabel.setValue("Custom caption");
    }
}

Regards,
Irina

1 Like