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

How to create event during renderer


I'm new in SAPUI5 and i'm trying to create a custom control. The idea of this custom control is to create a table with SVG. I want to add an event onclick but i dont know how to do it because my svg is defined during renderer phase. Have you got any idea or tutorial ?

 // SVG 

  • oRm.write("<svg id='test_svg' width='1500' height='400' viewBox='0 0 "+xmax*75+" "+ymax*25+" ' " );
  • oRm.writeControlData(oControl);
  • oRm.write(" >");
for (var i = 0; i <= xmax ; i++ ){ for (var j = 0 ; j <= ymax ; j++){ oRm.write("<g transform='translate("+i*75+","+j*25+")'>");
  • oRm.write("<rect width='75' height='25' style='fill:rgb(132,202,236);stroke-width:0.5;stroke:rgb(0,0,0)' /
  • oRm.write("<text fill='white' font-size='6' x='2' y='12' >");
  • oRm.write("Case "+i+j+"");
  • oRm.write("</text>");
  • oRm.write("</g>");
} } oRm.write("</svg>");


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Dec 11, 2015 at 12:20 PM

    Please refer this example code document . it may be useful example 1 and example 2

    Kindly let me know if you need any more information

    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.