Posted: 6 Jan 2016 3:59 EST Last activity: 14 Jan 2016 5:43 EST
How to clear comments form on pressing the Submit button?
I have an assignment with comments form (text area, "add comment" button, and history of comments). It is designed with standard Pega mechanism. At clipboard there is page Note (Data-WorkAttach-Note) and page AllNotes (Code-Pega-List).
Button "Add comment" contains a control pxButton with behavior:
Event Click - Refresh Section (Target: This section).
Button Submit is designed as custom submit button with a single action in its behavior:
Event Click - FinishAssignment.
So I have such problem. I have to add new comment only by pressing "Add comment" button. But new comment is also added when I press Submit. I tried to solve this problem by adding events on Submit button in these ways:
1) Add an event Display -> Set Value -> Note.pyNote == "", and event Refresh before FinishAssignment.
2) Add Data Transform that sets Note.pyNote to "". (before FinishAssignment).
3) Add Activity that sets Note.pyNote to "". (before FinishAssignment).
But it doesn't work. Comment always move to AllNotes list on Submit button
You asked if empty comment gets posted into the AllNotes list. I've just tested it. No, empty comment (or space symbols) doesn't get posted into this list. Neither on "Add comment" button, nor on Submit. Comment gets posted only if TextArea contains text.
AllNotes is a pagelist inside User Pages (outside pyWorkPage). There is a Repeat Grid in the section for comments.
What about activity. I don't know exactly how it works. But I have found a hidden layout on this section. And this layout contains a control
Hi , Am still not very clear how is the comment adding to your AllNotes pagelist. Do you have an activity to do so, if that is the case where is that getting called? is that in post activity of flowaction or somewhere else. As just with refresh section the comments will be saved in the property called Note.pyNote and not under AllNotes pagelist.