cancel
Showing results for 
Search instead for 
Did you mean: 

Allowing access to PCFControl instance from client API

Per forum thread https://powerusers.microsoft.com/t5/PowerApps-Component-Framework/Form-designer-setting-additional-m...

 

Basically, I am looking for scripting capability of PCFControls in forms. The solution can be just one extra method in the parent control instance to return the reference of the PCF.

If the PCF is

export class DogPCFControl implements ComponentFramework.StandardControl<IInputs, IOutputs> {
.. getOutPut(){
}
// additional custom method we'd like to expose to client
public bark():void {
  alert("woof");
}
}

in client API:

 

var ctrl = formContext.getControl ("someattribute");
if (ctrl.getControlType() == "customcontrol:MyNameSpace.DogPCFControl") {
    var mypcf= ctrl.getCustomControl(); // this is the asked feature, and can be generic enough with minimal API change
    mypcf.bark(); 
} 
Status: Completed

This is the control implementation ask which can be acheived by buiding the control with speciel logic and have these contrains as part of configuration.

Comments
cakhaing
Advocate IV
HemantG
Power Apps
Status changed to: Completed

This is the control implementation ask which can be acheived by buiding the control with speciel logic and have these contrains as part of configuration.