Is it possible to override savePage method on click Save and Close button from SPFX

%3CLINGO-SUB%20id%3D%22lingo-sub-114533%22%20slang%3D%22en-US%22%3EIs%20it%20possible%20to%20override%20savePage%20method%20on%20click%20Save%20and%20Close%20button%20from%20SPFX%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-114533%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20modern%20page%20with%20custom%20spfx%20webparts.%20My%20spfx%20webparts%20contains%20office%20ui%20fabric%20react%20components%20such%20as%20PeoplePicker%20and%20TaxonomyPicker.%3C%2FP%3E%3CP%3EAfter%20user%20enters%20the%20data%20and%20clicks%20save%20or%20save%20and%20close%20button%2C%20I%20need%20to%20override%20the%20event%20handler%20for%20Save%20event%20to%20save%20the%20information%20into%20the%20page.%20My%20idea%20is%20that%20I%20should%20override%20that%20Save%20event%20handler%20method%20so%20that%20my%20webpart%20callback%20handler%20will%20be%20called%20and%20updates%20the%20Page%20ListItem%20metadata.%20I%20also%20found%20onDisplayModeChanged%20event%20in%20the%20webpart%20from%20here%2C%20I%20am%20not%20sure%20how%20to%20find%20if%20the%20event%20is%20Save%20and%20close%20or%20Discard%20Changes.%3C%2FP%3E%3CP%3ECan%20anyone%20please%20suggest%20which%20is%20the%20elegant%20way%20to%20do%20that%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-850533%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20it%20possible%20to%20override%20savePage%20method%20on%20click%20Save%20and%20Close%20button%20from%20SPFX%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-850533%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F85720%22%20target%3D%22_blank%22%3E%40Aruna%20Gottimukkala%3C%2FA%3E%26nbsp%3BI%20am%20looking%20for%20same%20things.%20Did%20you%20found%20any%20solution%20or%20work%20around%20for%20that%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

I have a modern page with custom spfx webparts. My spfx webparts contains office ui fabric react components such as PeoplePicker and TaxonomyPicker.

After user enters the data and clicks save or save and close button, I need to override the event handler for Save event to save the information into the page. My idea is that I should override that Save event handler method so that my webpart callback handler will be called and updates the Page ListItem metadata. I also found onDisplayModeChanged event in the webpart from here, I am not sure how to find if the event is Save and close or Discard Changes.

Can anyone please suggest which is the elegant way to do that?

1 Reply
Highlighted

@Aruna Gottimukkala I am looking for same things. Did you found any solution or work around for that?