Question
CGI
IN
Last activity: 16 Oct 2018 12:03 EDT
Urgent: WARNING message should appear when click on Delete Item in Repeated Grid
WARNING message should appear when click on Delete Item asking to confirm that user wants to delete an item from repeated grid, otherwise too easy to accidentally erase details.
Thanks in Advance!
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
IN
Please add the below script in the UserWorkform to display the warning on click of delete item in grid:
<script>
function removeFromRepeatSource(D) {
if(window.confirm("Are you sure to delete")){
var C = pega.ui.DataRepeaterUtils.getLayoutType(D);
if (C == "grid") {
doGridAction(D, "DELETE")
} else {
if (C == "repeat-layout") {
var B = pega.ui.DataRepeaterUtils.getAbsoluteDataSourceFromEvent(D);
var E = B.dataSource;
var F = B.rowIndex;
var A = B.domIndex;
B.sectionContext = pega.ui.DataRepeaterUtils.getRepeatLayoutSectionContext(D);
if (pega.u.d.ServerProxy.isDestinationLocal()) {
pega.ui.template.DataRepeater.removeFromRepeatSource(B)
} else {
pega.desktop.DataRepeater.removeFromRepeatSource(B)
}
}
}
}
}
</script>
Pegasystems Inc.
IN
Hi,
Add an action on click of delete -> configure launch a local action with a section embedded with warning message.
CGI
IN
Thanks for your prompt reply.
We are already on Modal window i.e. UI with delete button is displayed on Modal window. From Modal window, we are unable to launch modal window.
Do we have any other approach.
Thanks in Advance!
Pegasystems Inc.
US
Hi,
OOTB Repeat Grid "Delete" link is in section 'pzPegaDefaultGridIcons' which is available for customers to do customization (add a click event local action to launch a modal window for the WARNING message).
If the "Delete" is your own customized button or link, the same action can be applied.
Thanks,
Susan
CGI
IN
Thanks for your prompt reply.
We are displaying the repeated grid with delete button in Modal window. From Modal window, we are unable to launch other modal window.
If we use Ourlay, which is not restricting from updating parent window.
Do we have any other approach.
Thanks in Advance!
Tetco
SA
Modal dialog can be closed on open of another modal dialog, and same way we can close the new modal dialog on submit and open old modal dialog again back with updated values. But only think issue is we can't open two modal dialog at same time it can switched as the context.
Pegasystems Inc.
US
I have not tried this, but thinking out loud here :
Is this your custom Delete link / button ?? If yes, can you add "Run script" to call an alert with the warning message. I guess alert messages are allowed from a modal dialog.
Pegasystems Inc.
US
Also, include the call to delete based on the response from the alert message.,
CGI
IN
Thanks for your support,
Could you please guide or share details, how to achieve through java script. i.e. Displaying message and based on that calling Delete through Java script.
Thanks in Advance!
CGI
IN
Hi Krithi,
Could you please guide or share details, how to achieve through java script. i.e. Displaying message and based on that calling Delete through Java script.
Pegasystems Inc.
US
Hi
I observed that there is a new feature in which showConfirmation for list delete item. You can try and check if that helps. Locally I did not see it work in the modal at least, need to analyze more
For the earlier suggestion, I tried to do a mock up, here are the details :
add Script to userWorkForm - which will display the alert message. I think the activity to be called is reload section with the preActivity pzGridAction with the delete (you can figure this from the Fiddler trace)
call this from the delete icon
Hi
I observed that there is a new feature in which showConfirmation for list delete item. You can try and check if that helps. Locally I did not see it work in the modal at least, need to analyze more
For the earlier suggestion, I tried to do a mock up, here are the details :
add Script to userWorkForm - which will display the alert message. I think the activity to be called is reload section with the preActivity pzGridAction with the delete (you can figure this from the Fiddler trace)
call this from the delete icon
At run time you can observe this from the modal
CGI
IN
Thanks for your response.
We are using Pega 7.2.1. It is not having check box i.e. Display confirmation message
I am looking into the activity to be called from java script and its parameters. If you get the name of activity, please share.
Thanks in Advance.
coforge.com
GB
That is the new feature from 7.2.2. when use out of the box Grid Delete button.
CGI
IN
I am not able to find the activity to be called from java script and its parameters. If you get the name of activity, please share
How to call the activity from java script?
CGI
IN
I am not able to find the activity to be called from java script and its parameters.
. Can someone help.
Thanks in Advance.
CGI
IN
I am not able to find the activity to be called from java script and its parameters.
. Can someone help.
Thanks in Advance.
Pegasystems Inc.
US
Hi Raja
Sorry for the delay in getting back to you. I tried an alternate approach by using the "When" condition and associating it with the "Delete list item" action. I was not able to get it to work. I'll try another approach and update here if successful
CGI
IN
Do you got any another approach.
CGI
IN
Do you got any another approach
LTI
IN
Hi Rajasekhar,
Following with the approach mentioned by Krithiga, a little change would suffice. In UserWorkForm HTML Fragment use below source, On the Icon(deleteItem) place Run Script and DeleteItem actions. Please check if this would satisfy the requirement. Thanks.
-
Srikanth Magatapalli
CGI
IN
Sorry for delay response. I will try and update.
Thanks one again...........
Virtusa Ltd
AU
Please check the OOTB "pyDeleteButton" control and modify it according to your need.
CGI
IN
The code in PyDeletebutton is
<script language="javascript">
if(!e)
var e = event;
</script>
<% if(!(tools.getStepPage().getString(".pyAccountName").equalsIgnoreCase("default") && tools.getStepPage().getString(".pyAccountType").equalsIgnoreCase("Notify"))){ %> <button title="<pega:lookup property=".pyCaption" value="Delete" />" class="iconDelete" onclick="if(window.confirm('<pega:lookup property=".pyMessageLabel" value="Do you want to delete this account?" />')) { doGridAction(e,'DELETE'); }" ></button><% } %>
Please let me know were to add confirmation message.
In tracer, I am not able to find.
Thanks in Advance.........
CGI
IN
The code in PyDeletebutton is
<script language="javascript">
if(!e)
var e = event;
</script>
<% if(!(tools.getStepPage().getString(".pyAccountName").equalsIgnoreCase("default") && tools.getStepPage().getString(".pyAccountType").equalsIgnoreCase("Notify"))){ %> <button title="<pega:lookup property=".pyCaption" value="Delete" />" class="iconDelete" onclick="if(window.confirm('<pega:lookup property=".pyMessageLabel" value="Do you want to delete this account?" />')) { doGridAction(e,'DELETE'); }" ></button><% } %>
Please let me know were to add confirmation message.
In tracer, I am not able to find.
Thanks in Advance.........
coforge.com
GB
did u find the solution for this?
Pegasystems Inc.
IN
Hi,
We had also similar requirement .You can use "Flow In Modal Dialogue" action to fulfill your requirement.
-->Create a flow which has one assignment in it and include your custom message in section and include that in flow action.
-->Then call that flow on delete item using "Flow In Modal Dialogue" action.
Hope it helps you.
Regards,
Hi,
We had also similar requirement .You can use "Flow In Modal Dialogue" action to fulfill your requirement.
-->Create a flow which has one assignment in it and include your custom message in section and include that in flow action.
-->Then call that flow on delete item using "Flow In Modal Dialogue" action.
Hope it helps you.
Regards,
Vinay Reddy :)
Accepted Solution
Pegasystems Inc.
IN
Please add the below script in the UserWorkform to display the warning on click of delete item in grid:
<script>
function removeFromRepeatSource(D) {
if(window.confirm("Are you sure to delete")){
var C = pega.ui.DataRepeaterUtils.getLayoutType(D);
if (C == "grid") {
doGridAction(D, "DELETE")
} else {
if (C == "repeat-layout") {
var B = pega.ui.DataRepeaterUtils.getAbsoluteDataSourceFromEvent(D);
var E = B.dataSource;
var F = B.rowIndex;
var A = B.domIndex;
B.sectionContext = pega.ui.DataRepeaterUtils.getRepeatLayoutSectionContext(D);
if (pega.u.d.ServerProxy.isDestinationLocal()) {
pega.ui.template.DataRepeater.removeFromRepeatSource(B)
} else {
pega.desktop.DataRepeater.removeFromRepeatSource(B)
}
}
}
}
}
</script>
CGI
IN
Thanks....
Central Provident Fund Board
SG
Warning message is displayed. But item is not deleted from the grid on click of "OK". Please advise.
Pegasystems Inc.
IN
Hi,
We had also similar requirement .You can use "Flow In Modal Dialogue" action to fulfill your requirement.
-->Create a flow which has one assignment in it and include your custom message in section and include that in flow action.
-->Then call that flow on delete item using "Flow In Modal Dialogue" action.
Hope it helps you.
Regards,
Vinay Reddy :)
CGI
IN
Thanks..........
CollabPartnerz
IN
It actullay helps