Question
post select validation is not getting called on click of custom action menu
Hello
I want to validate action once user select/clicks on it.
custom-actoin.xml : I registered the my class as below also update Onclick info.
<objecttype name="pdmObject" class="wt.fc.WTObject" >
<action checkaccess="true" name="WSEXPORT" enabledwhensuspended="true" renderType="PDM" >
<command class="ext.epm.validator.ValidateWSEXPORT" onClick="PTC.validation.AJAXPostSelectValidation(event, 'WSEXPORT')" method="WSEXPORT" windowType="page"/>
</action>
</objecttype>
My class is as follow :
public class ValidateWSEXPORT extends DefaultUIComponentValidator {
protected static final Logger logger = LogR.getLogger(ValidateWSEXPORT.class.getName());
@Override
public UIValidationResult validateSelectedAction(UIValidationKey vKey, UIValidationCriteria vCriteria,
Locale locale) throws WTException {
// TODO Auto-generated method stub
System.out.println("---------- ValidateWSEXPORT Validation Started-----------");
UIValidationResult result = UIValidationResult.newInstance(vKey, UIValidationStatus.ENABLED);
WTReference reference = vCriteria.getContextObject();
Object obj = reference.getObject();
float fileSizeKB = checkPrimaryContent(obj);
if (fileSizeKB >= 100.00) {
result = UIValidationResult.newInstance(vKey, UIValidationStatus.DISABLED);
System.out.println("---------- WSEXPORT action is DISABLED-----------");
}
return result;
}
Validator is still not triggered once I click on WSEXPORT action.
Can you please help me ?
Reference topic: https://community.ptc.com/t5/Windchill-Customization/post-select-validation-is-not-getting-called-on-click-of-custom/m-p/993992

