Overriding elements without parent IDs


I’m trying to override tasksTable on BProc addon’s my-tasks screen, but It’s parent vbox and split doesn’t have IDs so I get “Element can’t be overridden (some parent elements lack id attribute)” if I’m trying to do it with id=“tasksTable”.

The provided path and name option also doesn’t work, if I’m trying to do a


like structure or anything similar with the screen’s elements.

Is there a way to extend these kind of elements?


To override these elements, not extend*

Layout of any screen can be manipulated programmatically from the screen controller.
You can add or remove any elements from the components tree, even if some containers don’t have assigned ID (and there can’t be injected).


public class ExtMyTasksBrowse extends MyTasksBrowse {
    private UiComponents uiComponents;

    public void onBeforeShow(BeforeShowEvent event) {
        SplitPanel split = (SplitPanel) getWindow().getComponent(0);
        VBoxLayout vbox1 = (VBoxLayout) split.getOwnComponents().iterator().next();

        Label<String> label = uiComponents.create(Label.TYPE_STRING);
        label.setValue("Customized screen");
        vbox1.add(label, 0);

Also note that in many cases extending the platform screen isn’t the best idea, it may be better to create separate screen from scratch.

1 Like


Yeah, this was my first guess, I was just looking for a better solution since I wanted to add a formatter to a table column without having to use the deprecated setFormatter, and writing a DateFormatter myself.

So programatically it is then, thanks