I need set custom component into form. (CustomComponent contains TextField and Button).
TextField Should be required. How I can set Required option correctly (red star symbol should be right of caption)?
To add a CustomComponent on a Form so that it is linked to the form logic, you could extend the
CustomField add-on instead of extending CustomComponent directly. On the other hand, it is not clear to me if in your case the custom component should map to the form data model or not.
For most components (but not e.g. Button), the required indicator is placed by the layout, not the component itself. This also means that you do not have much control over its placement. If you don’t need this in many locations as a general pattern, you could simply place the indicator in the custom field yourself e.g. as an empty label containing the required icon from the runo theme (icons/16/error.png) using a ThemeResource.