I’m creating a custom edit control for my content authors to use in the Page Editor. Of course this means I want my control to save data to an Item when the user clicks on the Save button.
How is this done? I’ve looked through many reams of documentation… feel like I’m missing something basic. Surely I can add my own event handler here?
NOTE: I want this to be INLINE editing in the Page Editor. It seems like a very basic feature that is missing from Sitecore. I could certainly see using a checkbox entry also for a checkbox field (What a crazy notion?!?!). The only built-in options for editing seem to be a textbox or a RichText editor. Am I missing something obvious?
OK… after some help from Sitecore support, I’ve finally got the answer to this question. In order for Page Editor to get new values for fields, the Sitecore.WebEdit.setFieldValue() javascript function needs to called. This creates a hidden input field which the PageEditor then reads when the Save or Save/Close button is clicked.
So, basically we just add a client-side onchange handler for the DropDownList which calls this Sitecore js function. Note: I believe this requires Sitecore 6.2.