Question
Accenture
US
Last activity: 4 Apr 2018 13:27 EDT
Repeating Grids and Validation for removing selected value
I am new to Repeating Grids and was hoping some one can help me with this.
My requirement is the following.
Create a repeating grid with values in the drop down grid, with Add and Delete buttons and the following events that need to occur on user interaction.
When a user deletes a value in the drop down list, a pop up needs to appear with the message "Are you sure you want to delete this value"
1. The pop up has Yes and No options.
2. If "Yes" is selected, the selected repeating value is deleted.
3. If "No" is selected, then user returns to page and nothing is deleted.
Any help in this regard with screen shots would be highly appreciated
***Edited by Moderator Marissa to update categories***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
Hi Chakri,
You can have a look into my sample use case which might help you in implementing your requirement.
Regards
Mahesh
Accenture
US
Hi Mahesh,
First of all thanks so much for such a quick and amazing reply along with explaining in detail with screen shots which is what we find severely lacking on this forum. I am hoping you can answer the following as well.
How do we actually add ' the grid layout in my section '. I am on Pega 7.3. and I only see the following and not the 'Grid Repeat Layout' along with the delete button.
Could you also please explain
1.) what this 'UserWorkForm' is and how an event on the Repeat Grid travels to/is picked by the UserWorkForm to trigger the pop up.
2.) The function - removeFromRepeatSource(D) - the parameter (D) - is this the 'Delete Item' event or the Name of the Button?
Also would it be possible to show the error message pop up as a 'Modal Window' with the background 'ghosted' or as a darkened screen with just the pop Up/modal window visible and if so how.
Again thanks for your detailed explanation in your prior post.
Pegasystems Inc.
US
Hello Chakri,
If you are in Pega 7.3 then you can use the Table which is replacement of Dynamic repeat grid.
1.) what this 'UserWorkForm' is and how an event on the Repeat Grid travels to/is picked by the UserWorkForm to trigger the pop up. -> When Delete Item is being called on click of the Delete button, then it will try to call removeFromRepeatSource(event) function is being triggered which is in pega_ui_docwrappers.js file. So in UserWorkForm we are overriding the default functionality of this.
2.) The function - removeFromRepeatSource(D) - the parameter (D) - is this the 'Delete Item' event or the Name of the Button? -> by looking into the default ootb function in pega_ui_docwrappers.js file it is taking the input as event.
Note: When the default Delete Item confirmation message checkbox functionality had an issue with the popup in earlier version, we tried this approach to override the existing behaviour to show the popup before deletion of item from the grid.
Hope this answers your query.
Regards
Mahesh
Accenture
US
Hi Mahesh,
First of all thanks for your answer and many many thanks for providing the JS Script. It works like a charm. Just Sweet.
I tried using Table in Pega 7.3 and the Table basically shows ALL the values in the DataPage. My requirement is to show a drop down list and the user can select a value from the list and then keep adding or deleting as needed (shown below).
Is there a way to modify the PEGA Table to present a DropDown List of the DataPage values (not the complete list of values) and the user can select one value at a time and then add more by selecting a value from the drop down and then using the Add Item button.
Hi Mahesh,
First of all thanks for your answer and many many thanks for providing the JS Script. It works like a charm. Just Sweet.
I tried using Table in Pega 7.3 and the Table basically shows ALL the values in the DataPage. My requirement is to show a drop down list and the user can select a value from the list and then keep adding or deleting as needed (shown below).
Is there a way to modify the PEGA Table to present a DropDown List of the DataPage values (not the complete list of values) and the user can select one value at a time and then add more by selecting a value from the drop down and then using the Add Item button.
For example :- In Step 5 of your document could you please document HOW the Pega 7.3 Table can be changed/used to display or show Datapage values as a drop down list from which a user can select and HOW to add the selected value upon clicking the Add Button? Basically I want to add User Names Mahesh1 and Mahesh2 by clicking on the 'Add Button' twice, delete Mahesh1 which moves Mahesh2 to top and the add Mahesh1 again so that the order of display is now Mahesh2 and Mahesh1 (after four clicks - 2 add clicks + 1 delete click +1 add click) but like in the screen shot above.
Pegasystems Inc.
US
Hi Chakri,
If you want to display the Data Page values in the drop down list then you don't need to go for the Table, instead you can choose the Drop down control and source it with your Data Page list property that you want to display in the drop down.
For example, your data page list have a list of Employee objects which has {.EmpName, .Age, .DOB} properties in it then you can source this data page list to your drop down control and provide the property to display with .EmpName. Then it will display the list of employee names available in the page list.
Now you should have the page list property with Employee objects in your pyWorkPage to hold the list of employees that are being added/deleted. When the user select the employee from the drop down and click add button then you need to write a business logic to store this employee object into the page list property that is available in pyWorkPage. Same way you should delete the employee object from this page list when user click on Delete button.
Down to the Drop down list display you can add the table with the source as page list property which contains added/deleted employees in your pyWorkPage. You need to refresh your section after the addition/deletion of employee object from your page list that is available in pyWorkPage to reflect the latest data in your table.
Hope this might help you to achieve your business requirement.
Regards
Mahesh
Accenture
US
Dear Mahesh, Can you kindly 'document' your explanation? I was unable to achieve what you said in the post.
FDIC
US
Hi Chakri,
Try this approach.
Accenture
US
I found the following on PEGA Help regarding 'UserWorkForm' -
You can add custom client-side validation scripts or error messages on an application-wide by overriding the HTML fragment rule named UserWorkForm, which is included in the fragment WorkFormStandard, which in turn is included in the HTML code for every user form.
I am still unclear as to how the events in this 'UserWorkForm' are actually triggered.
I found the following on PEGA Help regarding 'UserWorkForm' -
You can add custom client-side validation scripts or error messages on an application-wide by overriding the HTML fragment rule named UserWorkForm, which is included in the fragment WorkFormStandard, which in turn is included in the HTML code for every user form.
I am still unclear as to how the events in this 'UserWorkForm' are actually triggered.
Pegasystems Inc.
US
The 'Delete Item' action in Pega 7.3 has a box you can check to 'Display confirmation message'.
-
Sumpath Dasari