How to refresh section conditionally by using javascript in customized control

Hi,

I have a customized control written in javascript and after performing some user action, post changing the clipboard property value when I will click on that control then section should be get refreshed based on that property value.

Can you help me on this.

Thanks,

AKash

Hi,

Assuming your UI Control is a link or action performing control, we can add the refresh the section/Other section / Harness in the Action tab of that property, by specifying the when condition.

Thanks

Chandan U

Thanks Chandan but in customized control we can’t add WHEN conditions. I have already tried it. Even I doubt that it would perform those mentioned actions or not..!

Hi Akash,

Can you share the Screenshot on how the control configuration is done? will help me to triage it more.

Thanks

Chandan U

Hi Akash,

You can use Pega JS refresh API into your JS code to refresh the section conditionally. Pegasystems Documentation

function refresh_section_from_control(){
var options = { 
event: event
};
pega.api.ui.actions.refreshSection(options);
}

The above function refreshes the current section of the control when the function is called. You can call refresh_section_from_control() function based on your logic inside the code.

Let me know if you have any more questions. Good Luck!