cancel
Showing results for 
Search instead for 
Did you mean: 

Client eventing on table select

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

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