Cancel Button

hi all,
i have search page which displays a list of records with no "go" button as there are only 10 records to show.when i am navigating from search page to create page ,in create page i have submit or cancel button.
if i press cancel button it is going to search page but not reflecting the data
style of cancel button : button
if i try using style as "SUBMIT BUTTON " it is asking to fill the mandatory fields but if i fill them and press cancel it is going to search page and reflecting the values...
What i want is :
i want a cancel button when clicked must navigate to the search page without asking for the manadatory fields..
kindly help

Hi,
I hope you have put some url on cancel button.
Like--
OA.jsp?page=<YOUR_PAGE_PATH>*&retainAM=Y* //Insert the bold one
Thanks
--Anil                                                                                                                                                                                                                                                                                                       

Similar Messages

  • How to stay back on same section of a report after pressing cancel button

    Hi,
    How we can stay back on a same section of a report page when I press Cancel button or Apply Changes button from linked Data Entry Form. For instance if I have a 200 rows in a report and I scroll down to 80th row and press Edit button when called a data entry form. Now when I press Cancel it again re-load the report from the start of the page.
    Any idea!
    Thanks
    Sabahat

    Hi Sajid,
    Thanks for reply.
    I have used RETURN statement like below.
    SUBMIT RFWT0010 WITH vendor       = 'X'
                     WITH i_lifnr  IN i_lifnr
                     WITH i_bukrs  IN i_kunnr
                     WITH test         = 'X'
                      AND RETURN.
    The output of RFWT0010 is displayed. but on pressing "back" button on toolbar, the flow is coming back  from RFWT0010 to calling report. I want that On pressing ENTER button of keyboard. The flow should come back to calling report.
    Regards,
    Ratnesh

  • How to change the behaviour of the Cancel-Button of SSO-Login-Page (Forms)?

    Hi Folks,
    we use SSO-Login to authenticate users using Forms. How do I change the URL which is opened when a user clicks on the cancel button on the SSO Login page?
    In the formsweg.cfg file there is a parameter named ssoCancelUrl, but if I define it, it doesn't work anyway. Seems like it has something to do with ssoDynamicResourceCreate, but I don't exactly understand what.
    Can't I simply change the URL which is opened (globally), when a user hits the cancel button on any SSO-Loginpage.
    Thanks in advance.
    Regards.

    Exactly this does not work! Please watch my settings:
    Global Setting in formsweb.cfg
    # Single Sign-On OID configuration parameter: indicates whether we allow
    # dynamic resource creation if the resource is not yet created in the OID.
    ssoDynamicResourceCreate=false
    # Single Sign-On parameter: URL to redirect to if ssoDynamicResourceCreate=false
    ssoErrorUrl=
    # Single Sign-On parameter: Cancel URL for the dynamic resource creation DAS page.
    ssoCancelUrl=
    # Single Sign-On parameter: indicates whether the url is protected in which
    # case mod_osso will be given control for authentication or continue in
    # the FormsServlet if not. It is false by default. Set it to true in an
    # application-specific section to enable Single Sign-On for that application.
    ssoMode=false
    App-Specific settings in formsweb.cfg
    [proz]
    envFile=proz.env
    form=proz.fmx
    title=proz
    separateFrame=true
    width=1280
    height=960
    ssoMode=true
    ssoDynamicResourceCreate=false
    ssoCancelURL=http://machinename:port/zugangsportal/
    otherparams=useSDI=yes P_SERVER_URL=machinename:port P_REP_SERVERNAME=machinename_proz ZP_TARGET_ID=%ZP_TARGET_ID%
    When I now access http://machinename:port/forms/frmservlet?config=proz I got redirected to the SSO-Login-Page but the Cancel-Button still links to Middletier Home. Why?
    Regards.

  • How to redirect to home page on "Cancel" button click

    Hi,
    I have created a web part for office 365 developed using sandbox solution on Sharepoint foundation 2013.
    On "Cancel" button click i want to redirect user to another page(Home page) using C# only.
    i used some methods like 
    Context.Response.Redirect(SPContext.Current.Web.Url.ToString() + "/Home.aspx");
    but its not working. No methods which includes context or HttpContext is not working.
    Please, tell me how can i redirect user to site home page.

    Hi,
    you can try this
    var button
    = new Button();
    button.Attributes.Add("OnClick"
    , "javascript:{window.location='your
    page url';return
    false;}");
    this.Controls.Add(button);
    Hope it helps!
    Avni Bhatt

  • Delete From Table on Cancel Button.

    Hi,
    i am facing funny problem.
    i have created form with report page and i have implement send email option on Page so i am attach more document with email.if i attach document then it's going in DUMY_DOC_FILE table .
    i have create a process
    delete from DUMY_DOC_FILE .
    Process Point IS ON Submit -After Conmputation and Validation
    On Page No 6.if i press Cancel Button.This button is redirect on page No 4.My Code on Page no 6.
    page is redirect to 4 but doc don't delete from DUMY_DOC_FILE Table.
    How to delete Doc From Table If I press Cancel Button.
    Thanks
    Edited by: 805629 on Jan 13, 2011 5:25 AM
    Edited by: 805629 on Jan 13, 2011 11:49 PM
    Edited by: 805629 on Jan 14, 2011 12:43 AM

    <li>Change Cancel Button in page 6 so that it submits.
    <li>If u have conditions on that delete PLSQL process, make sure that it runs when CANCEL button is pressed also. If it is unconditional, let it be.
    <li>Add a branch for the Cancel button which redirect to page 4
    So effectivelly instead of *[CANCEL] -> [Redirect to page 4]* , it becomes *[CANCEL] -> [SUBMIT] -> [DELETE PROCESS] -> [Branch: redirect to page 4]*

  • Cancel button on form of type form on a table or view

    I am a newbie for apex. I am using 10g. I have created form on table emp(empno , name , salary ) . Form is of type Form on a Table or View.
    Cancel & Save(Apply changes) button are not working at all. so I copied process reset page and execute on condition save button click. But still cancel button is not working. applcation has some other forms of type Form with a Report and are working properly. I have wasted 2 days on this problem.

    Hi,
    You can do that. If you have the branch to in the same form what you have to do use clear cache for that page. Click on the edit page, click on the cancel button in the left button section. scroll down to bottom and type the page 32 in the Clear cache field. However it is better to have branch to the report page (different page from the form).
    Hope this will help.
    M Tajuddin
    http://tajuddin.whitepagesbd.com

  • How to stop the Flex application when user clicks on Cancel button from JS-confirm message?

    Hi All,
    I use the next code when a user clicks on a link:
    private function clickHandler():void
          ExternalInterface.call('confirm', 'Of course you want to go to the Adobe forums!');
          navigateToURL(new URLRequest('http://forums.adobe.com'), '_self');
    This will show up the javascript confimation box. But when the cancel-button is clicked, the user goes straightly to http://forums.adobe.com...
    How to stop Flex performing the next code when a user clicks on the Cancel button?
    Or, how to catch which button is clicked by a user in Flex?
    Thanks!

    I agree with Mr. Hall that using mx.controls.Alert in Flex may be a better route.
    Show the Alert like this:
    // show an alert with a question and yes and no choices
    Alert.show( "Would you like to go to the Adobe Forums?", "Question",
         Alert.YES | Alert.NO, this, closeHandler, null, Alert.YES );
    Then handle the response in the closeHandler() function:
    protected function closeHandler( closeEvent:CloseEvent ):void
    if( event.detail == Alert.YES )
         navigateToURL( new URLRequest('http://forums.adobe.com'), '_self' );
    else if( event.detail == Alert.NO )
         // they chose no
    The following documentation on Alerts may be helpful:
    http://www.flexafterdark.com/docs/ActionScript-Alert
    Let me know if that helps...
    Ben Edwards

  • How to handle the "cancel" button and "close" icon of a popup ?

    Hi,
    I have a popup with "cancel button" and "close icon"(on the top right corner of the popup), I want the same operations to be performed on clicking of any of these two components.
    Is there a way to handle such situation ?
    I read about 2 cases to look into this but they didn't work too well for me.
    1. I read about the "popcancellistener" but that listener is called whenever the popup closes, so suppose I have an "ok button" on the popup to create a record, after the record is created, the popup closes and goes into the "popcancellistener", now the question is "how do we know if it came there because of the 'ok button' or 'some other event'".
    2. I even checked the "DialogListener", now I'm able to distinguish between the 'OK' and 'CANCEL' button in the dialoglistener using the "Dialog.Outcome.ok/cancel", but when a user clicks on the close icon, we do not enter the "DialogListener" at all, so in this case "how do we handle the close icon click event"
    Do let me know if you need any more information from my side.
    Thanks for the help in advance.

    The following mechanism responds to any of the following events: <Esc> key, Close icon ('x'), Cancel button
    JavaScript part:
    function popupClosedListener(event){
                  var source = event.getSource();
                  var popupId = source.getClientId();
                  var params = {};
                  params['popupId'] = popupId;
                  var type = "serverPopupClosed";
                  var immediate = true;
                  AdfCustomEvent.queue(source, type, params, immediate);
    }JSF part:
             <af:popup ....>
                  <af:clientListener method="popupClosedListener"
                                           type="popupClosed"/>
                  <af:serverListener type="serverPopupClosed"
                                          method="#{myBean.serverPopupClosedMetod}"/>
            </af:popup>Finally, Java part:
    public void serverPopupClosedMetod(ClientEvent event){
    }

  • How do I create an input box with a cancel button that will end a loop in my script?

    I have been working on a script for my client and I am having trouble getting it to work properly. I stole most of the code from the PowerShell Tip of the Week "Creating a Custom Input Box". I also took someone's code for the Show-MessageBox function.
    I have slightly modified the original code with two parameters and an additional text box. The first field is for an e-mail address and the second is for an employee number.
    I need to know how I can get a Do Until loop to recognize when the cancel button is pushed and break the loop and effectively end the script. The work happens at the end but perhaps I need something added/modified in the InputBox function.
    I want the script to check to see if anything has been entered in the second text box. If empty it displays a message and calls the InputBox function again. Then if there is something I use elseif to check to see if it matches my RegEx (digits only). If
    it doesn't match it will loop and call the InputBox function again.
    This all works fine. The problem I am having is that I cannot cancel out of the form. I'd like the loop to continue until the second box matches my RegEx or Cancel is clicked. Clicking cancel doesn't break the loop. I need to know how I can stop the loop
    when cancel is pressed. I've seen Stack "Overflow: PowerShell Cancel Button Stop Script" but I don't think this will work in a loop.
    Any help would be awesome. As a note, I DO NOT want to use the VB Interaction stuff.
    function InputBox {
    param ($Name,$EN)
    [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
    [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
    $objForm = New-Object System.Windows.Forms.Form
    $objForm.Text = "Data Entry Form"
    $objForm.Size = New-Object System.Drawing.Size(300,200)
    $objForm.StartPosition = "CenterScreen"
    $objForm.KeyPreview = $True
    $objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter")
    {$x=$objTextBox.Text;$objForm.Close()}})
    $objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape")
    {$objForm.Close()}})
    $OKButton = New-Object System.Windows.Forms.Button
    $OKButton.Location = New-Object System.Drawing.Size(75,120)
    $OKButton.Size = New-Object System.Drawing.Size(75,23)
    $OKButton.Text = "OK"
    $OKButton.Add_Click({$objForm.Close()})
    $objForm.Controls.Add($OKButton)
    $CancelButton = New-Object System.Windows.Forms.Button
    $CancelButton.Location = New-Object System.Drawing.Size(150,120)
    $CancelButton.Size = New-Object System.Drawing.Size(75,23)
    $CancelButton.Text = "Cancel"
    $CancelButton.Add_Click({$objForm.Close()})
    $objForm.Controls.Add($CancelButton)
    $objLabel = New-Object System.Windows.Forms.Label
    $objLabel.Location = New-Object System.Drawing.Size(10,20)
    $objLabel.Size = New-Object System.Drawing.Size(280,20)
    $objLabel.Text = "Employee Email Address:"
    $objForm.Controls.Add($objLabel)
    $objTextBox = New-Object System.Windows.Forms.TextBox
    $objTextBox.Location = New-Object System.Drawing.Size(10,40)
    $objTextBox.Size = New-Object System.Drawing.Size(260,20)
    if ($Name) {
    $objTextBox.Text = $Name
    else {
    $objTextBox.Text = "@domain.com"
    $objLabel2 = New-Object System.Windows.Forms.Label
    $objLabel2.Location = New-Object System.Drawing.Size(10,70)
    $objLabel2.Size = New-Object System.Drawing.Size(280,20)
    $objLabel2.Text = "Employee Number:"
    $objForm.Controls.Add($objLabel2)
    $objTextBox2 = New-Object System.Windows.Forms.TextBox
    $objTextBox2.Location = New-Object System.Drawing.Size(10,90)
    $objTextBox2.Size = New-Object System.Drawing.Size(260,20)
    $objForm.Controls.Add($objTextBox)
    $objForm.Controls.Add($objTextBox2)
    $objForm.Topmost = $True
    $objForm.Add_Shown({$objForm.Activate()})
    [void] $objForm.ShowDialog()
    $Script:ButtonName = $objTextBox.Text
    $script:ButtonEN =$objTextBox2.Text
    $ButtonName; $ButtonEN
    Function Show-MessageBox{
    Param(
    [Parameter(Mandatory=$True)][Alias('M')][String]$Msg,
    [Parameter(Mandatory=$False)][Alias('T')][String]$Title = "",
    [Parameter(Mandatory=$False)][Alias('OC')][Switch]$OkCancel,
    [Parameter(Mandatory=$False)][Alias('OCI')][Switch]$AbortRetryIgnore,
    [Parameter(Mandatory=$False)][Alias('YNC')][Switch]$YesNoCancel,
    [Parameter(Mandatory=$False)][Alias('YN')][Switch]$YesNo,
    [Parameter(Mandatory=$False)][Alias('RC')][Switch]$RetryCancel,
    [Parameter(Mandatory=$False)][Alias('C')][Switch]$Critical,
    [Parameter(Mandatory=$False)][Alias('Q')][Switch]$Question,
    [Parameter(Mandatory=$False)][Alias('W')][Switch]$Warning,
    [Parameter(Mandatory=$False)][Alias('I')][Switch]$Informational)
    #Set Message Box Style
    IF($OkCancel){$Type = 1}
    Elseif($AbortRetryIgnore){$Type = 2}
    Elseif($YesNoCancel){$Type = 3}
    Elseif($YesNo){$Type = 4}
    Elseif($RetryCancel){$Type = 5}
    Else{$Type = 0}
    #Set Message box Icon
    If($Critical){$Icon = 16}
    ElseIf($Question){$Icon = 32}
    Elseif($Warning){$Icon = 48}
    Elseif($Informational){$Icon = 64}
    Else{$Icon = 0}
    #Loads the WinForm Assembly, Out-Null hides the message while loading.
    [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
    #Display the message with input
    $Answer = [System.Windows.Forms.MessageBox]::Show($MSG , $TITLE, $Type, $Icon)
    #Return Answer
    Return $Answer
    $num = "^\d+$"
    do {
    if (!($ButtonEN)) {
    Show-MessageBox -Msg "You must enter a numeric value for the employee number." -Title "Employee Number Missing" -Critical
    InputBox -Name $ButtonName
    elseif ($ButtonEN -notmatch $num) {
    Show-MessageBox -Msg "The employee number must contain numbers only!" -Title "Non-numerical characters found" -Critical
    InputBox -Name $ButtonName
    until ( ($ButtonEN -match $num) -or (<this is where I want to be able to use the cancel button>)

    Here is a simple validation method.
    function New-InputBox{
    param(
    $EmailAddress='',
    $EmployeeNumber=''
    Add-Type -AssemblyName System.Windows.Forms
    $Form=New-Object System.Windows.Forms.Form
    $Form.Text='Data Entry Form'
    $Form.Size='300,200'
    $Form.StartPosition='CenterScreen'
    $OKButton=New-Object System.Windows.Forms.Button
    $OKButton.Location='75,120'
    $OKButton.Size='75,23'
    $OKButton.Text='OK'
    $OKButton.DialogResult='Ok'
    $OKButton.CausesValidation=$true
    $Form.Controls.Add($OKButton)
    $CancelButton = New-Object System.Windows.Forms.Button
    $CancelButton.Location = New-Object System.Drawing.Size(150,120)
    $CancelButton.Size = New-Object System.Drawing.Size(75,23)
    $CancelButton.Text ='Cancel'
    $CancelButton.DialogResult='Cancel'
    $CancelButton.CausesValidation=$false
    $Form.Controls.Add($CancelButton)
    $Label1=New-Object System.Windows.Forms.Label
    $Label1.Location='10,20'
    $Label1.Size='280,20'
    $Label1.Text='Employee Email Address:'
    $Form.Controls.Add($Label1)
    $TextBox1=New-Object System.Windows.Forms.TextBox
    $TextBox1.Location='10,40'
    $TextBox1.Size='260,20'
    $textbox1.Name='EmailAddress'
    $textbox1.Text=$EmailAddress
    $Form.Controls.Add($textbox1)
    $Label2=New-Object System.Windows.Forms.Label
    $Label2.Location='10,70'
    $Label2.Size='280,20'
    $Label2.Text='Employee Number:'
    $Form.Controls.Add($Label2)
    $TextBox2=New-Object System.Windows.Forms.TextBox
    $TextBox2.Location='10,90'
    $TextBox2.Size='260,20'
    $TextBox2.Name='EmployeeNumber'
    $TextBox2.Text=$EmployeeNumber
    $Form.Controls.Add($TextBox2)
    $Form.AcceptButton=$OKButton
    $Form.CancelButton=$CancelButton
    $Form.Topmost = $True
    $form1_FormClosing=[System.Windows.Forms.FormClosingEventHandler]{
    if($Form.DialogResult -eq 'OK'){
    if($textbox1.Text -eq ''){
    [void][System.Windows.Forms.MessageBox]::Show('please enter an email address','Validation Error')
    $_.Cancel=$true
    }else{
    # Check empno is all digits
    if("$($TextBox2.Text)" -notmatch '^\d+$'){
    [void][System.Windows.Forms.MessageBox]::Show('please enter a number "999999"','Validation Error')
    $_.Cancel=$true
    $form.add_FormClosing($form1_FormClosing)
    $Form.Add_Shown({$Form.Activate()})
    if($Form.ShowDialog() -eq 'Ok'){
    # return the form contents
    $Form
    if($f=New-InputBox -EmailAddress [email protected]){
    'Email is:{0} for Employee:{1}' -f $f.Controls['EmailAddress'].Text,$f.Controls['EmployeeNumber'].Text
    }else{
    Write-Host 'From cancelled!' -ForegroundColor red
    ¯\_(ツ)_/¯

  • How to handel cancel button in Sap Script ?

    Hi friends,
    I want to print SAP Script, in print popup screen have u201C print previewu201D  u201CPrintu201D  u201CCancelu201D  button.
    Whenever  press  Cancel button getting popup message u201COutput was cancelled by the useru201D ,
    if press u201CExitu201D button it is going to SAP Easy Access.
    I want if press cancel button it should back on the program.
    Or should not display popup message u201COutput was cancelled by the useru201D.
    Plz. Guide me .
    Thanking you.
    Regards,
    Subash.

    Hi Shiba Prasad Dutta,
    Thank you for your correct answer.
    Warm regards,
    Subash.

  • Data loss popup for cancel button on overview page

    Hi Experts,
    Data loss popup generally appears on UI, when i try to navigate with out saving the changes. This is a standard SAP behaviour.
    But, i come across the requirement where this data loss popup should also appear on clicking the 'Cancel' button on overview page on UI.
    I understood that, this popup will be triggered by the methods ON_BEFORE_WA_CONTENT_CHANGE & IF_BSP_WD_EVENT_HANDLER~HANDLE_EVENT of the window impl class.
    Please suggest how can i make this popup work in case of Cancel button as well.
    Thanks....

    Hi bkvs,
    Usually when you click the "Cancel" button that means you don't want to save your entry... hence displaying the dataloss popup doesn't make really sense to me. However, you may want the user to confirm that he really wants to cancel.
    So I would suggest to redefine the EH_ON_CANCEL method of your view, to display a simple confirmation popup before you actually cancel everything. This wiki will show you how to do it:
    Creating popup message in webclient UI - CRM - SCN Wiki
    Regards,
    Nicolas.

  • Popup with text area & ok/cancel button

    Hi all,
    My requirement is to display a popup with a text area in editable mode along with 'Confirm' and 'Cancel' button. If the user changes the text, and presses the 'CONFIRM' the text is to be saved in DB.
    How do i implement this? Should i use a FM or modal dialog box?

    You can use simple modal dialog box ..
    using below syntax :
    CALL SCREEN 1100 STARTING AT 1 1.
    Select modal dialog box ( Screen type).
    Thanks
    Seshu

  • Blank row added after cancel button on create page

    Hi All,
    I have a create item page where I insert items into the item table in the database.
    On press of the cancel button on this create page, the control reaches a itemlist page with my old search criteria and result but with a new blank row added to it.
    Anybody know what's wrong?

    Sorry, I misunderstood your previous question. When the cancel button is pressed. I am using pageContext.forwardImmediately with parameters to forward back to my search page. Then in the search page controller I call the AM initQuery method to run the query. My initQuery method has the following code,
    StringBuffer whereClause = new StringBuffer(200);
    Vector parameters = new Vector(3);
    int clauseCount = 0;
    int bindCount = 0;
    setWhereClauseParams(null);
    if ((Program != null) && (!("".equals(Program.trim()))))
    whereClause.append("PROGRAM = :");
    whereClause.append(++bindCount);
    parameters.addElement(Program);
    clauseCount++;
    if ((PId != null) && (!("".equals(PId.trim()))))
    Number PIdNum = null;
    try
    PIdNum = new Number(PId);
    catch(Exception e)
    throw new OAException("AK", "FWK_TBX_INVALID_EMP_NUMBER");
    if (bindCount > 0)
    whereClause.append(" AND (P_ID = :");
    else
    whereClause.append(" (P_ID = :");
    whereClause.append(++bindCount);
    whereClause.append(")");
    parameters.addElement(PIdNum);
    clauseCount++;
    setWhereClause(whereClause.toString());
    if (bindCount > 0)
    Object[] params = new Object[bindCount];
    parameters.copyInto(params);
    setWhereClauseParams(params);
    executeQuery();

  • Disable 'Cancel' button in cl_gui_frontend_services= file_save_dialog...

    Hello Experts,
    Is there a way to disable the 'Cancel' button in method 'FILE_SAVE_DIALOG' of class
    cl_gui_frontend_services? Because in our requirement, the saving of the file is mandatory.
    Thank you guys and take care!

    HI, Viraylab
    Use the Logic Bellow it will solve out your problem, using following you must provide a file name other wise after selecting Cancel button this dialog will appear again.
    PERFORM save_dialog.
    *&      Form  save_dialog
    *       text
    FORM save_dialog.
      DATA: filename TYPE string,
            path TYPE string,
            fullpath TYPE string.
      CALL METHOD cl_gui_frontend_services=>file_save_dialog
        EXPORTING
          window_title         = 'Select File Name'
        CHANGING
          filename             = filename
          path                 = path
          fullpath             = fullpath
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          OTHERS               = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      IF filename IS INITIAL.
        PERFORM save_dialog.
      ENDIF.
    ENDFORM.                    "save_dialog
    Please Reply if any Issue,
    Best Regards,
    Faisal

  • How to use the cancel button in showInputDialog

    um how would i go with overriding the cancel button's deafult function in JOptionPane.showInputDialog?
    in my code:
    package alphaOne;
    * this program takes in a number and gets the factorial of that number
    import javax.swing.*;
    public class Factorial {
         public Factorial() {
               * variables intilization, input is where the option pane puts the data
               * number is teh actucal number entered parsed from string result is
               * where the resutl is stored flag1 is the indicator if the user had
               * entered an integer
              String input;
              int flag1 = 0;
              int number = 0;
              long result = 0;
               * this while loop runs continously unless an integer is entered
              while (flag1 != 1)
                   try {
                        input = JOptionPane
                                  .showInputDialog("Enter the number to be factored, Integer only: ");
                        number = Integer.parseInt(input);
                        flag1 = 1;
                   } catch (NumberFormatException ea) {
                        JOptionPane.showMessageDialog(null,
                                  "The input was not a integer!", "Warning",
                                  JOptionPane.ERROR_MESSAGE);
              result = number;
              for (int x = 1; x < number; x++) {
                   result = result * (x);
              JOptionPane.showMessageDialog(null, "The result is: " + result,
                        "Result", JOptionPane.CLOSED_OPTION);
              try {
                   System.exit(0);
              } catch (SecurityException ea) {
                   System.out.print("ARRRRR its dead!");
         public static void main(String[] args) {
              Factorial One = new Factorial();
    }the cancel button does not break the while loop

    what is the value of null compared to when you compare it, and do we use the String.equals() or the String == null to compare? as seen in here i tried with input.equals(null) as a comparison but it deos not exit when i press cancel
    package alphaOne;
    * this program takes in a number and gets the factorial of that number
    import javax.swing.*;
    public class Factorial {
         public Factorial() {
               * variables intilization, input is where the option pane puts the data
               * number is teh actucal number entered parsed from string result is
               * where the resutl is stored flag1 is the indicator if the user had
               * entered an integer
              String input;
              boolean flag1 = false;
              int number = 0;
              long result = 0;
               * this while loop runs continously unless an integer is entered
              while (flag1 != true){
                   try {
                        input = JOptionPane
                                  .showInputDialog("Enter the number to be factored, Integer only: ");
                        number = Integer.parseInt(input);
                        System.out.println(input);
                        flag1 = true;
                        if (input.equals(null))
                             try {
                                  System.exit(0);
                             } catch (SecurityException ea) {
                                  System.out.print("ARRRRR its dead!");
                   } catch (NumberFormatException ea) {
                        JOptionPane.showMessageDialog(null,
                                  "The input was not a integer!", "Warning",
                                  JOptionPane.ERROR_MESSAGE);
              result = number;
              for (int x = 1; x < number; x++) {
                   result = result * (x);
              JOptionPane.showMessageDialog(null, "The result is: " + result,
                        "Result", JOptionPane.INFORMATION_MESSAGE);
              try {
                   System.exit(0);
              } catch (SecurityException ea) {
                   System.out.print("ARRRRR its dead!");
         public static void main(String[] args) {
              Factorial One = new Factorial();
    }i have also tried to ue input == null, input == "", input.equals(""), input.equals(" ")
    Message was edited by:
    TheHolyLancer
    i edited the part so it is bold
    Message was edited by:
    TheHolyLancer

  • Af:dialog model-restore / cancel-button processing best practice ?

    Using JDev 11.1.1.3; if I have an af:dialog running in an af:popup which contains auto-submit components (for cross-component enablement, validation etc.). My question is what are the preferred ways of discarding the model submitted changes made through popup processing if/when the af:dialog cancel button is pressed by user ? Figured that using a task flow for the content that is the popup could be an option, and using the task flow savepoint restore feature, but that looks more like database restore than model restore. I want to be able to restore the model content to the way it looked before the popup executed, without necessitating a submit to the database. How is this most commonly and best achieved ?
    Thanks,

    Taskflow savepoints are not database savepoints. Transactional BTF can be configured to issue automatic savepoints at TF entry and eventually to "rollback" to them at the TF exit. The internal implementation uses the ApplicationModule's passivation/activation mechanism to passivate the AM state at the TF entry and eventually to activate the AM state at the TF exit back to the passivated state at the entry. In this way it is simulated that you have not made any modifications in ADF BC, so your model layer will be restored to the state before TF entry. (Of course, you must not perform any DB commits durring the lifetime of this TF). I have used successfully this mechanism for the same goal you are asking about.
    Also there are savepoints managed by the ADF Controller, but I could be of little help here because I have never used them. I suspect that this mechanism could be what you need, so you may have a look here for more details:
    Adding Save Points to a Task Flow
    and in this thread:
    {thread:id=2128956}
    Dimitar

Maybe you are looking for