Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kchsravanthi opened this issue May 1, 2020 · 1 comment

Comments

@kchsravanthi
Copy link

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
  3. 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

  • Nimbus Version:
    1.3.2.M2

  • Browser:
    All

@Sruthilayach
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants