Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
We usually put the XForm events in the block control/controller itself, then we have access to CurrentBlock.
Hi,
I posted this question before and got no response, maybe the description was vague.
In a project I'm currently working with, we have a Block which contains a XForm property. Now I'm about to fiddle with the AfterSubmitPostedData-event in the Initialization-module for this addon. This step is working fine, the event is executed as expected.
public void Initialize(InitializationEngine context) { XFormActionHelper.AfterSubmitPostedData += XFormControlOnAfterSubmitPostedData; }
The problem i face is that i cannot get reference to the block that the XForm lies in. The XFormDataEventArgs doesn't have a reference to the block, just FormData.PageGuid which is of course null. And the sender is null. Is there a way of getting the reference of the block in the event?
private void XFormControlOnAfterSubmitPostedData(object sender, XFormDataEventArgs e) { // e.FormData.PageGuid is null because the form is inside a block var map = PermanentLinkMapStore.Find(e.FormData.PageGuid) as PermanentContentLinkMap; .. .. .. }
Thanks for your help