0

I have added few controls to property pane, I have few labels which get updated on button click as shown in below image

enter image description here

But once the page is refreshed, the label values are lost as I am using an array to update these fields which gets empty on page refresh.

Code:-

PropertyPaneLabel('linkLabel1', {
 text: array[0]
})

Other fields values exists after page refresh also but label values are lost. So what is the right way of doing this?

1

You just need to store generated labels in a separate property of the web part and restore them on refreshing or opening the panel.

  • can you pls provide more details? – KumarV Sep 25 at 8:35
1

There are two property pan one for description and another for the label

PropertyPaneTextField('description', {
     label: "Project Model Title"
 }),

// another for the lavel 
PropertyPaneLabel('linkLabel1', {
 text: this.properties.description
 }),

The PropertyPaneTextField store the variables and stored. Every time PropertyPaneLabel will show that values after the refresh. Otherwise, you can set your values from service in the PropertyPaneLabel.

It may help you.

0

Property pane values should be saved somewhere and then bind these saved values to the property pane controls. You can either save it in variables or maintain a configuration list in SharePoint and get the values on page load.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.