Requirement :
Have a table which displays different rows of documents and is made clickable. On clicking the document link, the particular document should open.
I am using ActionService.execute to call the view action to open the document.
The argumentlist contains multiple objectids because of which it is looped.
On clicking the document, all the documents are opened at one go in different windows or just the last added is opened.
Expected result : Only the particular document should be opened.
Please find the code excerpt below :
//Returns comma separated object ids inside a particular folder
String objIdList=getDocumentDetails(UPILnk.getLabel(),SubLnk.getLabel(),lnk.getLabel());
String objectIdArray[] =objIdList.split(",");
if(objectIdArray.length<=1){
System.out.println("Object id for 0th element"+objectIdArray[0]);
String docid="";
if (objectIdArray.length==1){
docid=objectIdArray[0];
arglist.add("objectId",docid);
context.set("objectId", docid);
ActionService.execute("view", arglist, context, this, null);
System.out.println("Came here to open the document");
}
}
else
{
for (int i=0;i<objectIdArray.length;i++){
arglist.add("objectId",objectIdArray[i]);
context.set("objectId", objectIdArray[i]);
System.out.println("Arguement list : : : :"+arglist.toString());
ActionService.execute("view",arglist, context, this, null);
System.out.println("Opened here !!! ");
}
}
}
Also, revert for any further details.
ENVIRONMENT INFORMATION
------------------------------------
<<Product Information>>
Product: Webtop
Version: 6.5 SP2