Hi Isomorphic,
I have a use case where the user can configure a mapping from external status values to internal status values. The mapping table looks like this:
I have an unique constraint on (userId, externalStatusValue). Now in my batchUpload DS I link UploadDS.externalStatusValue with Lookup.internalStatusValue via the existing uploadFieldName property.
As you can see this can return many rows (and not just one as required) if I do not also include a condition on userId = currentUserId.
Doing so is easy using an operationBinding and a criteria-tag with a velocity expression for the current user.
Only thing missing is that currently I can not specify this operationBinding via it's operationID in the batchUpload DS-foreignKey definition, as the normal fetch is used here.
I think this is not only limited to batchUpload but could be useful in other settings (e.g. the already happening automatic editor resolval of displayField/valueField for possible values in SelectItems where the DataSourceField has a foreignKey attribute).
What do you think about this? Roughly speaking it is a "optionOperationId in ds.xml (and Java DataSourceField)".
Thank you & Best regards
Blama
I have a use case where the user can configure a mapping from external status values to internal status values. The mapping table looks like this:
- userId: integer
- externalStatusValue: text(20)
- internalStatusValue: text(10)
I have an unique constraint on (userId, externalStatusValue). Now in my batchUpload DS I link UploadDS.externalStatusValue with Lookup.internalStatusValue via the existing uploadFieldName property.
As you can see this can return many rows (and not just one as required) if I do not also include a condition on userId = currentUserId.
Doing so is easy using an operationBinding and a criteria-tag with a velocity expression for the current user.
Only thing missing is that currently I can not specify this operationBinding via it's operationID in the batchUpload DS-foreignKey definition, as the normal fetch is used here.
I think this is not only limited to batchUpload but could be useful in other settings (e.g. the already happening automatic editor resolval of displayField/valueField for possible values in SelectItems where the DataSourceField has a foreignKey attribute).
What do you think about this? Roughly speaking it is a "optionOperationId in ds.xml (and Java DataSourceField)".
Thank you & Best regards
Blama
Comment