EAM Extensible Framework

Hi,

 

I am using extensible framework for,

Point 1: protecting some fields on load

Point 1: changing class field values on work order type field.

point 1: onloaddata never works for me so i am using render for disabling field but this works only when work order screen is opened newly not on navigating to multiple work orders at the same time.

 Point 2: When in try to change work order type field even the console does not pop up. i always get in the console is this

app.js?_dc=20180601173721:1 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. 

 

Please suggest me

 

Below is my extensible framework.

 

Ext.define('EAM.custom.external_wsjobs', {
extend: 'EAM.custom.AbstractExtensibleFramework',
getSelectors: function () {
return {

'[extensibleFramework] [tabName=HDR][isTabView=true]': {

render: function() {
var vFocus = this,
vFormPanel = vFocus.getFormPanel(),
vWoStatus = vFormPanel.getFldValue('workorderstatus');

if(vWoStatus == 'R') {

EAM.Builder.setFieldState({'woclass':'protected'},vFormPanel.getForm().getFieldsAndButtons());
EAM.Builder.setFieldState({'department':'protected'},vFormPanel.getForm().getFieldsAndButtons());
EAM.Builder.setFieldState({'equipment':'protected'},vFormPanel.getForm().getFieldsAndButtons());
EAM.Builder.setFieldState({'location':'protected'},vFormPanel.getForm().getFieldsAndButtons());
EAM.Builder.setFieldState({'workordertype':'protected'},vFormPanel.getForm().getFieldsAndButtons());
EAM.Builder.setFieldState({'reportedby':'protected'},vFormPanel.getForm().getFieldsAndButtons());
EAM.Builder.setFieldState({'standardwo':'protected'},vFormPanel.getForm().getFieldsAndButtons());
EAM.Builder.setFieldState({'schedgroup':'protected'},vFormPanel.getForm().getFieldsAndButtons());
EAM.Builder.setFieldState({'assignedto':'protected'},vFormPanel.getForm().getFieldsAndButtons());
EAM.Builder.setFieldState({'schedstartdate':'protected'},vFormPanel.getForm().getFieldsAndButtons());
EAM.Builder.setFieldState({'schedenddate':'protected'},vFormPanel.getForm().getFieldsAndButtons());
EAM.Builder.setFieldState({'datereported':'protected'},vFormPanel.getForm().getFieldsAndButtons());
console.log('LOAD CALLED.....');

}

}
},


'[extensibleFramework] [tabName=HDR][isTabView=true] [name=workordertype]': {

customonblur: function(field) {
console.log('TYPE CALLED.....');

var vFocus1 = field.formPanel,
vFormPanel1 = vFocus1.getFormPanel(),
vWoType = vFormPanel1.getFldValue('workordertype'),
classfield = vFormPanel1.getForm().findField('woclass');

if (vWoType == 'RIGG') {
vFormPanel.setFldValues({'woclass': 'RIG'});
vFormPanel.setFldValues({'woclassorganization': '*'});
classfield.formPanel.processCustomFields(classfield); 
}

}
}

}
}
});

 

 

  • Hey 1773939, I might be just as new to this as yourself,
    But some thoughts to get around some of your issues, (though someone who understands this stuff better might be able to steer you in the right direction)
    For Point 1, to get around the onload/render issue, you could use a focus on the description field (if it isn't protected) as the system selects that field every time you move to a new record, "focus" is technically not supported but for something this simple it should cause issues.

    For point 2, i also have issues getting customonblur etc to work for me, but a normal blur has worked.

    Like i said, i don't know too much, hopefully someone can let me know if using Focus and blur are a bad idea

    the below code worked in my test system, (though i got some errors because my setup will be different from yours)

    Ext.define('EAM.custom.external_wsjobs', {
    extend: 'EAM.custom.AbstractExtensibleFramework',
    getSelectors: function() {
    return {
    '[extensibleFramework] [tabName=HDR][isTabView=true] [name=description]': {
    focus: function() {
    var vFocus = this,
    vFormPanel = vFocus.getFormPanel(),
    vWoStatus = vFormPanel.getFldValue('workorderstatus');
    if (vWoStatus == 'R') {
    EAM.Builder.setFieldState({
    'woclass': 'protected'
    }, vFormPanel.getForm().getFieldsAndButtons());
    EAM.Builder.setFieldState({
    'department': 'protected'
    }, vFormPanel.getForm().getFieldsAndButtons());
    EAM.Builder.setFieldState({
    'equipment': 'protected'
    }, vFormPanel.getForm().getFieldsAndButtons());
    EAM.Builder.setFieldState({
    'location': 'protected'
    }, vFormPanel.getForm().getFieldsAndButtons());
    EAM.Builder.setFieldState({
    'workordertype': 'protected'
    }, vFormPanel.getForm().getFieldsAndButtons());
    EAM.Builder.setFieldState({
    'reportedby': 'protected'
    }, vFormPanel.getForm().getFieldsAndButtons());
    EAM.Builder.setFieldState({
    'standardwo': 'protected'
    }, vFormPanel.getForm().getFieldsAndButtons());
    EAM.Builder.setFieldState({
    'schedgroup': 'protected'
    }, vFormPanel.getForm().getFieldsAndButtons());
    EAM.Builder.setFieldState({
    'assignedto': 'protected'
    }, vFormPanel.getForm().getFieldsAndButtons());
    EAM.Builder.setFieldState({
    'schedstartdate': 'protected'
    }, vFormPanel.getForm().getFieldsAndButtons());
    EAM.Builder.setFieldState({
    'schedenddate': 'protected'
    }, vFormPanel.getForm().getFieldsAndButtons());
    EAM.Builder.setFieldState({
    'datereported': 'protected'
    }, vFormPanel.getForm().getFieldsAndButtons());
    console.log('LOAD CALLED.....');
    }

    }
    },


    '[extensibleFramework] [tabName=HDR][isTabView=true] [name=workordertype]': {

    blur: function(field) {
    console.log('TYPE CALLED.....');

    var vFocus1 = field.formPanel,
    vFormPanel1 = vFocus1.getFormPanel(),
    vWoType = vFormPanel1.getFldValue('workordertype'),
    classfield = vFormPanel1.getForm().findField('woclass');

    if (vWoType == 'RIGG') {
    vFormPanel.setFldValues({
    'woclass': 'RIG'
    });
    vFormPanel.setFldValues({
    'woclassorganization': '*'
    });
    classfield.formPanel.processCustomFields(classfield);
    }
    }
    }
    }
    }
    });

  • In reply to AndrewWatersure:

    Thank you AndrewWatersure

    It works for me now :)