I've tried out some of my field PCFs on Portals following the tutorial: https://docs.microsoft.com/en-us/powerapps/maker/portals/component-framework-tutorial?WT.mc_id=BA-MV...
It worked like a charm.
The only problem that I've found out: after we change a value (and call the notifyOutputChanged) the updateView is not called again (only getOutputs).
Usually the PCFs wait for the framework runtime to validate the input, and are designed to wait for updateView to be called with the new value. At least this worked until now for Model-Driven and CanvasApps PCFs, and was described here: https://docs.microsoft.com/en-us/learn/modules/get-started-component-framework/2-architecture?WT.mc_...
Since the updateView is not called, my controls don't show the changed value (but they gets saved),
I suppose the Portals have another framework runtime, so I would like to ask if the portal PCFs are supposed to work this way. That would add some complexity to the controls, since the value is set both inside the PCF and outside through the updateView.
Or maybe not calling the updateView is just a bug for now, and we don't need to change the PCFs.
@HemantG , maybe you can help to clarify this.
Hi @DianaBirkelbach , Thanks for trying PCF on portals out and bringing this to our notice.
Can you please give us more details about how you are changing the value? Is it part of the component itself ? Also, if possible, can you share the component that you are using so that we can test and confirm from our end?
This seems to be a bug on our end and the PCFs need not be changed just for portals. This is what we are trying to achieve.
If you are changing the value of the control using client scripts in Portals, you could do so using the below snippet.
|var hiddenFieldSelector = 'input[id$=' + logical name of the attribute + ']'; |
Thank you so much @gonara .😀
An example would be the ColorfulOptionset: https://github.com/ORBISAG/ORBIS.PCF.ColorfulOptionset
Inside my own react component, I don't keep the value in the state: I rely on having my component called through updateView after the value was validated by the framework.
Thank you again for bringing this to our notice. This indeed was a bug on our side. This is fixed and should be available with the next release. I tested with the ColorfulOptionset that you had shared and is working fine now. Also if possible can you share the solution of the other PCF that you were having troubles with, so that I can test and confirm that it fixes all scenarios?
Hi @Abhishekchopra ,
Yes, it was fixed short after reporting this.
In my case:
Still when we are creating new pcf component, after using notifyOutputChanged, it is triggering UpdateView only on local but after deploying to portal, it's not triggering UpdateView.