We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5811
    • 1,717 Posts
    To handle the ajax request the snippel call is [[AjaxDemo]]. This hidden document is available to treat the ajax requests coming from all the documents which use AjaxDemo.

    If A document has [[AjaxDemo? proper1=`new1` &ajaxId=`21`]] and an other document has [[AjaxDemo? proper2=`new2` &ajaxId=`21`]] with a single ajax handler. I need to pass the changed properties via Ajax.

    I still don’t understand why you have to pass any of the properties via AJAX if the snippet can get it automatically from the default properties, or be simply overridden by a property set that is shared between the AJAX request handler snippet and the form rendering snippet?
    Because for this, I need to set up as many ajax handlers than Ajaxdemo snippet calls:

    [[AjaxDemo? proper2=`new2` &ajaxId=`21`]] => with #21: [[AjaxDemo? proper2=`new2`]]

    [[AjaxDemo? proper4=`new4` &ajaxId=`22`]] => with #22: [[AjaxDemo? proper4=`new4`]]

    Which seems not confortable for the user. At each change on the main snippet call, he should think to replicate this change on the hidden ajax handler document. A snippet like AjaxSearch is enought complicated to not add the risks of misalignment of tags between the document snippet call and his Ajax handler document.
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: coroico at Apr 30, 2010, 02:30 AM


      I still don’t understand why you have to pass any of the properties via AJAX if the snippet can get it automatically from the default properties, or be simply overridden by a property set that is shared between the AJAX request handler snippet and the form rendering snippet?
      Because for this, I need to set up as many ajax handlers than Ajaxdemo snippet calls:

      [[AjaxDemo? proper2=`new2` &ajaxId=`21`]] => with #21: [[AjaxDemo? proper2=`new2`]]

      [[AjaxDemo? proper4=`new4` &ajaxId=`22`]] => with #22: [[AjaxDemo? proper4=`new4`]]

      Which seems not confortable for the user. At each change on the main snippet call, he should think to replicate this change on the hidden ajax handler document. A snippet like AjaxSearch is enought complicated to not add the risks of misalignment of tags between the document snippet call and his Ajax handler document.
      I still don’t think I completely understand; it’s just not how I would approach it maybe, but anyway...

      What you describe is the whole reason for Property Sets IMO; your calls above simply become:

      [[AjaxDemo@config21]] => with #21: [[AjaxDemo@config21]]

      [[AjaxDemo@config22]] => with #22: [[AjaxDemo@config22]]

      Much easier for the user to remember, much easier for them to customize (have you seen the property set editor?), and easier all around to make changes once everything is in place. And it’s also manageable without access to the file system.
        • 5811
        • 1,717 Posts
        [[AjaxDemo@config21]] => with #21: [[AjaxDemo@config21]]

        [[AjaxDemo@config22]] => with #22: [[AjaxDemo@config22]]

        Much easier for the user to remember, much easier for them to customize (have you seen the property set editor?), and easier all around to make changes once everything is in place. And it’s also manageable without access to the file system.

        have you seen the property set editor?
        Obviously, yes. I didn’t post 14 replies on this post without try to understand how it could be used.
        For the export of the property set, may be the set could be exported under the name of the property set rather than "properties.js". This will make easier the management of these property sets.


        As soon as a config property set is defined (without access to the file system - which is a good point), it will be more confortable for the user.
        But this means that now the user should get into the habit to "externalise" the tags in a property set. Which is, in comparaison with Evo, very new.

        To conclude this long post, for ajaxSearch, I will follow your proposed approach and use [[AjaxDemo@configX]] on the main document and on the document which handle the ajax request. And I leave the user define the property set for the config of the snippet call. Only the id the document which handle the ajax request will be passed thru javascript.

        Thanks for your answers, Jason. Hope, this post could help the others, to understand the property set mechanisms.