cancel
Showing results for 
Search instead for 
Did you mean: 

Update Document property in a java script

nathan1620_
Confirmed Champ
Confirmed Champ

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:

function myFunction() {

DocumentModel doc = doc=env.getDocument();

doc.setPropertyValue("dc:title", "My Folder 2");

doc = session.saveDocument(doc);

}

And then I run the commandButton part and I have onclick="myFunction();" Nothing happens when the button is pressed though. Any ideas? Thanks!

0 REPLIES 0