Hi,

I am trying to use JST in workflow and getting error.

AppEvent: An error '[object Error]' was encountered while executing the
script '(function(){var data = { products: [ { name: "mac", desc:
"computer", price: 1000, quantity: 100, alert:null }, {name: "ipod",
desc: "music player", price: 200, quantity: 200, alert:"on sale now!" },
{ name: "cinema display", desc: "screen", price: 800, quantity: 300,
alert:"best deal!" }], customer: { first: "John", last: "Public", level:
"gold" }}; var temp = JUICE.UICtrlUtil.getTemplate
(dojo.baseUrl("../JUICE/controls/templates/Container_l.html"),
"Container_l"); var html = JUICE.UICtrlUtil.processTemplate(data, temp);
return html; })();' (Function expected)

Let me explain what i did to use JST.

deined field in workflow as below

Field Name - *AppEvent*, Control Type - *HTML*
In HTML content i have the java script as below

(FUNCTION(){VAR DATA = { PRODUCTS : [ { NAME: \"MAC\", DESC:
\"COMPUTER\", PRICE: 1000, QUANTITY: 100, ALERT:NULL }, {NAME: \"IPOD\",
DESC: \"MUSIC PLAYER\", PRICE: 200, QUANTITY: 200, ALERT:\"ON SALE
NOW!\" }, { NAME: \"CINEMA DISPLAY\", DESC: \"SCREEN\", PRICE: 800,
QUANTITY: 300, ALERT:\"BEST DEAL!\" }], CUSTOMER : { FIRST: \"JOHN\",
LAST: \"PUBLIC\", LEVEL: \"GOLD\" }};
VAR TEMP = JUICE.UICTRLUTIL.GETTEMPLATE
(DOJO.BASEURL(\"../JUICE/CONTROLS/TEMPLATES/CONTAINER_L.HTML\"),
\"CONTAINER_L\");
VAR HTML = JUICE.UICTRLUTIL.PROCESSTEMPLATE(DATA, TEMP);
RETURN HTML; })();

And also defined the template as below with name - Container_l.html

<DIV CLASS=\"NV-FONTSMALL\">
CONTAINER LIST
</DIV>
<TABLE BORDER=\"2\" CELLSPACING=\"2\">
<TR>
<TH CLASS=\"NV-FONTEXTRASMALL\">SHORT NAME</TH>
<TH CLASS=\"NV-FONTEXTRASMALL\">DN</TH>
</TR>
{VAR I=0}
{FOR P IN RS._DATA.RAW.MAP}
{IF P.MAP}
<TR CLASS=\"{IF
I%2==1}NV-TABLE-ROW-ODD{ELSE}NV-TABLE-ROW-EVEN{/IF}\">
<TD CLASS=\"NV-FONTEXTRASMALL\">
<SPAN
STYLE=\"PADDING-LEFT:10PX;TEXT-DECORATION:BLINK;CURSOR:POINTER\">
${P.MAP.DISP}
</SPAN>
</TD>
<TD CLASS=\"NV-FONTEXTRASMALL\">
<SPAN
STYLE=\"PADDING-LEFT:10PX;TEXT-DECORATION:BLINK;CURSOR:POINTER\">
${P.MAP.FULL}
</SPAN>
</TD>
</TR>
{/IF}
${I++|EAT}
{FORELSE}
<TR>
<TD>
NO CONTAINERS WERE FOUND
</TD>
</TR>
{/FOR}

</TABLE>

This template is placed in IDMProv.war/JUICE/controls/templates/.

Restarted the JBoss and when i click on the workflow to initiate then
its returning the error mentioned above.


--
rajeshemailto
------------------------------------------------------------------------
rajeshemailto's Profile: http://forums.novell.com/member.php?userid=32760
View this thread: http://forums.novell.com/showthread.php?t=363958