Button Visibility

0
Hi All  In my project i have one requirement i.e we have new edit pages for that pages save and cancel buttons are intially  Visible but i don’t want like that if user change anything in that page i have show save button if user didn’t change any thing in page i don’t want that save button. please any one help me regarding this.    
asked
2 answers
3

Hi Sarath,

You can do it by implimenting a logic using a NPE.

Just add a NPE with a boolean attribute (default value false).

Now add a dataview of NPE above the Dataview of your new edit page.

Set NPE dataview - data source to microflow and add a create action to create a NPE and set it to return value.

Now place your new edit data view inside NPE dataview.

Now inside your NewEdit dataview, apply an on change event on every input widget and call a microflow on every change. 

In the microflow, 

compare the values of database with the current values, if somehting is changed, set the NPE boolean to true and refreshes the NPE dataview.

 

Now apply a conditional visibility on your Save button which gets visibile if the boolean is set to true.

Hope it helps!

Let me know if you have any confusion!

answered
1

There is no easy way for that unfortunately, because it is a requirement that makes the save-button more intuitive.

What you can do is:

  • add an attribute to the object on the page, say ‘Dirty’ with default to false;
  • create a nanoflow ‘SetDirty’ which sets the value of ‘Dirty’ to true;
  • add onchange-event ‘SetDirty’ to each of the attribute’s page-widgets (so to each text-box, dropdown, reference selector, etc);
  • Make the visibility of the Save-button depend on the value of ‘Dirty’
answered