<?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 Update Document property in a java script in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/update-document-property-in-a-java-script/m-p/320519#M7520</link>
    <description>&lt;P&gt;I'm running a custom XHTML layout where I'm running a script that makes a function that updates a document property. I'm trying to get it triggered by the onclick of a commandButton. So when the commandButton is pressed, in this example, I want the title of the document to be updated to "My Folder 2". Here's the script that I have:&lt;/P&gt;
&lt;P&gt;function myFunction() {&lt;/P&gt;
&lt;P&gt;DocumentModel doc = doc=env.getDocument();&lt;/P&gt;
&lt;P&gt;doc.setPropertyValue("dc:title", "My Folder 2");&lt;/P&gt;
&lt;P&gt;doc = session.saveDocument(doc);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;And then I run the commandButton part and I have onclick="myFunction();" Nothing happens when the button is pressed though. Any ideas? Thanks!&lt;/P&gt;</description>
    <pubDate>Sun, 08 Mar 2015 00:39:10 GMT</pubDate>
    <dc:creator>nathan1620_</dc:creator>
    <dc:date>2015-03-08T00:39:10Z</dc:date>
    <item>
      <title>Update Document property in a java script</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/update-document-property-in-a-java-script/m-p/320519#M7520</link>
      <description>&lt;P&gt;I'm running a custom XHTML layout where I'm running a script that makes a function that updates a document property. I'm trying to get it triggered by the onclick of a commandButton. So when the commandButton is pressed, in this example, I want the title of the document to be updated to "My Folder 2". Here's the script that I have:&lt;/P&gt;
&lt;P&gt;function myFunction() {&lt;/P&gt;
&lt;P&gt;DocumentModel doc = doc=env.getDocument();&lt;/P&gt;
&lt;P&gt;doc.setPropertyValue("dc:title", "My Folder 2");&lt;/P&gt;
&lt;P&gt;doc = session.saveDocument(doc);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;And then I run the commandButton part and I have onclick="myFunction();" Nothing happens when the button is pressed though. Any ideas? Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2015 00:39:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/update-document-property-in-a-java-script/m-p/320519#M7520</guid>
      <dc:creator>nathan1620_</dc:creator>
      <dc:date>2015-03-08T00:39:10Z</dc:date>
    </item>
  </channel>
</rss>

