3

When building a SharePoint Framework web part - How to Save Custom Property Pane value? I have created a multiselect field for Property Pane, but not able to retain the values when refresh the page. In couple of links its mentioned to save the value in Host Webpart, what does that mean - Saving back in SharePoint ?

  • The value should be saved by simply assigning it to a web part property. Are you seeing otherwise? – Waldek Mastykarz - MVP Mar 31 '17 at 19:17
  • I have 2 fields in Property Pane: 1) Dropdown to load all List Names in the web and 2) a cascade custom field to show all the fields within that list. Used cdnjs.com/libraries/multiple-select for Multiselect the field, but its not saving those value in the targetProperty. I tried saving it by custom button click and calling onPropertyPaneFieldChanged to save new values, but its not working. Is it possible to save values of a property pane field via code ? So, that I can get property values after refresh of Workbench .... – get2pallav Apr 2 '17 at 3:48
  • I have added PropertyPane code here and webpart : Webpart – get2pallav Apr 2 '17 at 6:25
  • 1
    How do you know that the property value is not being stored? Could it be that it is being stored correctly and is just not being displayed in the control? – Waldek Mastykarz - MVP Apr 3 '17 at 18:33
  • Value was getting stored and rendered properly till I don't refresh the Workbench. It seems I have found the reason, I needed to set Parent targetProperty field as well as call OnPropertyChange from my Custom Control: code this.props.properties[this.props.targetProperty] = newValue; this.props.onPropertyChange(this.props.targetProperty, oldValue, newValue);code I was not doing the first statement, Thanks for the help in understanding !! – get2pallav Apr 4 '17 at 7:04

Your Answer

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

Browse other questions tagged or ask your own question.