Hi,
I'm beginner and looking for some advice for what's wrong with my first PCF. I get the tutorial from Youtube : https://www.youtube.com/watch?app=desktop&v=H7vMXphR8Eo
It looks for me the PCF only for show some text in browser, but it seems not working for me. The steps I took :
1. Go to index.ts in Visual Studio Code then add these variables :
//Value of the field is stored and use inside the control
private _value: string;
//Reference to ComponentFramework Context object
private _context: ComponentFramework.Context<IInputs>;
//Reference to the control container HTMLDivElement
//This element contains all elements of our custom control example
private _container: HTMLDivElement;
2. Add the init method like below:
public init(context: ComponentFramework.Context<IInputs>, notifyOutputChanged: () => void, state: ComponentFramework.Dictionary, container:HTMLDivElement): void
{
// Add control initialization code
this._context = context;
this._container = document.createElement("div");
this._value = context.parameters.sampleProperty.raw!;
this._container.innerText = this._value;
container.appendChild(this._container)
}
3. Then UpdateView method :
public updateView(context: ComponentFramework.Context<IInputs>): void
{
// Add code to update control view
this._value = context.parameters.sampleProperty.raw!;
this._context = context;
this._container.innerText = this._value;
}
While no error on the code, but in my browser, whatever I input text in the Input, nothing change. But the width and height of the box reflected as my setting :

Is there something I missed ? What could be the problem ?
Please help,
Thanks.