How to set form read only?

Hallo,

I have the situation, that I have to show a form as read only or not according to a parameter. So how and where can I tell the FormEngine programmatically to render the form as read only?

Best Regards
Nora

Hi @anon10130690 engine.getFormState().setEditable(false); can help you.

Thank you for your reply.
Unfortunately I have the problem, that I don’t have access to the engine at the time the form is loaded. So is there another way?

dispatch an action lock within the BAP Client

dispatch(ActivityActions.lock({
    activityId: activity.id,
	details: {},
	id: "1234",
	owner: "request lock"
}));

Is there a solution, that the cancel button is still active, so it is still possible to close the form?

hi @baschir-loud-bluff by locking the activity → lock the view which contains the form engine. I can not think of a solution for this case which disable the form and remain buttons are active.

Yes you are right. The Activity.lock is intended for situations where you want to prevent any changes to the lock. Therefore, we set the Form Engine disabled.

I am not sure whether we could allow to change the behavior to “readonly” - or even to change the default behavior to “readonly”. What do you think?

There is definitely a gap here, therefore can you please create a bug ticket? Thanks

Bug ticket: <INTERNAL_LINK>

Halo @anon10130690,
The ticket [A12C-1041]<INTERNAL_LINK> is done and delivered within BAP Client version [2.0.2]<INTERNAL_LINK>. Please help us to check if the implementation is sufficient. :slight_smile: