Have you had any pattern to access fields in:
- Single instance (org_sourcetype)
- Multiple instances (org_sourcetype1, org_sourcetype2)
Of course, we can hard code when using getControl('org_sourcetype1') but it's lacking the knowledge of the field.
How about if we start a Json definition related to UI Form
var UI = {
HEADER: {
TYPE: 'header_type'
},
DETAIL: {
DEPARTMENT: 'department',
SOURCE_TYPE: 'sourcetype'
},
SUMMARY: {
DEPARTMENT: 'department1',
SOURCE_TYPE: 'sourcetype1'
}
};
// Access
formContext.getControl(UI.HEADER.TYPE) or formContext.getControl(UI.SUMMARY.SOURCE_TYPE)
PROS:
- Easy to indicate fields in case multiple instances
- Readable and maintainable
CONS:
- Changing UI, need to update the JSON to reflect changes, still, need to touch Javascript file.
Any ideas about this?
*This post is locked for comments
I have the same question (0)

Report
All responses (
Answers (