cancel
Showing results for 
Search instead for 
Did you mean: 

Opening document through LinkToAction

Former Member
0 Kudos

Hi,

I have a LinkToAction UI element, this link points to a document.

The display of the link is like this

<u>C:/Documents/New.doc</u>

But when i click on this link, nothing is happening, whether i have to set some action in onActionLinkClick method or leave it blank ?

I thought the OS will automatically open this word doc.

Do i have to do any special settings in browser or server.

Thanks

Senthil

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi senthil,

if you enable the directory listing option under the general tab then you can give an alias name for a folder in server and can open a folder on click of link to action.you can put all the documents in the folder and can open it

Regards

Rohit

Former Member
0 Kudos

Hi Rohit,

Thanks. It works fine, for folders i have enabled directory listing in general tab, i think it requires a restart, is it ?

Thanks

Senthil

Former Member
0 Kudos

Hi Senthilkumar,

It doesn't require a restart. You just have to select the option and redeploy the application.

Regards

Rohit

Former Member
0 Kudos

Hi Rohit,

Thanks, it works fine without WAS restart.

Thanks

Senthil

Answers (1)

Answers (1)

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Senthil,

it seems as if you intend to let the user open a file on his or her local file system via a hard file reference.

Let me give you the following recommendations:

Opening a File which is stored on the server is done using the FileDownload-UI-element.

For opening a local file on the client you can use the LinkToURL-UI-element (but not the LinkToAction). You can use the file: prefix for addressing files on the client's local file system. When doing this you must be sure as an application developer that this file really exists. You cannot react on a file not found event on the client machine.

Regards, Bertram

Former Member
0 Kudos

Hi ,

You can go to visual admin->services->http provider

select the aliases tab

create a alias for the document and give the path

Create an action for link to action and write the following code in implementation

IWDWindow newwindow = wdComponentAPI.getWindowManager().createExternalWindow("http://<server name>:50000/<alias name>","<title>",false);

newwindow.open();

or you can mention the url in IFrame

Regards

Rohit

Former Member
0 Kudos

Hi Bertram,

First i tried using the LinkToURL, it gave me a error saying invalid URL.

I gave the full path of the document in the local machine. File is there in the local (client) machine.

Suppose my file is in <u>C drive</u> under a folder called <u>TEST</u>, file name is <u>First.doc</u>

What should be my URL.

Hi Rohit,

I will try to read the file from server and will get back to you. My requirement was to open the document from local client machine.

Thanks

Senthil

Former Member
0 Kudos

Hi Senthilkumar,

You can't access files from the client machine. You can open documents resided on server machine only.

Regards,

Bhavik

Former Member
0 Kudos

Hi,

Will try to read the document from server.

Thanks

Senthil

Former Member
0 Kudos

Access the document from the server.

Create an http alias for the documents

I believe it is better to use the LinkToUrl instead of the LinkToAction here.

Former Member
0 Kudos

Hi,

You have to put it in the server .If you have the document in test folder in c drive

then go to

\usr\sap\<instance name>\JC<instance number>\j2ee\admin\go.bat

open visual admin

go to services->http provider

select the tab alias

give a name say testword and define the path as c:/test/<name of the document>.doc

save properties

write the code below in the action associated with the link

IWDWindow newwindow = wdComponentAPI.getWindowManager().createExternalWindow("http://cgnlpt041:50000/testword","<title of window>",false);

newwindow.open();

deploy the project

Hope this helps you

Regards

Rohit