Question
OCBC Bank
IN
Last activity: 16 Feb 2017 4:32 EST
Populating the Local Action using javascript
<Script>
<pega:when test="testWhenRule">
pega.u.d.processAction('testFlowAction', '','Rule-Obj-FlowAction','','',true,this,'','',this);
</pega:when>
</Script>
There is an activity pre-processing to the Flowaction.
User enter a value in the textbox and clicks on the button, there is an event which refreshes the section
which internally calls the scripts.Now,when the user performs some actions which refreshes the section on other parts of the user interface on the same screen the flow action is populated again.Is there way how to restict the flowaction to populate only when user clicks on the button and make it disable even when,refresh events are there on the screen.
***Moderator Edit: Vidyaranjan| Updated Categories***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Shell
IN
Hai Sainath,
Thanks for posting your query to PSC.
Can you please elaborate on what is the purpose of the scripts that internally get called on refresh of the section(on click of the button) ?
If it is to launch a flow action then you can use Launch Action on click of the button instead of using Refresh and specify the flow Action name.
Please let us know if you have any further queries.
Regards,
Chinmai Sravanthi.
OCBC Bank
IN
Sravanti thanks for the response.
Yeah, I can call it from the Button click, but i need to validate it.There is a textbox input, which user enter and we are validating it with the values on the clipboard which we are obtained through the SOAP req.Probms with the onclick event is that if the user enter a wrong value and clicks on the button I haven't found an option to validate, Yeah there is Validation in the flow action but it gets trigged only after the processing I need show up a mesg saying "Wrong value entered".
Regards,
Sainath Vallpu
Shell
IN
I am not sure whether this helps you or not but can you try referring the validate rule in the pre-processing of the Flow Action that is launched on click of the button.
Do let us know if this helps you or if you have any queries.
Regards,
Chinmai Sravanthi.
Unisys
AU
I guess you need to add the script execution in the button click. Do not include it in the UI, which will eventually refreshes with user actions and calls your script.
You can include an "run script" action on the button actions and mention "pega.u.d.processAction" as script name and provide parameters. Hope this helps.
OCBC Bank
IN
Praveen,
I tried as you mentioned it worked but, I need to check whether the user entered value is correct/not.
If it is invalid an error msg should be displayed else pop-up should be launched.If you look into the script there is when condition but if I go with "Run Script"
how do I check it ?
<Script>
<pega:when test="testWhenRule">
pega.u.d.processAction('testFlowAction', '','Rule-Obj-FlowAction','','',true,this,'','',this);
</pega:when>
</Script>
Unisys
AU
Have a pre-activity in the FA action and set messages on the current workpage to validate the user entered values. I guess this should processing of the modal and throw errors on the UI. You may also try the validate rule on the FA
-Praveen
IN
Hi,
Can you try configuring the button with a "on click-local action" action set and put a when condition to restrict its execution based upon your business requirement? Like below:
Capgemini
IN
Hello,
I think adding condition is newly added in local action(at least after 7.1.7). We have implemented the same in below way.
Call java script on click of the button.
in the java script function we do a ajax call(via safe url api), where we call the activity. now based on the result of the activity we do the calling for the local action.
To send result to the java script we can use below 2 methods in activity..
1. show property.
2. show-HTML.
Hope this helps.
-Saikat
OCBC Bank
IN
SaiKat,
If possible can you please provide a dummy code, for ajax call in which we call up the activity, that would be helpful for me. TIA
Sainath
TapRoot Solutions LLC
US
Hi , we have something similar as well. Can you share the JS code how you referred the local action. Is it same how you referred the activity.
Sharath
Capgemini
IN
Sorry I can not provide the JS code due to security.
OCBC Bank
IN
Ajith,
I checked it when condition is provided only for the "Change" event (i.e., text-input), but for the button click event there is no option for the condition.
Thanks,
Sainath