I’m facing problem in injecting ActiveObjects.
I try to develop select list as parameter in my customized report as below. When I inject activeObjects into the ReportingUnitValuesGenerator using @ComponentImport annotation in the constructor, the select list could not be initialized and return select list as expectation.
ReportingUnitValuesGenerator.java
public class ReportingUnitValuesGenerator implements ValuesGenerator<Long> {
private final ActiveObjects activeObjects;
@Inject
public ReportingUnitValuesGenerator(@ComponentImport ActiveObjects activeObjects) {
this.activeObjects = activeObjects;
}
@Override
public Map<Long, String> getValues(Map userParams) {
Map<Long, String> result = new HashMap<>();
// Access AO database via activeObjects
// ...
return result;
}
}
I’ve injected ActiveObjects into a JiraWebActionSupport successfully as below.
AddressManagementWebworkAction.java
public class AddressManagementWebworkAction extends JiraWebActionSupport {
private final ActiveObjects activeObjects;
public AddressManagementWebworkAction(@ComponentImport ActiveObjects activeObjects) {
this.activeObjects = activeObjects;
}
}
Please help to guide me how to inject the ActiveObjects into ValueGenerator?
Your help will be greatly appreciated.