cancel
Showing results for 
Search instead for 
Did you mean: 

Close Window 'OnInputProcessing'

Former Member
0 Kudos

Hello,

i have a page (page1) with a link to a new page(page2) that opens in a new window. at this new page2 i can do some inputs. after clicking the 'SAVE-Button' (at page2) the event 'OnInputProcessing:SAVE' will be called. this event checks the changes and modify some tables. after the modify (stil in the event) i would close page2 .... but i don't know how ...

thanks for your replies, sorry for my english ....

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Stephen,

Go to 'Page Attributes' tab of your bsp page. Declare a variable 'l_close' type c.In OnInputProcessing event, set the value of the variable l_close to 'X', after making the changes into the database table. Then in the Layout tab of your bsp page, add the following java script function.

open script tag

function close_page()

Open ABAP Tag: if l_close EQ 'X'. 'Close apap tage here

window.close();

Open ABAP Tag: ENDIF. 'Close apap tage here

close script tag.

Again in the layout of your page, call the java script function in 'onClientClick' of the 'Save' button as shown in the below example.

<htmlb:button id = "save"

text = "SAVE"

onClientClick = "close_page()" />

  • If the above things are done properly, your requirement will be solved.

Thanks & Regards,

John

Former Member
0 Kudos

when I tried to send the java script function (closepage) in its original form, it's not allowing me to post my reply.

If you need the same in its correct from, please give me ur mail id. I will sent it across to you directly.

Regards,

John

Former Member
0 Kudos

Hi,

if i call the function 'onClientClick' of my button 'SAVE' i won't reach the coding of the event 'save' that is called 'onClick' of the button 'SAVE'???

Edited by: Steffen Lensch on Jul 15, 2009 3:36 PM

Sorry, it seems to work. Forgot to activate ......

Thanx

Steffen

Edited by: Steffen Lensch on Jul 15, 2009 4:39 PM

It doesn't work at the first time. it seems that 'onClientClick' gets processed before 'onClick' but both events get processed.

Example:

first click on 'SAVE':

-> onClientClick -> Flag is stil initial -> no closing.

-> onClick -> doing changes and set flag to 'X'.

-> Window stays

second click on 'SAVE':

-> onClientClick -> Flag is 'X' -> closing (after onClick).

-> onClick -> doing changes and set flag to 'X'.

-> Window closes

Sorry ...

raja_thangamani
Active Contributor
0 Kudos

If your issues is resolved, please close the thread.

Raja

Former Member
0 Kudos

I'm sorry but it isn't solved at all (see last post of me).

athavanraja
Active Contributor
0 Kudos

Steffen,

Raja Thangamani has given you the answer in the first answer itself, but however you got mislead by John with that onclienclick code.

Your observation is right. onclientclick will get executed first and then onclick.

the right code for layout.

just before < / htmlb : form write the following code.


< % if close = 'X' . % >

self.close();

< % endif.  % >

by the way, you dont need the onClientClick for your save button.

Hope this is clear.

Former Member
0 Kudos

Thanx,

but i tried this before, but the result is, that the text 'self.close();' gets print on my page before the form-elements are following.

Sorry ...

athavanraja
Active Contributor
0 Kudos

i am sorry you should surround the self close with script tag


< % if close = 'X' . % >
 < script >
self.close();
 < / script >
< % endif.  % >

Former Member
0 Kudos

Thanx a lot!!!!

How easy it could be ....

Answers (2)

Answers (2)

Former Member
0 Kudos

test reply

raja_thangamani
Active Contributor
0 Kudos

In OnInputProcessing of Page 2, after the table modify, set some flag say F_CLOSE = 'X'.

Declare the Page attribute F_CLOSE TYPE CHAR1.

In Layout: If F_CLOSE = 'X' the execute code self.close.

Hope this solves the issue.

Raja

Former Member
0 Kudos

how can i integrate the self.close in Layout?!

Thanks a lot!

Christian