Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BSP code to open new page in new window after button click

Former Member
0 Kudos

Hi expert,

I have a requirement to write a BSP code to open new page in new window after button click. I have done the same for opening in same window but not for opening in new window.

Can you please help me out with the code in which the page opens in new window and the menubar & Addressbar is displayed in hide mode.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi!

You can write the javascript code in the layout of the bsp application to open a new window here are the sample javascripts for it..

this is the code to open in new window

in the html code it goes as.

<FORM>

<input type="button" value="Button" onClick

write the browser or the page that u want to open forthe above onClick event as ="window.open('www.google.com','mywindow' ,'width=400,height= 200')">

</FORM>

Regards.

6 REPLIES 6

Former Member
0 Kudos

Hi!

You can write the javascript code in the layout of the bsp application to open a new window here are the sample javascripts for it..

this is the code to open in new window

in the html code it goes as.

<FORM>

<input type="button" value="Button" onClick

write the browser or the page that u want to open forthe above onClick event as ="window.open('www.google.com','mywindow' ,'width=400,height= 200')">

</FORM>

Regards.

0 Kudos

Richa I know enough javascript ... and ly question was "how can I open a new Internet explorer with a navigation->goto_page .... not a h ref target nor a javascript

Former Member
0 Kudos

Hi Rahul,

I have a requirement wherein from an existing BSP page, on click event, I need to call a new URL but not in a separate window. I need to open this new URL in same windw.

Could you please let me know how to achieve this.

Your inputs are appreciated.

Regards,

Manasi T.

Former Member
0 Kudos

xx

Edited by: Rahul Ghosh on Aug 18, 2009 3:15 PM

Former Member
0 Kudos

Hi Mansi,

OnInputprocessing:-

DATA: EVENT TYPE REF TO CL_HTMLB_EVENT.

IF EVENT_ID = CL_HTMLB_MANAGER=>EVENT_ID.

  EVENT = CL_HTMLB_MANAGER=>GET_EVENT( RUNTIME->SERVER->REQUEST ).

  IF EVENT->NAME = 'button'.
    DATA: BUTTON_EVENT TYPE REF TO CL_HTMLB_EVENT_BUTTON.
    BUTTON_EVENT ?= EVENT.

    IF BUTTON_EVENT->SERVER_EVENT = 'mybutton'.
      POSITION = W_POSCODE.
      NAVIGATION->SET_PARAMETER( NAME = 'POSITION'
                               VALUE = POSITION ).
      NAVIGATION->NEXT_PAGE( 'NEXT' ) .

    ENDIF.
  ENDIF.

ENDIF.

Note:-

Define Navigation in ur BSP application.

BSP Application -> Navigation Tab

Start -


Navigation Request -


Target

Start.htm (Ur first page) -


NEXT -


Second.hrm(Ur target page which page u r open)

0 Kudos

Thanks for your inputs,

I already achieved the same on similar lines.

DATA: lv_url1 TYPE string.

lv_url1 = co_model->pv_url.

CALL METHOD runtime->server->response->redirect( url = lv_url1 ).

ENDIF.

The url was determined in the HANDLE_EVENT method of the of the class.