Define a custom Component through composition of existing ones

Hi

Follow-up of this thread : https://www.cuba-platform.com/discuss/t/how-to-generate-standard-bean-validators-for-custom-field.

Currently in CUBA you can create a custom visual Component wrapping Javascript/GWT/Vaadin add-on. But you cannot simply create one through composition of existing built-in Component.

We developped a workaround, but having such a feature natively in CUBA would be a great addition in my eyes.

For instance when you display a price, you always display a currency. In read-only mode this is the combination of a text field for price and a label for the currency. In edit mode, this is the combination of two text fields for price and currency, each one bound to an entity property.

Mike

Hi,

It is really useful idea and we are planning to provide composite custom fields in the future!

The use case I would add is a date range. I want a start and end date to appear together on a form with a single label.

I could imagine this being implemented as a component that binds to an embedded object which contains the individual properties (e.g. amount/current, start/end).

:ticket: See the following issue in our bug tracker:

https://youtrack.cuba-platform.com/issue/PL-8119

In fact there a whole bunch of use cases : anytime you want to fit more than one property in one line of a FieldGroup : date range, Price & Amount witch currency besides, Percentage or any scientific units besides, Title (“Mr”) + Name (“Jack”) on the same line, etc…

With entities having several dozens of attributes, saving space in form is a point.