Is it possible to have a creation form and an editing form? For example, to create the record only a few mandatory fields. After creation, other fields will be available
I have a scenario where the creation has business rules that cannot be edited later. In the creation form there would be a field with an entity type, which according to the choice some fields of the form could be editable or not
The best I could suggest is maybe create some custom property editor or maybe a wrapper property editor that is a Create Only Property that detects if the view is a create view and if it is, renders the actual wrapped control and if not, renders the value in whatever format you need?
Would it be possible to have CreateOnly built into the plugin? We are currently also facing the issue where we want some fields to be editable on create but not after its been created.
Ok, if anyone wants to test this I think I have something in place.
I've basically made it so you can pass a predicate to the MakeReadOnly methods on fields and in that we pass a context object which contains the editor mode and user permissions collection so you decide dynamically when a field is readonly.
The MakeReadOnly method now also supports passing a dattype name / id so you can set a different prop editor to use instead of the label (which is still the default).
I've also added a SetVisibility method which has the same predicate, but rather than making the field readonly, it completely remove it from the editor.
Here's an example where an Age field is editable during create, but becomes readonly during edit and when readonly it is formated as "x yearsold". There is also an example of a field that is set to only display during editing and not during create.
If you want to try this, it's on my unstable nuget feed at https://nuget.outfield.digital/unstable/v3/index.json and you'll want to install the 1.5.0-ALPHA-FIELD-VISIBILITY.38 build (don't install any other version as you may have unexpected results).
I'd appreciate the feedback as to whether this solves your problems or not.
Different create and edit forms
Is it possible to have a creation form and an editing form? For example, to create the record only a few mandatory fields. After creation, other fields will be available
Hi Marcio
Not currently no. There is just one form used for creation / editing.
Can you explain the use case?
Matt
I have a scenario where the creation has business rules that cannot be edited later. In the creation form there would be a field with an entity type, which according to the choice some fields of the form could be editable or not
The best I could suggest is maybe create some custom property editor or maybe a wrapper property editor that is a
Create Only Property
that detects if the view is a create view and if it is, renders the actual wrapped control and if not, renders the value in whatever format you need?Would it be possible to have CreateOnly built into the plugin? We are currently also facing the issue where we want some fields to be editable on create but not after its been created.
Ok, if anyone wants to test this I think I have something in place.
I've basically made it so you can pass a predicate to the
MakeReadOnly
methods on fields and in that we pass a context object which contains the editor mode and user permissions collection so you decide dynamically when a field is readonly.The
MakeReadOnly
method now also supports passing a dattype name / id so you can set a different prop editor to use instead of the label (which is still the default).I've also added a
SetVisibility
method which has the same predicate, but rather than making the field readonly, it completely remove it from the editor.Here's an example where an Age field is editable during create, but becomes readonly during edit and when readonly it is formated as "x yearsold". There is also an example of a field that is set to only display during editing and not during create.
If you want to try this, it's on my unstable nuget feed at https://nuget.outfield.digital/unstable/v3/index.json and you'll want to install the 1.5.0-ALPHA-FIELD-VISIBILITY.38 build (don't install any other version as you may have unexpected results).
I'd appreciate the feedback as to whether this solves your problems or not.
is working on a reply...