You may embed JavaScript directly in FreeMarker templates to perform interactive actions such as to pop-up new browser windows based on user mouse clicks.
To pop-up a new window on mouse events, follow these steps:
1. Open the FreeMarker template file.
2. Add the following Java script at the beginning of the file:
<SCRIPT language="javascript"> function call_fieldlookup(rootForumId, parentForumId ) { var obj_lookupwindow = window.open( "addSubSite?rootForumId=" + rootForumId + "&parentForumId=" + parentForumId, 'FieldLookup', 'width=500,height=250,scrollbars=yes, status=no,top='+my+',left='+mx+', dependent=yes,alwaysRaised=yes'); obj_lookupwindow.opener = window; obj_lookupwindow.focus(); } </script>
3. Add the following HTML to call the JavaScript:
<a href = "javascript:call_fieldlookup( '<@ofbizUrl>LookupFeature</@ofbizUrl>')"> <img src = "<@ofbizContentUrl>/images/fieldlookup.gif</@ofbizContentUrl>...