Skip to main content
April 18, 2023
Question

Button Configurations

  • April 18, 2023
  • 7 replies
  • 0 views

Hi Community Team

I have a query, I need to configure the formlayout buttons. Like Approve and Reject

1. When I click on a Submit button first time, a textfield needs to be populated. It is populated then I click on the submit second time, It Needs to store the textfield field data  into the DB.

But, here I'm facing issue, When I click on Submit Button Firsttime.. tn the Process Model the action is completed.. Unable to add data to the textfield. In DB is showing Empty.

For the textfield I applied ShownWhen: ri!Cdt.Status = true(),

2. When I click on the Cancel button first time, a Textfield needs to be populated. It is populated then I click on the cancel button again, No actions were taken. I want it to complete the action. Needs to store the textfield field data  into the DB.

Similarly, here also For the textfield I applied ShownWhen: ri!Cdt.Status = false(), 

Status is a boolean field in my cdt.

Can You help me out, how to figure it out.

7 replies

adityag9712
April 18, 2023

Here, you need to create a new button which will display the textFields, once you have data in this particular field, start displaying the next button which will store these detail in database. 

Note: Use Show when condition for 2 different buttons .

April 18, 2023

Why do you want to populate a textfield on click of Submit or Cancel buttons.

The better UI/UX approach for your use case is to give user a checkbox field in the form to accept or reject the request and side by side show a mandatory text/paragraph field for the comments that user have to add. Then on Submit save those values in the DB using WDSE node in process model.

April 19, 2023

I agree with you, It's a good practice to use radio buttons to achieve my user story. I realized lately.. I applied the same approach on the previous day.  By applying showWhen  to my textfields (true / false ).. When I click on Approve a textfield which is true  will appear to fill it up, similarly for the Reject a textfield (false). 

jayaprakashr0001
Participating Frequently
April 18, 2023

Try in the button Widget keep the submit as false for initial submit and make true for secondary submit so that you can achieve this.

And in same way implement for cancel as well

April 19, 2023

Hi JayaPrakash, I really appreciate your approach.. My first idea is to implement like yours.. When I click on  submit Textfield is not populated  my form was submitted and then action is completed. Later, I realized to go with the radio buttons, it is one of the possible way to solve my approach.

I'm not familiar and not aware with initial Submit and secondary submit. Could you please explain how it works.. and can you share the code for the reference.. it really helps everyone who wants to solve this kind of approaches in future.

mikes0011
Brainy
April 19, 2023
can you share the code for the reference

The buttonWidget() component has a parameter called "submit", which accepts a boolean value (true or false).  If it's set to false, the form/task will not submit upon click of the button, while any saves in its saveInto parameter will execute.

The Expression Guru