I am having trouble getting the default presentation of an extension function within the “scripting” dialog correct. To illustrate the problem I’ve set up two pretty much identical extension functions in the bean info class.
[code] List extfnlist = new ArrayList();
ExtensionFunctionDescriptor.Builder myBuilder = new ExtensionFunctionDescriptor.Builder(“onRowsDropped”);
myBuilder.description(“Called when the user has dropped rows on this component. Note that the rows may have come from this component or another component. The source component must have dragging enabled”);
myBuilder.arg(“source”, “A reference to the component that is calling this function”);
myBuilder.arg(“rows”, “An array of the indices of the rows being dropped”);
myBuilder.arg(“rowData”, “A dataset containing the data that is being dropped”);
myBuilder.arg(“dropIndexLocation”, “The index of the row at which the data is being dropped”);
myBuilder.defaultImpl("");
myBuilder.returns(void.class);
extfnlist.add(myBuilder.build());
myBuilder = new ExtensionFunctionDescriptor.Builder("onRowsDropped2");
myBuilder.description("Called when the user has dropped rows on this component. Note that the rows may have come from this component or another component. The source component must have dragging enabled");
myBuilder.arg("source", "A reference to the component that is calling this function");
myBuilder.arg("rows", "An array of the indices of the rows being dropped");
myBuilder.arg("rowData", "A dataset containing the data that is being dropped");
myBuilder.arg("dropIndexLocation", "The index of the row at which the data is being dropped");
myBuilder.defaultImpl("");
myBuilder.returns(void.class);
extfnlist.add(myBuilder.build());
bean.setValue(ExtensionFunctionDescriptor.EXTENSION_FUNCTIONS, extfnlist);[/code]
The display within the “scripting” dialog of “onRowsDropped” and “onRowsDropped2” are respectively:
and
The difference between the two functions is that “onRowsDropped” is installed into the list of available extension functions within the component itself and “onRowsDropped2” is not installed. Any ideas on what I’m doing to offend the faceless men and the multi-faced god that they would treat me so?
[code] extensionFunctions = new HashMap<String, ExtensionFunction>();
extensionFunctions.put(“onRowsDropped”, onRowsDropped);
} ------------- this is the end of the component constructor
@Override
public void onStartup() {
super.onStartup();
}
Map<String, ExtensionFunction> extensionFunctions = null;
private final ExtensionFunction onRowsDropped =
new ExtensionFunction(false, "");;
@Override
public Map<String, ExtensionFunction> getExtensionFunctions() {
return extensionFunctions;
}
@Override
public void setExtensionFunctions(Map<String, ExtensionFunction> map) {
this.extensionFunctions = map;
}[/code]