openanthem / nimbus-core

Getting Starting with NIMBUS-CORE
https://anthemopensource.atlassian.net/wiki/spaces/OSS/pages/157024674/Quickstart+Guide
Apache License 2.0
10 stars 49 forks source link

UI field value is not update to null in Mongo collection at edit time once the field have value #720

Open kchsravanthi opened 4 years ago

kchsravanthi commented 4 years ago

Issue Details

UI field value is not update to null in Mongo DB collection at edit time once the field have value.UI shows the field with previous value.

Type of Issue (check one with "X") Bug/Defect

Current Behavior

UI field value is not updating to null in DB collection at edit time .If the field value updated with null in UI still the field existed with previous value in DB collection.

Expected Behavior

UI field value should be update with null in DB collection at edit time if the field is setting to null from UI. The field should be come up with blank in UI.

How to Reproduce the Issue

Steps to Reproduce

1) Create a person Add form contains fields name. 2) Add personName as test123.Submit form. 3)Submit the form through function handler 4) Edit form field personName value test123 to null value and submit the form. 3)Again open form and see still personName is coming up with test123 in UI instead of empty . 4)Check DB person collection still personName value test123 instead of null value .

Code Snippet

Create a core entity @Domain(value = "person", includeListeners = { ListenerType.persistence }) @Repo(alias = " person ", value = Database.rep_mongodb, cache = Cache.rep_device) @Getter @Setter @ToString(callSuper = true) public class person extends AbstractEntity.IdLong { private static final long serialVersionUID = 1L; @Audit(PersonAudit.class) private String personName;

@Audit(MemberAudit.class) private String personID; }

Create Form Form – @Model @Getter @Setter @MapsTo.Type(Member.class) public static class AddPersonForm {

@TextBox @Label("Person Name ") @Path private String personName;

@TextBox @Path @Label("Person Id ") private String personID;

@Config(url="<!#this!>/.. /AddPersonForm/_process?fn=_addPerson&source=add") @Button(style = Button.Style.PRIMARY, type = Button.Type.submit) @Label(value = "Add Person")

Environment Details

Sruthilayach commented 4 years ago

UI field value is updating to null in DB collection at edit time .If the field value updated with null in UI the field has present updated value in DB collection. Issue was replicated, as observed there was no issues.