<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Programmatically submit a form in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/programmatically-submit-a-form/m-p/254522#M207652</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd like to know if there's a way for programmatically submit a form - generated with the "new Alfresco.formUI(…)" constructor - without involving the user click on the submit button.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In classic javascript it could be document.forms["form_id"].submit() but this doesn't work for Alfresco's forms (error from the server).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried to simulate the "click" event to the submit button with the YUI libraries, but it seems too much complicated for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Roberto&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 17 Apr 2011 09:15:30 GMT</pubDate>
    <dc:creator>soulpower</dc:creator>
    <dc:date>2011-04-17T09:15:30Z</dc:date>
    <item>
      <title>Programmatically submit a form</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/programmatically-submit-a-form/m-p/254522#M207652</link>
      <description>Hi,I'd like to know if there's a way for programmatically submit a form - generated with the "new Alfresco.formUI(…)" constructor - without involving the user click on the submit button.In classic javascript it could be document.forms["form_id"].submit() but this doesn't work for Alfresco's forms (e</description>
      <pubDate>Sun, 17 Apr 2011 09:15:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/programmatically-submit-a-form/m-p/254522#M207652</guid>
      <dc:creator>soulpower</dc:creator>
      <dc:date>2011-04-17T09:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically submit a form</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/programmatically-submit-a-form/m-p/254523#M207653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've solved in a far from elegant way, that involves modifying the forms-runtime js.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The idea is to call the _submitInvoked function, but to do this I need the formUI instance inside the scope of my script. So I've modified the forms-runtime script to set a my script's var to "this" (that is the formUI instance itself). So from my script I call myvar._submitInvoked() and it works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;QUESTION: how I could get the formUI instance visible in my scope without modifying the core script?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Roberto&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Apr 2011 10:49:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/programmatically-submit-a-form/m-p/254523#M207653</guid>
      <dc:creator>soulpower</dc:creator>
      <dc:date>2011-04-17T10:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically submit a form</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/programmatically-submit-a-form/m-p/254524#M207654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Programmatically submitting a form is a bad design approach. Why do you have to do that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ainga&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 11:43:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/programmatically-submit-a-form/m-p/254524#M207654</guid>
      <dc:creator>zaizi</dc:creator>
      <dc:date>2011-04-19T11:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically submit a form</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/programmatically-submit-a-form/m-p/254525#M207655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi zaizi, thanks for the reply!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The customer wants to upload a content and set the content's metadatas within the same form. By now, Alfresco allows to separately set metadatas by clicking "edit metadata" once the file has been uploaded.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I've customized the upload interface by putting the custom form inside the upload panel (using component/form service). Obviusly in this way I have 2 submit buttons: one for the upload task, and one for the custom form. I've chosen to hide the last one (with css). By clicking on the upload button, the file is loaded into the repository and, FORTUNATELY, the flash-upload components retrieves the nodeRef of the uploaded content. In this moment I've to fire the custom form submit, in a programmatic way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do you could do this instead?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Roberto&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 12:17:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/programmatically-submit-a-form/m-p/254525#M207655</guid>
      <dc:creator>soulpower</dc:creator>
      <dc:date>2011-04-19T12:17:53Z</dc:date>
    </item>
  </channel>
</rss>

