AnsweredAssumed Answered

Custom Renders

Question asked by c4lc4ll on Mar 6, 2012
Latest reply on May 16, 2014 by izodev
Hi,
    I have created a custom action which needs severl parameters. In order to set these parameters I add a js "handler" rule-config-action-custom.js but I don't know how to create new renders.
For example I want to create a render, template-picker in oder to list (and select) all template files in /company_home/dictionary/content_templates.

I start from this code
renderers:
      {
                
         "arca:template-picker":
         {
            /* Mark this renderer as "manual" in edit mode so no default ui handling is done */
            manual:
            {
               edit: true
            },
            /* Object to save values in */
            currentCtx: {},
            edit: function (containerEl, configDef, paramDef, ruleConfig, value)
            {
               // Save variables from the last click in the currentCtx object
               this.renderers["arca:template-picker"].currentCtx =
               {
                  configDef: configDef,
                  ruleConfig: ruleConfig,
                  paramDef: paramDef
               };
              
               // Create a category picker
               var picker = new Alfresco.module.ControlWrapper(Alfresco.util.generateDomId());
               picker.setOptions(
               {
                  type: "category",
                  container: containerEl,
                  value: (ruleConfig.parameterValues ? ruleConfig.parameterValues["template_node"] : null),
                  controlParams:
                  {
                     multipleSelectMode: false
                  },
                  fnValueChanged:
                  {
                     fn: function(obj)
                     {
                        // When picker is closed make sure we save the values from the picker in the hidden form fields
                        var ctx = this.renderers["arca:template-picker"].currentCtx;
                        // this._setHiddenParameter(ctx.configDef, ctx.ruleConfig, "category-aspect", "cm:generalclassifiable");
                        // this._setHiddenParameter(ctx.configDef, ctx.ruleConfig, "category-value", obj.selectedItems[0]);
                        // Re run validations for the form connected to the config component
                        this._updateSubmitElements(ctx.configDef);
                     },
                     scope: this
                  }
               });
               picker.show();
            }
         }
      }

But I don't know how to go on after var ctx ………..

Outcomes