Details
Description
cf the issue: TDI-38357
The table of tAzureStorageGet, must have a value setup in the table at least.
Right now, to set a field required, we use for example:
public Property<String> localFolder = PropertyFactory.newString("localFolder").setRequired(); //$NON-NLS-1$
Which means: the parameter localFolder must be filled from the UI to have the component working correctly.
But for table, cf:
public RemoteBlobsGetTable remoteBlobsGet = new RemoteBlobsGetTable("remoteBlobsGet"); //$NON-NLS-1$
There is totally no way to setup any "required" here.
We should then maybe add the required for tables... but problem of tables is that it's just a "ComponentProperties", so not sure it makes any sense to set the required here.
We could maybe set every field of the table as required, but it doesn't make any sense also...
Propositions maybe:
1) since the required is more something linked to "UI", maybe we could change to setup:
mainForm.addRow(widget(localFolder).setWidgetType(Widget.DIRECTORY_WIDGET_TYPE).setRequired()); mainForm.addRow(widget(remoteBlobsGet).setWidgetType(Widget.TABLE_WIDGET_TYPE).setRequired());
Then in this case, any field could be setup as required, it's only a choice of display for the client who shows the properties.
2) We should maybe simply enhance every warning / validation in a generic way.
For now we only have things like: if a field has been setup, we have a "ValidationResult", so a possible message to show on the UI for any wrong setup.
Maybe we need something more generic like:
- one method to call in the properties, which will return maybe a list of ValidationResult ?
Then in this case, component could provide to the UI/client a list of warnings / errors in the current setup of the component (with maybe the information of parameter linked the message).
In this case, the setRequired() would be totally no use, since component could simply provide a warning for every wrong setup. (empty / wrong value etc...)