cancel
Showing results for 
Search instead for 
Did you mean: 

capture mouse events

Former Member
0 Kudos
177

Hi all,

i want to capture mouse events like mousedown, mouseup and mousemove by clicking on the tree node of <htmlb:tree>.

Have any one some Idee?

Greeting,

ag

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

SAP doesn't expose those events through Extension itself. That means that you will either need to use <bsp:findAndReplace> to alter the rendered HTML/JavaScript or attach the event using JavaScript (element.addEventListener).

In either case you are on your own from a support standpoint. You are alterning the entended "code" of the delivered Extension. You will also want to study the source output of the element to know what to alter or where to attach your event.

Former Member
0 Kudos

Hi,

i want to use CL_TREE_ITERATOR. It may be help me, but i dont now how i use it.

I need help, please.

ag

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

CL_TREE_ITERATOR isn't actually used with <htmlb:tree>. It is simply an example <htmlb:tableView> iterator class. This example is used to demonstrate how you can create a psydo-table/tree using the iterator to render a phtmlb heirarchtical cell into a table view cell.

However switching from the <htmlb:tree> to the <htmlb:tableView> doesn't really change the advice that you have already been given here. You will need to find some way to attach additional events to the table cell now instead of the tree leaf. However you might find that the html/javascript coding of the tableView (espcially with such a complex iterator) will be quite a bit more complicated.

Former Member
0 Kudos

Thank you for your information. I will try it and if i found an way i will come back again!

ag

Former Member
0 Kudos

Hi all,

i solved with your help the problem as follows:

thank you all.

PS: how can i Reward and close this topic?

<%data l_replace type string.%>

<%concatenate 'onSubmit(' '''' 'OnInputProcessing(this.id)' '''' ',this.id' ')' into l_replace.%>

<bsp:findAndReplace find = 'onclick="' replace = 'onMouseDown="<%=l_replace%>;' >

<bsp:findAndReplace find1 = "<td" replace1 = "<td bgcolor=green" >

<htmlb:tree id = "HDrag"

table = "<%=p_0costtree %>"

title = "Tree Left"

width = "100%"

height = "100%"

onTreeClick = "TreeClicked"/>

</bsp:findAndReplace>

</bsp:findAndReplace>

athavanraja
Active Contributor
0 Kudos

choose the solved radiobutton in the answer which solved your problem.

Regards

Raja

athavanraja
Active Contributor
0 Kudos

Hi Abou-Zeid Gerdi

I dont deserve the 10 points, you should give the points to the answer which helped you.

Regards

Raja

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

you can capture this mouse click events using JavaScript and can use it in OnNodeClientClick of your <htmlb:tree>. Refer to this link for related Java Script.

http://www.quirksmode.org/js/events_mouse.html

Regards,

Ravikiran.