cancel
Showing results for 
Search instead for 
Did you mean: 

LinkToURL Object Examples

Former Member
0 Kudos

Does anyone have any links to help/examples regarding using the LinkToURL Object inside a Table Object?

What I'm trying to do is a Master-Detail kind of thing where I have two IViews: One containing a set of web controls that determine search criteria, and a Table (with which to display the results). One of the columns of this table should be a <u>link</u> that navigates to the second IView whose sole content is a Table that displays details about the record whose <u>link</u> was clicked.

I'm currently looking at ways to do this, and (so far) haven't found any help on these forums.

A. Is this possible?

B. If so, is it possible using the LinkToURL object (as one of the columns in my table)?

C. Will EPCM help me instead or will OBN help me with solving this problem?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi Joseph,

Checkout The Link..,

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/dotnet/pdk for .net/pdk for .net faq - .net controls.faq

Regards,

Vinoth

Answers (3)

Answers (3)

Former Member
0 Kudos

Yes!!! Thank you for the information! I have thought of some of these points but haven't yet received a response from my client about the matter. Thank you!

Former Member
0 Kudos

Hi Joseph,

What you are describing sounds very much like a UI Pattern. In this Master-Detail Pattern, SAP usually recommends that all Master-Detail is in one place, where the "detail" table is sometimes hidden (on the same iView) until the link is clicked. This helps user orientation and familiarity with his options.

But to your question - You actually have several ways to implement your desired behavior:

OBN is one, which is I'd say is "standard" (but a bit of a over-kill in this case). Assign your “detail” iView as a target of the operation, and use an OBN link in the table. You can see samples and more details in the PDK documentation.

A more simple option would be to use EPCM.DoNavigate JS function, which you can call from a "LinkToUrl" control, or a button, or whatever you like. You can read about in the portal guides (see: http://help.sap.com/saphelp_nw04/helpdata/en/26/71c74030308431e10000000a1550b0/content.htm)

One more option, is to sperate the Master-Detail into 2 iViews, as you asked, and again not to do navigation, but to put both iViews on the same page, and use EPCM (subscribe and Raise) events for client side communication, or use server side events communication to pass the data between both iViews. On both you can read in the PDK documentation.

I'm sure there are also other ways to do this...

Regards,

Ofer

Former Member
0 Kudos

Hi,

I tried using LinkToURL in a Table cell.

When I hover mouse over the link it shows the URL.

But it doesn't open in a new Window, I used Target as blank too. Also, the URL which has part of server side is left as is.

Following is the code for the above mentioned problem:

<sap:TableCell Title="Help" SortState="ASCENDING" ID="TblHelpList_WSHORT"

Runat="server">

<sap:LinkToURL ID="linkToURL1" Target="_BLANK" ImageFirst="False"

Text='<%# DataBinder._Eval(Container.Parent, "DataSourceRow.DataItem.WSHORT") %>'

Reference=' http://win04/help/Default.aspx?ToURL=HelpInfo/Help.aspx?Pgno=<%#

DataBinder._Eval(Container.Parent, "DataSourceRow.DataItem.PGNO") %>' Runat="server">

</sap:LinkToURL>

</sap:TableCell>

Any help is greatly appreciated.

Thanks

Kiran

rima-sirich
Advisor
Advisor
0 Kudos

Hi Kiran,

You didn't mention the version of the Portal you are working with. In case the Portal is NW04s named also as EP7, then there is a possibility that the problem caused by the fact that PDK for .NET still doesn't support working with NW04s. In case the Portal is from the earlier version, then there is a possibility that the Reference attribute isn't calculated well. I would advice you to put in the Reference attribute static url and see if it works.

Regards,

Rima.

Former Member
0 Kudos

Hi Rima,

Thanks for your response. I am on NW 04 SP16 with .NET 2.0. I am trying to set the reference of LinkToURL in the ascx.cs

DataSourceRow rv = (DataSourceRow)e.Item.DataSourceRow;

string l_strPgno = Convert.ToString(rv.DataItem.GetType( ["PGNO"]);

linkToURL1 = (LinkToURL)e.Item.Cells[0].FindControl("linkToURL1");

linkToURL1.Reference = "http://win04/help/Default.aspx?PgNo="+l_strPgno;

I am not sure if I am extracting the PgNo and Object of LinkToURL

Any help is appreciated!!

Thanks

Kiran

Former Member
0 Kudos

Hi,

I think the problem is with checking for Item and AlternatingItem. Can somebody post how to check for Item and AlternatingItem for Table.ItemEventArgs.

Thanks

Kiran

rima-sirich
Advisor
Advisor
0 Kudos

Hi Kiran,

As you want to work with Control ( LinkToURL ) nested in the Table, I think that you should use Table.NestedItemEventArgs instead of Table.ItemEventArgs.

There is some tutorial here about using Controls nested in the Table https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/dotnet/pdk%20for%20.net/developer's%20Guide%20PDK%202.0%20for%20.NET/index.html

How to ... -> Using Input Controls in a Table Control.

Hope it helps.

Regards,

Rima.

Former Member
0 Kudos

Hi Rima,

I tried NestedItemEventArgs but its throwing an error of "Object reference not set to an instance of an object". One suggestion on .NET said to check for ItemType or AlternatingType. But I couldn't get the syntax right for it. something like ListItem.Item

I am kind of stuck at this point.

Any help is much appreciated!!

Thanks

Kiran

Former Member
0 Kudos

Thanks for replying. Though the document may have information that may lead to answers, my questions weren't really answered. Is IView-to-IView navigation possible, and what if any, technologies should I look at?