cancel
Showing results for 
Search instead for 
Did you mean: 

Hyper link Clicked Functionality in BSP

Former Member
0 Kudos

Hi,

I am new to BSP. I have to Requirement to open a new window using URL when we clicked on Hyper link. Tell me the way to achieve this using java script.

Regards,

Vidyasagar

Accepted Solutions (0)

Answers (1)

Answers (1)

StefanRoesch
Active Participant
0 Kudos

the <htmlb:link> tag has an attribute "onClientClick" - here you can handle Javascript, like:

<htmlb:link id="mylink1" onClientClick = "window.open ('http://www.google.com','mywindow');">Link that opens a window</htmlb:link>

Former Member
0 Kudos

HI Rosch,

Thanks for ur reply. I have 5 hyper links how to know that on which hyper link i clicked and where to write logic for that open window?? In layout?

Thanks,

Sagar

Former Member
0 Kudos

Hi Sagar,

It's same as Rosch's example.

<htmlb:link id="mylink1" onClientClick = "window.open ('http://w w w.google.com','mywindow');">1st Link that opens a window</htmlb:link>

<htmlb:link id="mylink2" onClientClick = "window.open ('h t t p://w w w.yahoo.com','mywindow');">2nd Link that opens a window</htmlb:link>

<htmlb:link id="mylink3" onClientClick = "window.open ('h t t p://w w w.rediff.com','mywindow');">3rd Link that opens a window</htmlb:link>

<htmlb:link id="mylink4" onClientClick = "window.open ('h t t p://w w w.sap.com','mywindow');">4th Link that opens a window</htmlb:link>

<htmlb:link id="mylink5" onClientClick = "window.open ('h t t p://w w w.saptechnical.com','mywindow');">5th Link that opens a window</htmlb:link>

Regards,

Ravi

P.S. I used extra spaces in the URLs, please ignore those extra spaces.

Edited by: Ravi A on Mar 16, 2011 2:58 PM

Former Member
0 Kudos

HI Ravi,

Thanks for ur reply.How to write this logic in event handler method when we clicked on hyper link instead of writing in layout.

Thanks,

Sagar

Former Member
0 Kudos

Hi Sagar,

Then you should use the attribute onClick instead of onClientClick.

Check the ID in the event handler onInputProcessing using get_form_fields method.

and navigate to the page based on the link ID.

Regards,

Ravi

Former Member
0 Kudos

Hi Ravi,

Can u share some code snippet. When i tried to use navigate->goto_page(url). I unable to open previous window by clicking back button.

Thanks,

Sagar