on 08-26-2010 11:31 AM
Dear Experts,
I created a web application with create,change,save,display mode operations. when ever i go to change mode i can change data but how can i make save button as mandatory in change mode.
Bcs end user may press display or create button without pressing save button.
Thanks & Regards,
Anuvidhya T.
Hi There ,
Create a global variable . say gv_flag .
Whenever you want to capture any actions say on press of save button, set this flag as X . So now you have a variable by which you can check which button has been pressed .
Now if this flag is set ( X) , trigger your pop - up .
Also remember to clear the flag value once you exit your app .
Also in my opinion use different variables for different actions . It makes life easier and helps to understand the flow better.
Please let me know if your problem is not solved .
Thanks ,
Abhishek
Edited by: Abhishek Gupta on Aug 27, 2010 2:19 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Generally in SAP delivered applications we check the context change log or some other "dirty" flag to see if there is changed data before switching out of change mode or navigating to a new document. If the data is "dirty" we produce a dialog asking if the user wants to save their data before navigation. This isn't really making the save button mandatory, but instead reminding the user and giving them a simple opportunity to save before their data is lost.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank Manogna.
But my requirment is need to call the popup window when he press next action buttons( create , Display , Delete ).
i know the method to call popup window but how can i capture the action when he leave without saving data.
if i call the popup window from create/display/delete how would i know the user from change mode.
Regards,
Anuvidhya T.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Anuvidhya,
Since you are already familiar with the creation of popup window..
Please try the below simple steps to resolve this.
1. Create an attribute in COMPONENTCONTROLLER context as AT_CHANGED TYPE char1 ( dont forget to make it as PUBLIC )
2. Set this attribute , Once User presses the Change button. write the below statement in OnChange method.
wd_comp_controller->at_changed = 'X'.
3. Go to Onbefore action method
if wd_comp_controller->at_changed is not initial.
" call popup here
endif.
4. Inside Create, Display, Delete button's methods .. excecute the logic only..
if wd_comp_controller->at_changed IS initial.
" write your respective logic
endif.
----
I hope this will help you.
Regards,
Rama
Edited by: Rama krishna on Aug 26, 2010 4:44 PM
Hi Anuvidhya,
According to your requirement, we can make DISPLAY, CREATE buttons invisible / non-editable and SAVE button visible ( by binding the visibility property of buttons with attribute and set the value of that attribute accordingly) if the user clicks CHANGE button.
Hope this helps you.
Regards,
Manogna
Edited by: manogna musunuri on Aug 26, 2010 12:36 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.