AnsweredAssumed Answered

POST data in template

Question asked by nilsw on Dec 15, 2009
Latest reply on Dec 16, 2009 by nilsw
Stupid newbie question probably, but here it goes.

I have managed to AJAX load HTML into a dialog from a custom Share toolbar action with a GET request. But when I switch to POST (which I will need as I have to send a lot of data), I can no longer access the request parameters in the template.

The request looks like this:

Alfresco.util.Ajax.request(
{
   method: "POST",
   url: Alfresco.constants.PROXY_URI + "cadq/common/slingshot/doclib/action/order-form",
   dataObj:
   {
      printOrderRef: printOrderRef,
      printOrderFileName: printOrderFileName,
      htmlid: this.id
   },
   successCallback:
   {
      fn: this.onPrintOrderFormLoaded,
      scope: this
   },
   failureMessage: "Could not load Print Order Form template",
   execScripts: true
});

and the template

<div id="${args.htmlid}-dialog" class="details">
   <div id="${args.htmlid}-title" class="hd">Utskriftsbest&auml;llning</div>
   <div class="bd">
      <p>Best&auml;llningsfil: ${args.printOrderFileName}</p>
      <form id="${args.htmlid}-form" action="#" method="post">
         <div class="bdft">
            <input type="button" id="${args.htmlid}-ok" value="OK" tabindex="6" />
            <input type="button" id="${args.htmlid}-cancel" value="Avbryt" tabindex="7" />
            <input type="hidden" id="printOrderRef" value="${args.printOrderRef}" />
         </div>
      </form>
   </div>
</div>

when I run this I get

freemarker.core.InvalidReferenceException - Expression args.htmlid is undefined

So, how do I send and reference parameters with POST?

Outcomes