I'd like to pass a function parameter (i.e. a FunctionObject) in SSJS to a bean, and then call that function as a kind of callback function. For instance:
companyBox.setGenerator(function() {
return @DbColumn("", SystemBean.getViewName(), 2);
});
so that I can call that function whenever I need actualized values.
I'm expecting this to fail because the SSJS-context is missing, but the idea is still tempting. Or maybe it's because the function cannot be Serialized, but what that exactly means I don't know (yet). In this case, the companyBox object is created from a managed bean with view/page scope: once the current page disappears I no longer need it.
Clues are welcome...