Hey all,
I'm having problems for a week now, and I hope you guys can help me.
I'm creating a PCF with react that renders a component with one DefaultButton and two Dropdowns from FluentUI. When clicked, the onClick of the DefaultButton calls the context.device.pickFile() method for a user to choose a .xlsx file, and another method is called (readExcel()) to read the file and get the name of the columns as the Dropdown options, updating 2 useStates created to hold the IDropdownOptions. I was expecting that the component and the updateView would re-render, but for some reason, the updateView is not being called, even when i call notifyoutputchanged() as a prop from the readExcel() method.
The component and the control are only updated when I click the DefaultButton again (and don't choose any file, clicking "cancel"), only then the Dropdown options are showed.
I also tried to call the context.factory.requestRender() method to force the updateView to act at the end of the readExcel() method, but not even calling it I was able to make the control update automatically after choosing the excel file, I always have to click the DefaultButton for the options in the Dropdown to appear.
Has anyone already experienced something like that? Does anyone have an Idea about how to solve this problem?
Thank you so much!
Hi @DPADPA ,
The updateView is called by the platform if the property changes.
You are right about the need to call notifyOutputChanged(). If you do that, the platform will call the getOutputs() method, where you can provide the new values for your properties. Maybe in your case the value of the property is not a new one, so maybe that's why the platfororm doesn't detect a need to call the updateView.
WarrenBelz
109
Most Valuable Professional
Michael E. Gernaey
82
Super User 2025 Season 1
MS.Ragavendar
72