javatypescripteclipse-scout

Eclipse Scout Custom UI for Buttons


I use Eclipse Scout Classic Version 24.1.3. I have a problem with a CustomButton.ts that I wanted to extend. The problem is that the _render() method in my CustomButton is not executed and I don't know why.

I wanted to add more events to my custom button, for example, to track long presses/holds of my button or other events in general.

I have already created a CustomStringField.ts that works fine, but not the CustomButton.ts. In the inherited Java class (AbstractJsonObjectFactory) for checking the instances of the CustomUIs, the correct instance is recognized. The constructors of CustomButton, its adapter and the edited DoubleClickSupport (CustomClickSupport) are executed. The init() method in CustomButton is also executed.

The minimum classes for a connection should be:

Abstract-Java-Class Interface-Java-Class Json-Java-Class (in ui.html) inherited AbstractJsonObjectFactory-Class Typescript-Class Typescript-Class for the Adapter Less-class for CustomButton.ts - this.addContainer(this.$parent, 'custom-button-field', new ButtonLayout(this)); and the Typescript-Class to override the DoubleClickSupport. Since my CustomStringField works, I thought that a CustomButton should be created in the same way, but it doesn't look like it.

Is the _render() in Button really used? Then I should be able to overwrite it like this protected override _render(){...}, right? Or is there an other Method, I can use, to handle new events?


Solution

  • After I copied the original button (as an inherited FormField – CustomButton), the piecewise check that my _render() executes was passed.

    After I saw a different design than the original button on the copied button, I looked for the reason for this.

    The reason my CustomButton is not working as expected is the button for the setting process. If the “process button” property is set to “true”, it will not work. After I set it to “false”, my _render executed.

    Thanks for your comments, this allowed me to exclude or check a few things, even though I came up with the solution in a different way.