cancel
Showing results for 
Search instead for 
Did you mean: 

Passing paramter to a URL on Table column select...

Former Member
0 Kudos

Hi,

I have created a Webdynpro that displays data from a RFC in Tableview.My requirement is to provide one of the columns as Link to a external URL and pass that column value as paramter to the URL.

I have created a LinkToURL for that column and specified the URL under reference property.

When I run the application I am able to see the column with link and when I click it I am being taken to the website also.But how do I pass the column value as paramter to the URL..?

Any help is greatly apperciated and points will be rewarded.

Thanks,

Vasu.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Vasudevarao,

After 2 (or more?) years of existence, SDN accumulate a lot of usefull information. Use "Search" functionality -this way you'll find an answers much quicker.

Regarding your question:

See tutorial: Dynamic Links in a Web Dynpro Table (Apr 25, 2005)

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8080487b-0301-0010-3f96-dcc...

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Answers (2)

Answers (2)

Former Member
0 Kudos

hi vasu

instead of using link to url try using link to action.in eventhandler of the action of the link to action

you may give the following code which tries to open the url in a external window.you create a context attribute of type string say myurl and set it to the respective url

in the onaction eventhandler

{

String url=wdcontext.currentcontextelement.getmyurl();

String title=wdcontext.currenttablenodeelement.get<column>();

IWDWindow win=wdComponentAPI.getWindowManager().createexternalWindow(String url,String title ,Boolean modal);

win.open();

}

the method createexternalwindow has three parameters

a String url this can be your reference to the url.

a string title this can be the data you want to pass

you retrieve the column data from the respective table element

and the third is whether you want it to be a modal window or not.

hope this helps

regards

saravana.

Former Member
0 Kudos

Hi Saravana and Helmut,

Thanks for your quick responses but my problem has not been resolved yet.

I declared a value attribute link and had set it in the wdInit() like wdContext.currentXXXElement().setLink("<b>http://www.abc.com/cgi-bin/tracking?action=track&language=english&cntry_code=us&initial=x&mps=y&<b>tno=xyz</b>");</b>

In the event handler of LinkToAction , I wrote something like this..

String url=wdcontext.currentcontextelement.getmyurl();

String title=wdcontext.currenttablenodeelement.get<column>();

IWDWindow win=wdComponentAPI.getWindowManager().createexternalWindow(String url,String title ,Boolean modal);

win.open();

I want the the string <b>title</b> to be passed as paramter in the URL inplace of <b>xyz</b>.

How can this be acheived??

Thanks,

Vasu.

htammen
Active Contributor
0 Kudos

Hi Vasu,

define a calculated attribute in the value node that is bound to your table control. Bind this attribute to your LinkToURL contol.

In the getter method of the attribute write:

return "http://myurl?" + myparameter;

If you are dealing with a model node (not value node) you have to add a value node of cardinality 1..1 to your model node and define the attribute there. I think this depends on the SP level you are using and therefore may not be necessary.

Regards

Helmut