Skip to Content
author's profile photo Former Member
Former Member

Client eventing on table select

Hello,

For a .net PDK iView I've built, I would like to raise a EPCF event on the client when a row in a table control is clicked. I wish to pass the values of several fields in the selected table row using the EPCF storeClientData API. What I'm not clear on is which table client side event I should code a function for, and how that function should reference the values in the cells of that row. Any help would be greatly appreciated. Thanks.

Brian

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 30, 2004 at 02:13 PM

    Try to register to SAPTABLECLICK (in that property write "myFunc") and in your script handler, to get the row index use a nice mapi function:

    <script language="javascript">

    <!--

    function myFunc(id,e)

    {

    var indx = sapUrMapi_SapTable_getClickedRowIndex(e);

    //note that indx is zero based

    alert(indx); // or something...

    }

    //-->

    </script>

    If you want the actual cells values... It's complicated to use mapi's for that. I suggest you save your needed data in a way that you can access it easily in the function handler according to the selected row index. (For example render something as a script block in the page load...).

    For more info about mapi functions you can try to ask the experts in the htmlb or Web Dynpro areas.

    Last - try setting the table property "SelectionMode" to SINGLE to get a nice "selection" look (but be aware that the event your registered to will happen for any cell).

    Hope this helped, at least a bit,

    Ofer

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 30, 2004 at 09:07 PM

    Ofer,

    Your advice was very helpful. In the end I used a combination of server side and client side event handling to solve the problem. I implemented a handler for the sever side LeadSelect event, which retrieved the values of the row selected. I then formatted the appropriate EPCM calls into a javascript block which was returned to the client using the RegisterStartupScript method of the ASP Page object. Only downside is the postback, but its a minor one. Thanks again for your help.

    Regards,

    Brian

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.