Skip to Content
avatar image
Former Member

How to set reference property of LINK_TO_URL ?

Hi,

I have one table control which contains 5 columns.

(tripno, startdate, destination, reason, activities).

I am binding values from the internal table.

In 5th column(Activities), i need to display URL for each record.

So that i have used LINK_TO_URL as cell editor.

for ex:

<b><u>Activities</u></b>

Edithttp://www.abc.com/test?tripno=1">Edit>

Edithttp://www.abc.com/test?tripno=2">Edit>

Edithttp://www.abc.com/test?tripno=3">Edit>

Edithttp://www.abc.com/test?tripno=4">Edit>

Edithttp://www.abc.com/test?tripno=5">Edit>

....

Plz refer the reference link of each edit otpion.

When user clicks a particular hyperlink, it navigates to another page/component thru URL with one key field(tripno) to retrieve related records in next page.

<b>Problem is:</b>

i am getting like this:

Edithttp://www.abc.com/test?tripno=5">Edit>

Edithttp://www.abc.com/test?tripno=5">Edit>

Edithttp://www.abc.com/test?tripno=5">Edit>

Edithttp://www.abc.com/test?tripno=5">Edit>

Edithttp://www.abc.com/test?tripno=5">Edit>

i am not getting tripno of each record. Plz refer the reference link of each edit otpion. when i assign tripno, its taking the last value which i assigned. ie. tripno=5 only.

How to assign URL to Reference field of LINK_TO_URL element at run time?

OR

2) we can do like this.

Simply assign url to reach record without key field.

www.abc.com/test

www.abc.com/test

www.abc.com/test

.....

when user clicks a particular link, we can assign corresponding key field to the URL.

Where should i write this code? Bcoz, LINK_TO_URL doesnot have event.

how to do?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    May 30, 2007 at 09:18 AM

    Hi Mog,

    One other solution is add one more entry in the internal table so that you could prepopulate the URL specific to each row in that attribute and bind it to the context node.

    For Ex. In the table control i display

    Flight Name RouteNo URLText

    so the internal table is of the type

    Flight

    Name

    RouteNo

    URLText

    Enhance the table by adding one more field

    Flight

    Name

    RouteNo

    URLText

    acURL

    Here the attribute acURL contains the URL specific to a row.So before binding it to the context node, please populate the field so that when you cllick on the URL you could navigate to the correct page.

    Thanks

    Anzy

    Add comment
    10|10000 characters needed characters exceeded

    • hey

      here is the second work around , use link to action.And you get wdevent as a parameter. From the wdevent you will get the row where you clicked as the wdevent is of the type CL_WD_CUSTOM_EVENT and you could get the complete datils by invoking the method GET_CONTEXT_ELEMENT in the above class...so that you could frame the URL and then fire an exit to that URL.

  • avatar image
    Former Member
    May 30, 2007 at 07:30 AM

    Mog,

    Is the other page another WebDynpro View? You could use LinkToAction.

    In the action handler method you could retrieve the element which contains the link via the wdevent parameter:

    DATA: lr_element TYPE REF TO if_wd_context_element.
            .
      lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
    

    Then just read the attribute TRIPNO from that element and feed the target component controller

    with the necessary data and fire the outbound plug which navigates to the details view.

    Hope this helps,

    Sascha

    PS: Please close the other thread regarding this topic.

    Message was edited by:

    Sascha Dingeldey

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 06, 2007 at 04:31 AM

    The event handler method that you define for the OnAction of the Link to URL will have a parameter wdevent. Use the method wdevent->get_context_element( ) to get the exact element that you have clicked on. If you do a get_static_attributes on that element you will get the exact tripno you need to navigate. Hope this helps.

    Add comment
    10|10000 characters needed characters exceeded