use of com.servoy.j2db.util.IFormComponentType in project servoy-client by Servoy.
the class JSNGWebComponent method resetHandler.
@Override
public void resetHandler(String handlerName) {
WebComponent webComponent = getBaseComponent(false);
WebObjectSpecification spec = WebComponentSpecProvider.getSpecProviderState().getWebComponentSpecification(webComponent.getTypeName());
if (spec != null) {
String name = handlerName;
if (spec.getHandler(name) == null) {
name = name + "MethodID";
}
if (spec.getHandler(name) != null) {
webComponent.clearProperty(name);
getBaseComponent(true).putMethodParameters(name, null, null);
} else {
int i = name.indexOf('.');
if (i > 0) {
String firstPart = name.substring(0, i);
PropertyDescription property = spec.getProperty(firstPart);
if (property != null && property.getType() instanceof IFormComponentType) {
// undefined means remove the property
Object convertedValue = fromRhinoToDesignValue(Context.getUndefinedValue(), property, application, this, handlerName);
webComponent.setProperty(firstPart, convertedValue);
return;
}
}
Debug.log("Error: component " + webComponent.getTypeName() + " does not declare a handler named " + handlerName + ".");
}
}
}
Aggregations