Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

ProcessFormContext is not property injected into process form when @Inject annotation is used #49

Closed
gorbunkov opened this issue Aug 31, 2021 · 1 comment
Assignees
Labels
type: bug Something isn't working
Milestone

Comments

@gorbunkov
Copy link

If ProcessFormContext is injected using the @Inject annotation (not @Autowired) then the ProcessFormContext object is in invalid state (e.g. the "task" property is null)

@UiController("sample_FirstTaskForm")
@UiDescriptor("first-task-form.xml")
@ProcessForm
public class FirstTaskForm extends Screen {

    @Inject
    private ProcessFormContext processFormContext;

    private static final Logger log = LoggerFactory.getLogger(FirstTaskForm.class);

    @Subscribe
    public void onBeforeShow(BeforeShowEvent event) {
        Task task = processFormContext.getTask();
        log.info("Task: " + task);
    }
}

Jmix version: 1.0.1

Sample project: jmix-forms.zip

@gorbunkov gorbunkov added the type: bug Something isn't working label Aug 31, 2021
@gorbunkov gorbunkov self-assigned this Aug 31, 2021
@gorbunkov gorbunkov added this to the 1.1.0 milestone Sep 27, 2021
@gorbunkov gorbunkov assigned artemy63 and unassigned gorbunkov Sep 27, 2021
@maistrenkoIulia
Copy link

verified

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants