Code behind an exit button

I have just started learning Java.
I want to place a logout button on my application that will close the browser. Any ideas on the code behind the button???

Hi there,
Quite confusing statement in your query but lets look at the possibilities.
1. If it is a browser( ie or ns ) you are trying to close then look at this link http://www.michael-thomas.com/javascript/ex_window_openclose.htm which contains possible answer to your question and other helpful topics.
2. If it is an application that you wish to close, then something like this
public void your_close_Button_method(ActionEvent e){
System.exit(0);
does the closing act. No questions asked.
Hope that helps,
best wishes & regds
gaurav

Similar Messages

  • How to see the ABAP Code behind SAP Exit Variables.

    Hi Everyone.
    I was wondering if anyone could help me with the steps to see the ABAP Code behind a SAP Exit Variable.
    Sometime back I remember of going to Transaction SE37 - Function Module and give the Variable name,
    Eg: 0F_ADAY, Hit F4 or something like that and was able to see the ABAP Code/Function Module/Exit written for that Variable.same
    But today I tried to do the same thing to see the code for Variable 0P_FVAEX but I was NOT able to see it.
    I think I am missing something.
    Can someone help me recollect what I am missing.
    Thank You for your time
    NOVICE

    Hi bi novice,
    big sorry for the late reply!
    The following variables are defined in function module RREX_VARIABLE_EXIT as case statement:
    '0CMONTH', '0CWEEK', '0CYEAR', '0CQUART', '0DAT', '0CWD', '0FYEAR', '0FPER', '0FYTCFP',
    '0FYTLFP', '0FYTCD', '0CYTCM', '0CYTLM', '0CYTCD', '0LYTCLD', '0CMONTHT', '0CWEEKT', '0CYEART', '0CQUARTT', '0DATT', '0FYEART', '0FPERT'
    Best regards,
    Andreas

  • VBA- Code behind button not working

    I am trying to add a vba code behind a close button to close a form but error keeps coming up. Each time i click the close button a Compile Error message: Sub or Function not Defined, keeps on coming up. 
    Code is below
    Private Sub cmdClose_Click()
    On Error GoTo Err_cmdClose_Click
    ' If Me.Dirty Then Me.Dirty = False
    DoCmd.Close
    Exit_cmdClose_Click:
        Exit Sub
    Err_cmdClose_Click
    MsgBox Err.Description
        Resume Exit_cmdClose_Click
    End Sub

    Sometimes the link between the button and its event gets broken. Select the button on the form in design view. Select the On Click event in the properties sheet. Then press F7. That usually fixes it.
    Bill Mosca
    www.thatlldoit.com
    http://tech.groups.yahoo.com/group/MS_Access_Professionals

  • Exit button in ABAP Webdynpro doesnot work with SPNEGO

    Dear Webdynpro Gurus,
    we are in weird situation where we have webdynpro application in ABAP with exit button.
    we have ABAP System and EP System and SSO configured for these two systems.
    We configured EP system with Microsoft Active directory for single-signon with SPNEGO.
    this configuration is working fine.
    the situation is when we click on exit button, it is not redirecting to the main iview and there is no action taking place.
    please find the code for the exit button:
    *METHOD onactionexit .*
      *CONSTANTS lc_uri TYPE string VALUE 'ROLES://portal_content/com.sap.pct/every_user/com.sap.pct.erp.ess.bp_folder/com.sap.pct.erp.ess.roles'.*
      *constants lc_url type string value '/com.sap.pct.erp.ess.employee_self_service/com.sap.pct.erp.ess.employee_self_service/com.sap.pct.erp.ess.area_employee_search'.*
    'ROLES://pcd:portal_content/com.sap.pct/every_user/com.sap.pct.erp.ess.bp_folder/com.sap.pct.erp.ess.pages/com.sap.pct.erp.ess.overview'.**
    *   Call New portal Page or iView**
      *TYPES: BEGIN OF navigation,*
        *target       TYPE string,*
        *mode         TYPE string,*
        *features     TYPE string,*
        *window       TYPE string,*
        *history_mode TYPE string,*
        *target_title TYPE string,*
        *context_url  TYPE string,*
       *END OF navigation.*
      *DATA: wa_navigation TYPE navigation.*
      *data : lv_url1 type string.*
      *DATA lo_api_component  TYPE REF TO if_wd_component.*
      *DATA lo_portal_manager TYPE REF TO if_wd_portal_integration.*
      *lo_api_component = wd_comp_controller->wd_get_api( ).*
      *lo_portal_manager = lo_api_component->get_portal_manager( ).*
      *concatenate lc_uri lc_url into lv_url1 respecting blanks .*
      *wa_navigation-target = lv_url1.*
      *wa_navigation-mode   = '0'.*
      *CALL METHOD lo_portal_manager->navigate_absolute*
        *EXPORTING*
          *navigation_target = wa_navigation-target*
          *navigation_mode   = wa_navigation-mode "IF_WD_PORTAL_INTEGRATION=>CO_SHOW_INPLACE*
          *post_parameters = ABAP_TRUE.*
    *ENDMETHOD.*
    Please help me to get out of this situation.
    Thanks & Regards,
    Khurshid.

    It is calling the workflow program exit before the SAP_WAPI_WORKITEM_COMPLETE function module.
    So closing the thread.

  • EXIT button on the top level form is not working.

    Hi I have 10g forms deployed on the web.
    On the top level form, there is a exit button on it.
    And for this form, under ALERTS I have two alerts viz. QUIT_ALERT and BANNER_ALERT.
    Now when I press the EXIT button on the form, nothing is happening. Neither prompting the ALERT nor closing the FORM.
    Where and What could be the problem??
    I have the following code for the exit button
    IF G$_DISPLAY_ALERT('QUIT_ALERT','Do you really wish to quit?') = ALERT_BUTTON1 THEN
    EXIT_FORM;
    END IFAnd the function G$_DISPLAY_ALERT has following code
    FUNCTION G$_DISPLAY_ALERT(ALERT_NAME IN VARCHAR2,
    MSG_STRING IN VARCHAR2) RETURN NUMBER IS
    ALERT_ID ALERT;
    AL_NAME VARCHAR2(30);
    ALERT_BUT NUMBER;
    BEGIN
    IF ALERT_NAME IS NULL THEN
    AL_NAME := 'G$_WARNING_ALERT';
    ELSE
    AL_NAME := ALERT_NAME;
    END IF;
    ALERT_ID := FIND_ALERT(AL_NAME);
    IF ID_NULL(ALERT_ID) THEN
    RAISE FORM_TRIGGER_FAILURE;
    END IF;
    SET_ALERT_PROPERTY(ALERT_ID, ALERT_BUT, MSG_STRING);
    ALERT_BUT := SHOW_ALERT(ALERT_ID);
    RETURN ALERT_BUT;
    END;Edited by: Charan on Mar 30, 2011 2:01 PM

    seems like some trigger is firing, because i'm getting a CAUTION popup now saying Please Acknowledge.Actually, the PAUSE() built-in is what brings up the "Please Acknowledge" alert. Clearly, your trigger is firing so there must be something wrong with either your WBP trigger code or your G$_DISPLAY_ALERT program unit.
    Try the same technique on your program unit. I would also suggest you display a message in your Exception handler. My guess is that your function is failing but since you don't report the failure, it appears that your code runs successfully.
    FUNCTION G$_DISPLAY_ALERT(ALERT_NAME IN VARCHAR2,
                          MSG_STRING IN VARCHAR2) RETURN NUMBER IS
       ALERT_ID         ALERT;
       AL_NAME          VARCHAR2(30);
       ALERT_BUT        NUMBER;
    BEGIN
       Message('Alert_name: '||ALERT_NAME);
       PAUSE;
    IF ALERT_NAME IS NULL THEN
       AL_NAME := 'G$_WARNING_ALERT';
    ELSE
       AL_NAME := ALERT_NAME;
    END IF;
    ALERT_ID := FIND_ALERT(AL_NAME);
    IF ID_NULL(ALERT_ID) THEN
       Message('Unable to find Alert: '||ALERT_NAME);
       Message('Unable to find Alert: '||ALERT_NAME);
       RAISE FORM_TRIGGER_FAILURE;
    END IF;
    SET_ALERT_PROPERTY(ALERT_ID, ALERT_BUT, MSG_STRING);
    ALERT_BUT := SHOW_ALERT(ALERT_ID);
    RETURN ALERT_BUT;
    END;Then you can see what the value of ALERT_NAME is and verify your code is executing as expected.
    Craig...
    Edited by: CraigB on Mar 30, 2011 12:54 PM

  • How to Find Code for SAP Exit variables.....

    Gurus:
    The SAP Business Content Query "0FIAR_C03_Q0005" uses several BC variables of 'SAP Exit' type for determining "Date" values. I would like to see the code used in these variables. Can anyone please suggest how I can find it?
    For examople, the variable on Posting Date is "0P_KEYD2". What is the ABAP code for this? Please give me the Steps..!
    Thanks in Advance......PB

    Generally SAP doesn't give access to the code behind SAP exit variables, but you can find what the variable is doing using help documentation. Here is some info i saw on SAP help for your variable
    0CWD Current workday
    0DAT Current calendar day
    0P_KEYDT Key date of due date
    0P_KEYD2 Key date of posting (from key date of due date)
    0P_KEYD3 Key date of clearing (from key date of due date)
    0P_KEYD4 Key date of posting (posting date)
    0P_KEYD5 Key date of clearing (from key date of posting)

  • Where is the code behind buttons?

    Hi,
    I need to modify some forms developed several years ago. There are some buttons on a horizontal toolbar. They all work ok except one button. I tried to find code behind these buttons by clicking the "+" sign in front each button item, but it looks like no trigger is attached to any of the buttons. Where can the code be hidden? Even if the buttons are inherited from object group or property class, I should be able to see some code, right? Any idea?
    Thanks.
    Sherry

    Hi,
    I think if the buttons do default actions e.g Exit does EXIT_FORM, tnen there is no need for triggers - try creating a WHEN-BUTTON-PRESSED trigger under one of the items with MESSAGE('Hello World'); and see what happens. Forms can work with no triggers at all if all that is required is default functionality. When you require, for example, conditional validation/navigation a trigger is needed. Take a text item: pressing RETURN will fire the NEXT_ITEM built-in unless you explicitly change Forms behaviour by coding a KEY-NEXT-ITEM trigger (which could contain any PL/SQL e.g. EXECUTE_QUERY if you want a query block to execute a query upon hitting RETURN from an item.
    Hope this helps

  • How to find out the code behind a button

    Hi,
    What technique should I use to find out what java code is invoked when I click on a button in the portal?
    More concrete: I want to know the code behind the button I'm talking about <a href="https://forums.sdn.sap.com/thread.jspa?threadID=188251">here</a>.
    T h a n k s !
    Jeroen

    I would suggest you use HTTPWatch in your browser to see what is happening behind you button click.
    You can get it here
    <a href="http://www.simtec.ltd.uk/">http://www.simtec.ltd.uk/</a>

  • Exit button code not working in published captivate file

    Hi,
    I have created a elearning module in captivate 8. I have an exit button at the end of the module. The button has the inbuilt code ''on success - exit''. When I publish this file to swf or AICC format, this exit button doesnot work. Please help!

    have you confirmed that this javascript code ( only
    javascript code in html, no swf) works?
    in some cases the window.close() statement works only for
    popup windows. so make sure of it.

  • Exit button code not working in FireFox

    Hi,
    I am writing a code on exit button , but it is working in IE
    but not in FireFox---
    code is :
    import flash.external.ExternalInterface;
    ExternalInterface.call("window.close","");
    Also I tried this:
    var urlString:String = "javascript:window.close();";
    var request:URLRequest = new URLRequest(urlString);
    navigateToURL(request, "_self");
    Please tell what to write so that My Exit button works in
    FireFox also.

    have you confirmed that this javascript code ( only
    javascript code in html, no swf) works?
    in some cases the window.close() statement works only for
    popup windows. so make sure of it.

  • Code behind a button

    Hi All,
    My requirements are that I have a page button which when selected calls another page and displays values for certain fields. I have to modify the query behind the Button to default values from another field. How do I check and modify the code behind the Button? Appreciate your help.
    Thanks,
    Hari

    If you say that the button press opens up another page, then there is nothing much to do in the button press event.
    You would probably need to look at the processRequest of the new page that is opening up and change the query through the VO that is being executed .
    Thanks
    Tapash

  • Code behind the button in ME23N

    can any one give me the code behind the
    "COLLAPSE HEADER" & "EXPAND HEADER" Button in ME23N?
    Or just tell me the include of the main program.
    Thanks,
    Kiran

    So it means that when we click on "Save" - "Disk Icon" it calls
    DO_KEY('commit_form') which inturn checks at each block level if the on-insert , on-update triggers have any logic or not. based on which it will perform that activity.
    So can we conclude that for each commit_form it will check on-update n on-insert trigger at block level if it set to true. ?
    pls clarify for any discrepancies.

  • How to execute javascript function then Code Behind in an ASP Button

    Hi Guys,
    I am currently working in a web application. I have a problem with calling a js function and codebehind.
    I have this asp button that when clicked, a javascript function should be called.
    My javascript function is like this:
    function Calculate(){
    // Set Route in google map
    // Store distance, lat/long in an array
    Then, after the Calculate function was executed, it should execute the code behind:
    protected void btn_calculate_onclick(object sender, EventArgs e)
    // Pull data stored in the array created by javascript
    // connect to db
    // store data
    But the javascript function doesn't execute.
    What should i do?
    Thanks in advance

    Hello,
       javascript function can not executed in server side, you can tranlate javascription fuction to c# function.
     if the reply help you mark it as your answer.
     Free
    Managed .NET
    Word Component(Create,
    Modify, Convert & Print)

  • Updating a Label content from code behind using dispatcher

    hi,
    I am trying to update a label's content from code behind.
    This part of the code is running in background worker. I wrote the following code to update a label's content:
    volumecontrol.Dispatcher.BeginInvoke(new Action(() =>
    volumecontrol.Content = volumeupdate;
     i tried using both BeginInvoke and Invoke but the application exits with the error:
    System.InvalidOperationException' occurred in WindowsBase.dll
    Using Invoke works when updating the UI from another thread but it not working in this case:
    Pls help.
    Thanks,
    Shaleen
    TheHexLord

    When you do that new action stuff you're capturing variables.
    If that means you grab a control's value across from outside the {} then you're trying to capture the variable on the background thread.  If that's some sort of control you're messing with then that will cause a problem as they have thread affinity.
    Because you don't want to be blocking the UI thread at all you should use BeginInvoke rather than Invoke.
    To explain this clearly - and provide a way you could use to explore what's going on and learn  - we need a separate thread which can be done using Task.Factory.StartNew.
    This bit of code allows you to put code onto a background thread:
    Task.Factory.StartNew(() =>
    // On a separate thread to the UI here
    Create a new solution, add a textBlock and Button:
    <StackPanel>
    <TextBlock Name="tb"/>
    <Button Name="btn" Click="btn_Click">Change the text</Button>
    </StackPanel>
    Then in the button click you can play around with what's going on.
    Just to be clear.
    That textblock is a control and it is created on the UI thread.
    To get from that task thread back to the UI thread you should use Dispatcher.BeginInvoke.  With no control name.
    Let's start with a broken piece of code:
    private void btn_Click(object sender, RoutedEventArgs e)
    Task.Factory.StartNew(() =>
    string thingummy = tb.Text + "Banana";
    Dispatcher.BeginInvoke(new Action(() => { tb.Text = thingummy; }));
    When you click the button it'll error because when you access tb.Text there you do so on a background thread and tb has thread affinity.
    This, however, will work OK.
    Task.Factory.StartNew(() =>
    Dispatcher.BeginInvoke(new Action(() => { tb.Text = tb.Text + "Banana"; }));
    That's OK because the Action runs on the UI thread where tb was created and all is good.
    Anonymous methods and actions capture variables ( you can google that for more info ).
    If you wanted to use a variable which was created on the background thread you can set it here:
    Task.Factory.StartNew(() =>
    string thingummy = "banana";
    Dispatcher.BeginInvoke(new Action(() => { tb.Text = thingummy; }));
    or here
    string thingummy = "banana";
    Task.Factory.StartNew(() =>
    Dispatcher.BeginInvoke(new Action(() => { tb.Text = thingummy; }));
    They both work.
    They are not accessing properties of a UI control because you're just setting the variable to a string.
    All of which means you could have a variable in your code which is set to volume or whatever that is from your control  ON THE UI THREAD and then modify that variable on the background thread.  Variables do not have thread affinity.  A
    double, string or whatever isn't a control.
    And this approach might well be more convenient.
    Hope that helps.
    Recent Technet articles:
    Property List Editing ;  
    Dynamic XAML

  • In Editable ALV the BACK/CANCEL/EXIT buttons are not working?

    Hello,
    I wrote a editable FM based ALV, working fine that when user changes the data and press SAVE button, values are transfering into prog. But, i need to put a validation that, if user changes the values and press BACK/CANCEL/EXIT button, i need to popup the message that "Do you want to save changes", my PF-STATUS is good(because, SAVE is working).
    But, its not working that when user done changes and press BACK button (forgot to press SAVE button), system taking me to selection screen/screen 0!! I my code is as below,
    FORM pick USING v_ucomm     TYPE syucomm
                                         it_selfield TYPE slis_selfield.
      DATA: v_answer TYPE char1.
      READ TABLE it_z_tbl  INDEX it_selfield-tabindex
       INTO w_z_tbl.
      CASE v_ucomm.
        WHEN '&IC1'.
            " working fine this functionality
          ELSE.
            MESSAGE i000 WITH 'Double click on key field'.
          ENDIF.
        WHEN 'SAVE'.
            " working fine this functionality
        WHEN BACK' " OR 'CANCEL' OR 'EXIT'.
          PERFORM popup_for_user_decision CHANGING v_answer.
          CHECK v_answer = '1'.
          PERFORM now_update.
      ENDCASE.
    ENDFORM.     
    when i put the break point on the first line of this piece of code, its not stopping on pressing BACK/CANCEL/EXIT buttons!! (its stoppig for SAVE press or double click)
    Its stopping at this point,
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'.
    EXPORTING
    i_callback_user_command  = 'PICK'
    IMPORTING
    EXCEPTIONS
    IF sy-subrc <> 0 =================> its stopping at this point!
    ENDIF.           
    Pls. let me know why system is not recognising that i hv a PICK form (SAVE and Double clicks are working fine)?
    Thank you

    Hi,
    Actually BACK is standard user command so it is not stopping and going to selection screen.
    Give some other use command like 'BCK' and try....

Maybe you are looking for