I've been implementing the Axendo form builder succesfully in a few projects so far. I've also added a few custom user form controls to extend the initial set but I've come across a problem whilst creating a custom upload file control.
I'd like to allow the user to specify a file to be uploaded and then associate it with a newly generated page during form submission. I thought that the best way to do this would be to attach the uploaded document as a media item during the ISubmitHandler.OnSubmit method. I would then get the new media item ID and store this in the new node being created during the form submission so that everything was nicely related.
The problem I am having is that I cannot get the OnSubmit function to fire and therefore I cannot get the correct opportunity to create the new media item.
Has anyone used the Axendo form for upload controls or has been able to get the OnSubmit method to work?
Since this is a 3th party product I don't think there are a lot of users that have experience with this. I've pinged the developer who build this. Hopefully he will answer your questions soon.
Thanks for getting back to me. I managed to write a custom upload control for the Axendo form but the only part remaining is that I cannot get the submit event to fire on the control. The control implements the ISubmitHandler interface and I was expecting that the code I provided within OnSubmit() would be executed whenever the form was succesfully submitted.
How do I determine within my control that the form has been succesfully submitted as I need to add a newly uploaded media item to the media library then return the new media ID as the form placeholder value?
One other question, I have been implementing recaptcha as a custom form control for a client who requires a great level of accessibility within their site. I need to disable the recaptcha validation control when the control is being rendered within the Umbraco editor view and enable only when the control is being rendered within a published page. Is there a way to determine this programatically?
I've put a fix in place to check that the page name for the current control is not editContent.aspx but this feels wrong. Will this page name always remain the same or is there another method I can call to determine whether the user is viewing the control in the editor?
If you need to read from that File Uploader u can use:
foreach (Property property in Properties) { if (property.Value.GetType() == typeof(HttpPostedFile)) { var file = (HttpPostedFile)property.Value; var fileName = Path.GetFileName(file.FileName); var fileNameProp = property.Properties.Find(p => p.Key == "PreferredFileName"); if (fileNameProp != null && fileNameProp.Value.ToString() != "") { fileName = fileNameProp.Value.ToString(); } DoYourThingForAddingToMedia(file.InputStream, fileName); } }
The submit does not fire on formcontrols. You should create your own submithandler and register it in the AxendoFormDesigner.config before the redirector otherwise it won't fire.
About your problem with the recaptcha: Do you need to know if it's on the backend because the validation fires on save? If thats the case you should add a validationgroup to the recaptcha and use the property ValidationGroup of the IFormControl interface to fill it.
"How do I determine within my control that the form has been succesfully submitted as I need to add a newly uploaded media item to the media library then return the new media ID as the form placeholder value?"
If you realy need to do that within your formcontrol I would put the logic in Property Property { get; }
The properties are collected after the page is validated.
Axendo form submission with custom form controls
I've been implementing the Axendo form builder succesfully in a few projects so far. I've also added a few custom user form controls to extend the initial set but I've come across a problem whilst creating a custom upload file control.
I'd like to allow the user to specify a file to be uploaded and then associate it with a newly generated page during form submission. I thought that the best way to do this would be to attach the uploaded document as a media item during the ISubmitHandler.OnSubmit method. I would then get the new media item ID and store this in the new node being created during the form submission so that everything was nicely related.
The problem I am having is that I cannot get the OnSubmit function to fire and therefore I cannot get the correct opportunity to create the new media item.
Has anyone used the Axendo form for upload controls or has been able to get the OnSubmit method to work?
Sorry to bump but I'm pushed for time on this one. Can anyone help me with this?
Hi Brian,
Since this is a 3th party product I don't think there are a lot of users that have experience with this. I've pinged the developer who build this. Hopefully he will answer your questions soon.
Cheers,
Richard
Hi Brian,
I have already created an fileupload.
Check the latest version at http://www.axendo.nl/packages/axendoformdesigner/Axendo_Form_Designer_1.1.zip
In your submithandler you can do whatever you need. If you have any questions please drop me an email at ron axendo nl.
Ron
Ron,
Thanks for getting back to me. I managed to write a custom upload control for the Axendo form but the only part remaining is that I cannot get the submit event to fire on the control. The control implements the ISubmitHandler interface and I was expecting that the code I provided within OnSubmit() would be executed whenever the form was succesfully submitted.
How do I determine within my control that the form has been succesfully submitted as I need to add a newly uploaded media item to the media library then return the new media ID as the form placeholder value?
Thanks again.
One other question, I have been implementing recaptcha as a custom form control for a client who requires a great level of accessibility within their site. I need to disable the recaptcha validation control when the control is being rendered within the Umbraco editor view and enable only when the control is being rendered within a published page. Is there a way to determine this programatically?
Quick update:
I've put a fix in place to check that the page name for the current control is not editContent.aspx but this feels wrong. Will this page name always remain the same or is there another method I can call to determine whether the user is viewing the control in the editor?
Have you tried the latest version?
The latest version already has an File Uploader.
If you need to read from that File Uploader u can use:
The submit does not fire on formcontrols. You should create your own submithandler and register it in the AxendoFormDesigner.config before the redirector otherwise it won't fire.
About your problem with the recaptcha: Do you need to know if it's on the backend because the validation fires on save?
If thats the case you should add a validationgroup to the recaptcha and use the property ValidationGroup of the IFormControl interface to fill it.
Hope this helps.
Ron
If you realy need to do that within your formcontrol I would put the logic in Property Property { get; }
The properties are collected after the page is validated.
Ron
I suggest that Axendo add a forum on their Form Builder site - makes more sense to discuss their products there
I agree Niels, thats why I suggested to continue this conversation by email.
@Brian Scott for any other questions please drop me an email. We are no longer allowed to discuss this product using our umbraco.
Ron
It's cool to discuss something like this, I just think that 3rd party product support makes more sense on a 3rd party forum :)
is working on a reply...