I have a application running on web. In this application
I have a form with a link on it. This link calls a javascript function which opens a view in new window. Javascript code used is
window.open(url, windowname, other_parameters);
This view has 3 columns. Out of these 3 columns, 2nd column has formula
“[input type="checkbox" name=“checkboxname” value="”+ codenumber + "" onClick="javascript:add(this.value)">] "
Javascript function “add” adds selected document’s “codenumber” fields value in a particular field (say “listing”) on form. Javascript function add is as given below.
function add(val){
var f = window.opener.docuemt.forms[0] >>line1
f.listing.value=f.listing.value + " \ ; " + val; >>line2
window.opener._doClick(‘$Refresh’,this,null,null) >>line3
}
This javascript method is in the JSHeader of the $ViewTemplate form of this view.
This works fine for selecting individual document from view by checking the checkbox. I want a functionality wherein I can provide user with a button/ link by clicking on which all the documents will be processed by the javascript method “add”.
I tried to put formula hotspot link titled ‘Select All’ on $ViewTemplate form of this view. On this link I wrote the code to call javascript method, using @URLOpen
@URLOpen(“javascript:add(parameter)”) (Initial try to invoke javascript method from link)
When I tested this link, the control got moved to javascript function, but the code didn’t added the values to fields. Even I tested by adding alert aft line2 of add method. Alert appeared as expected but the code didn’t added the values to the listing field.
Can anyone help me in this regard. The same code is working when getting invoked from checkbox’s Onclick event? So while invoking it from $ViewTemplate form am I making any mistake? Is there any other way to achieve this?
Waiting for responses.
Thanks in advance.
Harshad ![]()