How do I intermingle freemarker and JS code.  I am trying to dynamically set 
text of a title from a JS function using the model for the freemarker template. 
 What I have so far is:

function updateBlog( listItem )
{
    var box = document.getElementById( "box-1" );
    if ( box.hasChildNodes() )
    {
      while( box.childNodes.length >= 1 )
      {
        box.removeChild( box.firstChild );
      }
    }

    var child = document.createElement( "h3" );
    child.appendChild( document.createTextNode( "Chicago Blog: 
${model.getSubject( listItem.id ).name}" ) );
    box.appendChild( child );
}

The code of interest is "${model.getSubject( listItem.id ).name}".  What I am 
trying to do is invoke the getSubject method in the model with the parameter 
from the listItem function parameter from JS.  I get a freemarker exception 
saying listItem is unknown (not surprising).  So, the question is how can I go 
about building up the freemarker method invocation from the JS function?

Thanks for all help and suggestions.

Rakesh

----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to