AnsweredAssumed Answered

how to write data to an aspcet using java script

Question asked by friedman30 on May 31, 2007
Latest reply on Jun 20, 2007 by kevinr
hi,

i have added a custom aspect:

<aspect name="custom:ThumbnailAspect">
           <title>Thumbnail Aspect</title>
            <associations>
             <association name="custom:Thumbnail">
                <title>Thumbnail</title>
                <source>
                 <many>true</many>
              </source>
                <target>
                   <class>cm:content</class>
                   <mandatory>false</mandatory>
                         <many>false</many> <!– allow only one thumbnail to be added –>
                   </target>
               </association>
          </associations>
         </aspect>
now, i need to add the content of this aspect (which will be a link to another file) using a java script.

i am running this script:
var props = new Array(1);
          props["custom:Thumbnail"] = PATH;
          var added=  document.addAspect("custom:ThumbnailAspect", props);

where document is the content that holds the aspect, and PATH is the value i want to add.
after running it, the value of added is true (and i do have a new thumbnail value added to the content), but the value (PATH) is still empty….

i can't find a way to set the value for an aspect…

any ideas???  :shock:

Outcomes