Copied to clipboard

Flag this post as spam?

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


  • Scott Blomfield 30 posts 57 karma points
    Jan 08, 2010 @ 16:30
    Scott Blomfield
    0

    Custom Picker Data Editor

    I'm creating a picker data editor, and so far I have found the framework really extensible and intuitive. I've based most of my work off of the mediaChooser, and it has been really helpful for understanding how this all works together.

    The way it uses my existing code from the app tree was unexpected, and really nice!

    Since the item in my tree isn't a CmsNode, I have created a new webservice with a function to get the text to display (I think this was the correct way to go, but if not - please let me know!), and marked it with a ScriptService attribute. I verified that browsing to the service.asmx/js does indeed show up the expected script.

    I added a ClientDependency attribute to my DataEditor class as follows:

     

    [

     

    ClientDependency(3, ClientDependencyType.Javascript, "procure/procureAjaxService.asmx/js", true)]

     

    The  webservice is located in /umbraco/procure/procureAjaxService.asmx

    I'm then attempting to consume the service in the javascript emitted by the DataEditor as follows:

    function ctl00_body_product_saveIdDo(treePicker) {
        if (treePicker != undefined) {
            document.getElementById("ctl00_body_product").value = treePicker;
            if (treePicker > 0) {
                Procure.Web.webServices.procureAjaxService.GetProductName(treePicker, ctl00_body_product_updateContentTitle);
            }    
        }

    but I am getting a script error on the Procure.Web.webServices.procureAjaxService line saying that Procure is null or undefined - when I inspect the generated html, I see no reference to include the client dependency javascript, so I was wondering if anyone had any idea what might be going on?

    I'm using Umbraco 4.0.3. Also, Procure (eCommerce umbraco package in development) is OSS, and the code is available on procure.codeplex.com - although it's not even nearly ready for anyone else to use yet. Just in case someone wants to take a peek at the code in more depth.

Please Sign in or register to post replies

Write your reply to:

Draft