on 07-01-2009 11:10 AM
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 ....
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ...
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.
test reply
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.