im creating a property editor, where i relate a member with a content. Ive gotten all the members out in a selectlist and im able to save one or more members to model.value.
Though, my problem is that i need to have this information in my own database table, where the members are associated to the content, but does the backoffice broadcast some kind of event so in my angular-controller i can catch that and save my information ? Or should i hook up to the afterSave event or something in c# ?
I would like to keep everything in angular / webAPI.
One you mentioned your self is to implement a save event.
The other one requires you to rewrite your property editor. To use a c# class which inherits from a PropertyEditorBase class. Tim has a example of that on his blog : http://www.nibble.be/?p=415
After that you need to implement a class inherting from PropertyValueEditorWrapper. This will allow you to handle how data is saved in the database for a property editor.
I think I misunderstood your answer. I know how to implement a server side save event; I was wondering how to bind a custom function on angular js
Actually I can catch the form submit
$scope.$on("formSubmitting", function (e, params) { console.log(e); console.log(params); });
and I have a resource and a webApi ready; my problem is that I can't distinguish between save, save and publish, unpublish and send to publish actions.
In case somebody else comes upon this, this is a way to check if the item is being published and or saved (and a fallback if you want it)
$scope.$on("formSubmitting", function (ev, args) {
if (args.action === "save") {
alert("content is being saved.");
} else if (args.action === "publish") {
alert("content is being saved and published");
} else {
alert(args.action);
}
});
On the other hand, if I use the c# save event, I don't know how to get the property:
in general, I don't know the name of property (and I don't want to force the user to compile a config file) and the propertyTypeEditor is a private field that I can't catch from code.
backoffice save angular event?
Hello guys!
im creating a property editor, where i relate a member with a content. Ive gotten all the members out in a selectlist and im able to save one or more members to model.value.
Though, my problem is that i need to have this information in my own database table, where the members are associated to the content, but does the backoffice broadcast some kind of event so in my angular-controller i can catch that and save my information ? Or should i hook up to the afterSave event or something in c# ?
I would like to keep everything in angular / webAPI.
best regards Niclas
I have the same question.
Have you found any answer to this?
Cheers,
/Olof
There are 2 approaches on how to do this.
One you mentioned your self is to implement a save event.
The other one requires you to rewrite your property editor. To use a c# class which inherits from a PropertyEditorBase class. Tim has a example of that on his blog : http://www.nibble.be/?p=415
After that you need to implement a class inherting from PropertyValueEditorWrapper. This will allow you to handle how data is saved in the database for a property editor.
You can see an example in from the core datepicker here : https://github.com/umbraco/Umbraco-CMS/blob/eae00873073f20c60e355ec6e95ff6259ad2652b/src/Umbraco.Web/PropertyEditors/DatePropertyEditor.cs
But I would recommend the event.
Dave
Hi, can you give some directions about how to implement a save event?
thank you
You can find the documentation here:
https://our.umbraco.org/documentation/Reference/Events-v6/ContentService-Events
Dave
Hi Dave,
I think I misunderstood your answer. I know how to implement a server side save event; I was wondering how to bind a custom function on angular js
Actually I can catch the form submit
and I have a resource and a webApi ready; my problem is that I can't distinguish between save, save and publish, unpublish and send to publish actions.
In case somebody else comes upon this, this is a way to check if the item is being published and or saved (and a fallback if you want it)
On the other hand, if I use the c# save event, I don't know how to get the property:
in general, I don't know the name of property (and I don't want to force the user to compile a config file) and the propertyTypeEditor is a private field that I can't catch from code.
is working on a reply...