Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Brian Scott 21 posts 41 karma points
    Sep 21, 2009 @ 19:03
    Brian Scott
    0

    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?

  • Brian Scott 21 posts 41 karma points
    Sep 22, 2009 @ 12:14
    Brian Scott
    0

    Sorry to bump but I'm pushed for time on this one. Can anyone help me with this?

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Sep 22, 2009 @ 12:37
    Richard Soeteman
    0

    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

  • Ron Brouwer 273 posts 768 karma points
    Sep 22, 2009 @ 12:52
    Ron Brouwer
    0

    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

  • Brian Scott 21 posts 41 karma points
    Sep 22, 2009 @ 13:08
    Brian Scott
    0

    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.

  • Brian Scott 21 posts 41 karma points
    Sep 22, 2009 @ 13:10
    Brian Scott
    0

    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?

  • Brian Scott 21 posts 41 karma points
    Sep 22, 2009 @ 13:36
    Brian Scott
    0

    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?

  • Ron Brouwer 273 posts 768 karma points
    Sep 23, 2009 @ 11:05
    Ron Brouwer
    0

    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:

    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.

    Hope this helps.

    Ron

     

  • Ron Brouwer 273 posts 768 karma points
    Sep 23, 2009 @ 12:30
    Ron Brouwer
    0
    "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.

    Ron

     

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Sep 23, 2009 @ 12:53
    Niels Hartvig
    0

    I suggest that Axendo add a forum on their Form Builder site - makes more sense to discuss their products there

  • Ron Brouwer 273 posts 768 karma points
    Sep 23, 2009 @ 13:28
    Ron Brouwer
    0

    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

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Sep 23, 2009 @ 14:15
    Niels Hartvig
    0

    It's cool to discuss something like this, I just think that 3rd party product support makes more sense on a 3rd party forum :)

Please Sign in or register to post replies

Write your reply to:

Draft