Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Adding HyperLinks to WorkFlow Forms
shuba
I need to display a HyperLink that opens another browser window.
I added the following code in the header section of the JSP:
<SCRIPT LANGUAGE="JavaScript" ><![CDATA[
function popitup(url)
{
newwindow=window.open(url,'name','height=200,width=150');
if (window.focus) {newwindow.focus()}
return false;
}
]]> </SCRIPT>
I tried it with and without the CDATA component.
I added the following code in the body:
<tr><td><a href="index.html" onClick="return popitup('index.html')">Link to popup</a></td></tr>
This was added before the </form> end tag.
When I run the process in WorkSite MP , it does not give me an error, but the form is blank.
My Questions:
1. Are there any guidelines how WorkFlow JSP forms can be modified? Is it documented?
2. How do I make this hyperlink work?
Can somebody please help? Really appreciate it !
Find more posts tagged with
Comments
Migrateduser
Hello, Shuba!
I was hoping by viewing your JavaScript snippet, I'd be able to notice an issue that would result in a page compilation error - because that's what a blank workflow form generally implies. So I think the next step is to find out exactly what this error is.
I don't believe you'll see any indication of it in the worksitemp.log file (but don't trust me - please verify). And, instead, you'll have to refer to your servlet container log files. Somewhere, you'll spot a page compilation exception stack trace. Please find what that might be and share that with us, if you would be so kind.
I noticed you used a new <SCRIPT tag.... how about using the existing one? If you look in the workflow form, I believe you'll see the following code somewhere:
<script language="javascript"><![CDATA[
function doInit()
{
document.workflowFormForm.processId.value = "]]><c
ut value='${workflowProcess.id}'/><![CDATA[";
.
.
.
Perhaps, just before the "function doInit()" line, you can add your JavaScript method, instead of having two <script> tags. (Not that I expect this to resolve the issue...)
But then again, there's a better way than what I suggested above. All that we're discussing implies "customizing" a workflow form. It's always better if you can get away with adding fields and JavaScript without having to customize your form. This can be done by making use of the HTML postscript or prescript fields of an existing form field in the Forms Manager form editor. (In which case, you'd need to add a <script> tag.)
Best of luck! Let us know how it goes!
Thanks,
Nick
The world is my country, all mankind are my brethren, and to do good is my religion. - Thomas Paine
Migrateduser
Shuba,
I tried your JavaScript, just as it was and it WORKED for me. We need to find out why it's not working for you. There should be error messages in the worksitemp.log file and/or the servlet container log files.
Please find the errors and post them here. We can discuss it then. Just to be extra sure, I'll include my full customized workflow form below (resulting in how I think your form should look like). (Thou, once you get yours working, I would still recommend trying to find a way to redo it so that you don't have to customize it by hand.)
Thanks,
Nick2112
<jsp:root version="1.2"
xmlns:jsp="
http://java.sun.com/JSP/Page"
xmlns:c="/tlds/c.tld"
xmlns:fmt="/tlds/fmt.tld"
xmlns:wr="/tlds/wrmp.tld">
<jsp:directive.page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"/>
<jsp:directive.page language="java"/>
<wr:workflowFormInitialization/>
<fmt:setLocale value='${locale}'/>
<jsp:useBean id='today' class='java.util.Date'/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<link href="monitor.css" type="text/css" rel="Stylesheet"/>
<wr:script><jsp:text><![CDATA[
var $objectId = this.parent.$objectId;
var $parentId = this.parent.$parentId;
var $thisUrl = this.parent.$thisUrl;
var $locale = this.parent.$locale;
var $cssFile = this.parent.$cssFile;
var $dateFormat = "]]></jsp:text><c
ut value="${dateFormat}" default="M/d/yy"/><jsp:text><![CDATA[";
var $timeFormat = "]]></jsp:text><c
ut value="${timeFormat}" default="h:mm a"/><jsp:text><![CDATA[";
var $dateTimeFormat = "]]></jsp:text><c
ut value="${dateTimeFormat}" default="M/d/yy h:mm a"/><jsp:text><![CDATA[";
document.write('<link rel="Stylesheet" type="text/css" href="' + $cssFile + '"/>');
]]></jsp:text></wr:script>
<wr:script language="javascript" src="${javascriptWsmp}"/>
<wr:script language="javascript" src="${javascriptWrmp}"/>
<wr:script><jsp:text><![CDATA[
this.topImanageWindow = self;
function doInit()
{
document.workflowFormForm.processId.value = "]]></jsp:text><c
ut value='${workflowProcess.id}'/><jsp:text><![CDATA[";
document.workflowFormForm.category.value = unescape("]]></jsp:text><c
ut value='${udas["category"].value}'/><jsp:text><![CDATA[");
if (]]></jsp:text><c
ut value='${readOnly}'/><jsp:text><![CDATA[)
{
makeElementsReadOnly(document.workflowFormForm);
}
else
{
makeFieldEditable(document.workflowFormForm);
}
}
]]></jsp:text></wr:script>
<SCRIPT LANGUAGE="JavaScript" ><![CDATA[
function popitup(url)
{
newwindow=window.open(url,'name','height=200,width=150');
if (window.focus) {newwindow.focus()}
return false;
}
]]> </SCRIPT>
</head>
<body onload="doInit()">
<iframe name="helpFrame" id="helpFrame" height="1" width="1" frameborder="0" style="position:absolute;visibility:hidden;margin:0;" scrolling="yes" src="blank.htm"><!-- --></iframe>
<form name="workflowFormForm" action="javascript:submitForm('processform')" method="post">
<table>
<tr>
<td class="faultMsg">
<c
ut value='${invalidMessage}'/>
</td>
</tr>
</table>
<table width="95%">
<tr>
<td class="propertyCaption" nowrap="true">Category</td>
<td class="propertyValue">
<input name="category" caption="Category" type="text" udaType="string" style="width:90%" required="false" editable="true" maxLength="255"/>
</td>
</tr>
<tr><td><a href="index.html" onClick="return popitup('index.html')">Link to popup</a></td></tr>
</table>
<input name="processId" type="hidden"/>
<input name="actionName" type="hidden"/>
</form>
<applet code="com.imanage.workteam.search.picker.pickerDialog.NRLookUp.class" width="1" height="1" id="lookupApplet" name="lookupApplet" codebase="cab" archive="picker.jar" viewastext="1">
<param name="locale"><c
ut value='${localeHyphenated}'/></param>
</applet>
</body>
</html>
</jsp:root>
The world is my country, all mankind are my brethren, and to do good is my religion. - Thomas Paine
shuba
Nick, thanks for replying to "basic" questions !
My Jsp worked too. Did two things:
1. Changed the language="JAVASCRIPT" to language="javascript", per your suggestion.
2. I am new to JavaScripting and in my original JSP, I had spaces between the language="JavaScript" and the > clause.
There were also spaces between the ]]> and </script> clause.
Dunno if the second change makes a difference, but really appreciate your help!
Migrateduser
Shuba,
Congratulations on resolving the form compilation issue. I'm not sure why any of the two changes you mentioned would have fixed the page. Did an error message in the log file help shed some light on the matter? But this question is no longer relevant, I suppose.
Good going!
Take care,
Nick
The world is my country, all mankind are my brethren, and to do good is my religion. - Thomas Paine