Cancel Button - Clear Input Values

Hello,
I have an input form and user can click the cancel button. When user returns later, I want emty input fields.
But my code, does not work:
public String cancelDugme_action() {
       DCBindingContainer dcBindings = (DCBindingContainer)getBindings();
       AttributeBinding id = (AttributeBinding)dcBindings.getControlBinding("idKorisnika");
       id.setInputValue(null);
       return "nazad";
}I get null pointer exception...
Why?
Thanx
Vanja

Hi,
Please find the explanation for the immediate property for a button found in the IDE Help section.
If this property is selected, when the user activates the button, the code in the page bean is executed before the validation, updating of model values, and so on. Essentially, code execution happens right away on the server, which then returns the page.
The most common example of an immediate action is a Cancel button. You make it immediate so that the normal validation and update steps can be skipped, but the action handler can still do whatever is necessary. Typically, the action handler will navigate back to some previous page. In some designs the action handler might also enqueue an informational message like "Transaction cancelled". It is possible to do more: for example, an application might record the fact that the user got partially through a form and then cancelled it.
Setting immediate property to false for the submit button makes the application behave as one could expect.On reading this it appears that the immediate property on the Submit button was set to true along with the Cancel button. Please ensure that the immediate property is only set when the code in the page bean is to be executed bypassing the normal cycle.
Hope this helps
Cheers
Giri

Similar Messages

  • JFileChooser Cancel Button

    Hi,
    Is there a way to change cancel button text in a JFileChooser?
    Reguards,
    Nuno Martins

    The cancel button uses a value from the UIManager, "FileChooser.cancelButtonText". Replace that value via UIManager.put(key, value) with whatever you like. Almost all these types of properties can be changed. Look in the cooresponding plaf classes (BasicFileChooserUI.java, MetalFileChooserUI.java, ...) for what other components use.

  • 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
    ¯\_(ツ)_/¯

  • Input dialog question OK/Cancel Button

    Hi there,
    I�m busy with an application that displays an input dialog box on start up. It prompts the user for their name. This imput will then be used for a JLabel welcoming the user with their name. If no name is entered. The Jlabel will display �Welcone User�. Everythng works fine but when I press cancel on the input dialog box I get an error. Below is some code of what I�ve done so far.
    Thanks,
    Patrick.
    String name = JOptionPane.showInputDialog(null,
              "Please enter your name",
              "Name input",
              JOptionPane.PLAIN_MESSAGE);
              welcome = new JLabel(name);
              if (name.length() == 0) {
                   welcome = new JLabel("Welcome User");
              else if (name.length() > 0) {
                   welcome = new JLabel("Welcome " + name);

    The error is NullPointerException.
    If the cancel button is pushed a null is returned.
    Try this test instead
    if ((name == null) || (name.length() == 0))
       welcome = new JLabel("Welcome User");
    }

  • How to clear the input values in WD4A

    Hi all,
    Thanks in Advance.
    In my login page i have ID and Password.If Login fails it back to the same login page.But at the same time the entered(In ID and Password)will be cleared.If i write the code in inboundhandler is it correct means how can i write to invalidate the input values???Is there any examples or related links???

    Hi,
    Please have a look at this similar thread:
    how to clear entered values.
    Hope this helps!
    Regards,
    Srilatha

  • Pixma MG7120 CANCEL BUTTON?How do I clear a paper jam trying to set up new printererror code 6000

    Just pruchased 7120. Doing set up  got  to the add paper  for alignment The  paper jammed and code says hit cancel  button and restart.  There is no cancel button . I cant clear the paper jam  and the only  button to access is the on/off button. Says code 6000. HAve  unlugged, restarted. Nothing makes a difference. In teh store before I bought  it, there  display  printer had teh same problem.  I asked them  what happens if I get the same thing on my new printer  they opened a  new printer  and set it up for their display. with out  problem. Now I  am home with a  new one and cant do anything, HELP! 

    Hi Charlene,
    To try and resolve the paper jam, please turn off the printer and unplug it, then remove the back panel on the printer, then the gray plastic piece.  Hopefully, you will be able to see the paper that is jammed in the printer and be able to remove it.  
    Once the gray plastic piece and back panel have been put back on, please plug the printer back in and turn it back on.  If the error persists, the printer will require servicing.  Please call or email us at one of the methods on the Contact Us page to obtain your servicing options.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • ADF Input Date - To remove cancel button while clicking glyph

    Hi Guys,
    In the Input date if we use the <af:ConvertDateTime> then in the popup we will have time zone,OK and Cancel Button. In this i want to remove the Cancel Button. Why i want to remove is in the popup the Close button is already fullfilling the functionality. Hope this should be done using CSS.
    Kindly let me know how to do it?

    Hi.,
    I hope this url will help u..
    http://docs.oracle.com/cd/E23549_01/apirefs.1111/e12419/tagdoc/af_inputDate.html
    Thanks,
    parame

  • Regarding Module Pool's Cancel button

    Hi Guys,
    Please help me I have created on Module Pool and now this module pool is called through a a UserExit .
    now the thing is if i cancel button which is placed on my popup screen then it is still going into the output which is wrong it should show up the previous screen.
    My code for the Sy-ucomm = cancel is
    IF SY-UCOMM = 'CANC'.
        SET SCREEN 0.
        LEAVE SCREEN.
      ENDIF.
    Can you please provide me some code by which i can go to the previous screen.

    I am calling the Module pool through User exit and inside user exit i am calling FM which calls my screen.
    Userexit -> FM -> ModulePool
    here is the code :
    ***INCLUDE LZRMA_NOTIFO01 .
    *&      Module  STATUS_0150  OUTPUT
    *       text
    MODULE STATUS_0150 OUTPUT.
    *  SET PF-STATUS SY-DYNNR.
    *  SET TITLEBAR SY-DYNNR.
    ENDMODULE.                 " STATUS_0150  OUTPUT
    *&      Module  CUA_STATUS  OUTPUT
    *       text
    MODULE CUA_STATUS OUTPUT.
    *  SET PF-STATUS SY-DYNNR.
    *  SET TITLEBAR SY-DYNNR.
    ENDMODULE.                 " CUA_STATUS  OUTPUT
    *&      Module  EXIT_SCREEN  INPUT
    *       text
    MODULE EXIT_SCREEN INPUT.
      DATA:      C_FCODE_ABBR   LIKE SY-PFKEY  VALUE 'ABBR' .
    break-point.
      CASE OK-CODE.
        WHEN C_FCODE_ABBR.
    *-- Abbrechen
    *   Daten zurücknehmen
          CLEAR RQM01.
    *      RAISE CANCEL.
          set screen 0.
          LEAVE TO SCREEN 0.
            call transaction 'QM01'.
      ENDCASE.
    IF SY-UCOMM = 'CANC'. "  Here is the SY-UCOMM Where i have to handle the CANC BUTTON
    *    SET SCREEN 0.
    *    LEAVE SCREEN.
       LEAVE PROGRAM.
      ENDIF.
    ENDMODULE.                 " EXIT_SCREEN  INPUT
    *&      Module  CHECK_NOTIF_NO  INPUT
    *       text
    MODULE CHECK_NOTIF_NO INPUT.
    *& Below condition checks if the user enter a Notification Num and Porduction
    *  Order Then Message comees Please enter a Prod Order or RMA Notif Num only
    *  Process cannot accept both.
      IF NOT VIQMEL-QMNUM IS INITIAL.
        IF NOT RQM01-FERTAUFNR IS INITIAL.
          MESSAGE E904(QM).    "  Please enter a Prod order or RMA Notif Num only.
                                  "  Process can't accept both
        ENDIF.
      ENDIF.
    *& If Production order is entered, then check if the Order type is 'AES1' or *
    *&  'AES3'AES2,AES4, AES5, AES6,ICSO, PM01, PM02, RMA, SM01, SM02, ZEXR,
    *&   Message flashes ' Please enter only enter RMA Notif Number.       *
      data: v_dauat like afpo-dauat.
      SELECT SINGLE DAUAT INTO V_DAUAT FROM AFPO WHERE AUFNR = RQM01-FERTAUFNR.
      if sy-subrc = 0.
        IF V_DAUAT = 'AES1' OR V_DAUAT = 'AES3' OR
           V_DAUAT = 'AES2' OR V_DAUAT = 'AES4' OR
           V_DAUAT = 'ICSO' OR V_DAUAT = 'PM01' OR
           V_DAUAT = 'PM01' OR V_DAUAT = 'RMA' OR
           V_DAUAT = 'SM01' OR V_DAUAT = 'SM02' OR V_DAUAT = 'ZEXR'..
          MESSAGE E905(QM).    " Please Only enter a RMA Notif Number.
        ENDIF.
      endif.
    ENDMODULE.                 " CHECK_NOTIF_NO  INPUT
    *&      Module  FEAUF_SAAUF_CHECK  INPUT
    *       text
    MODULE FEAUF_SAAUF_CHECK INPUT.
      OK-CODE = SY-UCOMM.
    *Added by CChauhan
      IF VIQMEL-QMNUM IS INITIAL.
    *& End of Addition by CChauhan
        IF  NOT RQM01-FERTAUFNR IS INITIAL
        AND ( NOT RQM01-VERID IS INITIAL
             OR NOT RQM01-RM_WERKS IS INITIAL
             OR NOT RQM01-RM_MATNR IS INITIAL ).
    *   only production order or manufacturing version meaningfully
          MESSAGE E902(QM).
        ENDIF.
    *Added by CChauhan
      ENDIF.
    *& End of Addition by CChauhan
    ENDMODULE.                 " FEAUF_SAAUF_CHECK  INPUT
    *&      Module  FEAUF_FEPOS_CHECK  INPUT
    *       text
    MODULE FEAUF_FEPOS_CHECK INPUT.
      IF VIQMEL-QMNUM = ''.
        IF      RQM01-FERTAUFNR = ''
        AND RQM01-FERTVORNR <> ''.
          MESSAGE E903(QM).
        ENDIF.
      ENDIF.
      IF SY-UCOMM = 'CANC'.
        LEAVE SCREEN.
      ENDIF.
    ENDMODULE.                 " FEAUF_FEPOS_CHECK  INPUT
    *&      Module  FAUF_LESEN  INPUT
    *       text
    MODULE FAUF_LESEN INPUT.
    *& Added by CChauhan  Date: 01/23/2007
    *& Execute further if RMa_Notif(VIQMEL-QMNUM)ield is blank.
    IF VIQMEL-QMNUM IS INITIAL.
    *&End by CChauhan     Date: 01/23/2007
        PERFORM FAUF_LESEN USING RQM01-FERTAUFNR
                                 RQM01-FERTVORNR
                        CHANGING CAUFV
                                 AFVC.
    *   Belegdaten an Qualitätsmeldung übergeben
        PERFORM FAUF_TO_QMEL USING CAUFV
                                   AFVC
                          CHANGING RQM01.
    *& Added by CChauhan  Date: 01/23/2007
    ENDIF.
    *&End by CChauhan     Date: 01/23/2007
    ENDMODULE.                 " FAUF_LESEN  INPUT
    *&      Form  FAUF_LESEN
    *       text
    *      -->P_RQM01_FERTAUFNR  text
    *      -->P_RQM01_FERTVORNR  text
    *      <--P_CAUFV  text
    *      <--P_AFVC  text
    FORM FAUF_LESEN USING VALUE(P_AUFNR) LIKE RQM01-FERTAUFNR
                          VALUE(P_VORNR) LIKE RQM01-FERTVORNR
                 CHANGING VALUE(P_CAUFV) LIKE CAUFV
                          VALUE(P_AFVC)  LIKE AFVC .
      CALL FUNCTION 'QMHL_HELP_FAUF'
        EXPORTING
          I_AUFNR             = P_AUFNR
          I_VORNR             = P_VORNR
          I_FOLGE             = G_FOLGE
        IMPORTING
          E_CAUFV             = P_CAUFV
          E_AFVC              = P_AFVC
        EXCEPTIONS
          ORDER_NOT_FOUND     = 1
          OPERATION_NOT_FOUND = 2
          OTHERS              = 3.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " FAUF_LESEN
    *&      Form  FAUF_TO_QMEL
    *       text
    *      -->P_CAUFV  text
    *      -->P_AFVC  text
    *      <--P_RQM01  text
    FORM FAUF_TO_QMEL USING VALUE(P_CAUFV) LIKE CAUFV
                            VALUE(P_AFVC)  LIKE AFVC
                   CHANGING       P_RQM01  LIKE RQM01.
    * zunächst Berechtigung für Meldungsart/Werk prüfen
      PERFORM CHECK_QAUT_QMEL USING SY-TCODE
                                    TQ80-QMART
                                    P_CAUFV-WERKS.
    * Materialnummer des Fertigprodukts ermitteln
      SELECT * FROM AFPO
      WHERE AUFNR = P_CAUFV-AUFNR.
    * Materialnummer steht in der ersten Auftragsposition
        EXIT.
      ENDSELECT.
      IF SY-SUBRC IS INITIAL.
    *   Materialnummer übernehmen
        P_RQM01-MATNR  = AFPO-MATNR.
        IF NOT AFPO-MATNR IS INITIAL.
          PERFORM MATERIAL_CHECK USING AFPO-MATNR.
        ENDIF.
    *   Charge
        P_RQM01-CHARG     =  AFPO-CHARG.
    *--- Lieferantencharge bestimmen
        IF NOT P_RQM01-CHARG IS INITIAL.
          SELECT SINGLE * INTO MCHA FROM MCHA
                  WHERE MATNR =  P_RQM01-MATNR
                  AND   WERKS =  P_RQM01-MAWERK
                  AND   CHARG =  P_RQM01-CHARG.
          IF SY-SUBRC EQ 0.
            MOVE MCHA-LICHA TO P_RQM01-LICHN.
          ENDIF.
        ENDIF.
        P_RQM01-LGORTCHAR =  AFPO-LGORT.
      ENDIF.
      P_RQM01-MAWERK    =  P_CAUFV-WERKS.
      IF NOT AFPO-MATNR IS INITIAL
        AND  NOT P_CAUFV-WERKS IS INITIAL.
        PERFORM MATERIAL_WERK_CHECK USING AFPO-MATNR
                                          P_CAUFV-WERKS.
      ENDIF.
    * Revisionsstand
      P_RQM01-REVLV     =   P_CAUFV-REVLV.
    * reklamierte Menge
      P_RQM01-RKMNG     =   P_CAUFV-GAMNG - P_CAUFV-GASMG.
      P_RQM01-BZMNG     =   P_CAUFV-GAMNG - P_CAUFV-GASMG.
      P_RQM01-MGEIN     =   P_CAUFV-GMEIN.
    * Arbeitsplatz
      P_RQM01-ARBPL = P_AFVC-ARBID.
    * eindeutiger Schluessel fuer Vorgang
      P_RQM01-FERTAUFPL = P_AFVC-AUFPL.
      P_RQM01-PNLKN     = P_AFVC-APLZL.
    * Info über automatische Datenübernahme
      MESSAGE S026(QM) WITH P_CAUFV-AUFNR RQM01-FERTVORNR.
    ENDFORM.                    " FAUF_TO_QMEL
    *&      Form  CHECK_QAUT_QMEL
    *       text
    *      -->P_SY_TCODE  text
    *      -->P_TQ80_QMART  text
    *      -->P_P_CAUFV_WERKS  text
    FORM CHECK_QAUT_QMEL USING VALUE(P_TCODE)
                               VALUE(P_QMART)
                               VALUE(P_WERK).
      CHECK NOT P_WERK IS INITIAL.
      MOVE-CORRESPONDING RQM01 TO H_VIQMEL.
      CALL FUNCTION 'QAUT_QMEL'
        EXPORTING
          I_WERKS  = P_WERK
          I_QMART  = P_QMART
          I_TCODE  = P_TCODE
          I_VIQMEL = H_VIQMEL.
    ENDFORM.                    " CHECK_QAUT_QMEL
    *&      Form  MATERIAL_CHECK
    *       text
    *      -->P_AFPO_MATNR  text
    FORM MATERIAL_CHECK USING  VALUE(P_MATNR).
    *-- lokale Daten
      DATA : BEGIN OF L_DUMMY_TAB OCCURS 0,
               DUMMY(1),
             END   OF L_DUMMY_TAB.
    * Prüfung nur, falls Materialnummer und Werk gefüllt
      CHECK NOT P_MATNR IS INITIAL.
    * Verprobung auf MARA-Segment
      MOVE C_MARA_SEGMENT TO MTCOM-KENNG.
      MOVE P_MATNR        TO MTCOM-MATNR.
      TABLES: MTCOR.
      CALL FUNCTION 'MATERIAL_READ'
        EXPORTING
          SCHLUESSEL           = MTCOM
        IMPORTING
          MATDATEN             = MARA
          RETURN               = MTCOR
        TABLES
          SEQMAT01             = L_DUMMY_TAB
        EXCEPTIONS
          ACCOUNT_NOT_FOUND    = 01
          BATCH_NOT_FOUND      = 02
          FORECAST_NOT_FOUND   = 03
          LOCK_ON_ACCOUNT      = 04
          LOCK_ON_MATERIAL     = 05
          LOCK_ON_PLANT        = 06
          LOCK_ON_SALES        = 07
          LOCK_ON_SLOC         = 08
          LOCK_SYSTEM_ERROR    = 09
          MATERIAL_NOT_FOUND   = 10
          PLANT_NOT_FOUND      = 11
          SALES_NOT_FOUND      = 12
          SLOC_NOT_FOUND       = 13
          SLOCNUMBER_NOT_FOUND = 14
          SLOCTYPE_NOT_FOUND   = 15
          TEXT_NOT_FOUND       = 16
          UNIT_NOT_FOUND       = 17.
      CASE SY-SUBRC.
        WHEN C_RC00.
    *       alles o.k.
          RQM01-MATKL = MARA-MATKL.
          RQM01-PRDHA = MARA-PRDHA.
        WHEN C_RC10.
          MESSAGE E005(QM) WITH P_MATNR.
      ENDCASE.
    * Beim Material sitzt Loeschvormerkung.
      IF NOT MTCOR-LVORM IS INITIAL.
        MESSAGE W008(M3).
      ENDIF.
    ENDFORM.                    " MATERIAL_CHECK
    *&      Form  MATERIAL_WERK_CHECK
    *       text
    *      -->P_AFPO_MATNR  text
    *      -->P_P_CAUFV_WERKS  text
    FORM MATERIAL_WERK_CHECK USING VALUE(P_MATNR)
                                   VALUE(P_WERK).
    *-- local data
      DATA : BEGIN OF L_DUMMY_TAB OCCURS 0,
               DUMMY(1),
             END   OF L_DUMMY_TAB.
    * Examination only, if materials number and work filled
      CHECK (    NOT P_MATNR IS INITIAL
             AND NOT P_WERK  IS INITIAL ).
    * Checking on MARC segment
      MOVE C_MARC_SEGMENT TO MTCOM-KENNG.
      MOVE P_MATNR        TO MTCOM-MATNR.
      MOVE P_WERK         TO MTCOM-WERKS.
      CALL FUNCTION 'MATERIAL_READ'
        EXPORTING
          SCHLUESSEL           = MTCOM
        IMPORTING
          MATDATEN             = MARC
        TABLES
          SEQMAT01             = L_DUMMY_TAB
        EXCEPTIONS
          ACCOUNT_NOT_FOUND    = 01
          BATCH_NOT_FOUND      = 02
          FORECAST_NOT_FOUND   = 03
          LOCK_ON_ACCOUNT      = 04
          LOCK_ON_MATERIAL     = 05
          LOCK_ON_PLANT        = 06
          LOCK_ON_SALES        = 07
          LOCK_ON_SLOC         = 08
          LOCK_SYSTEM_ERROR    = 09
          MATERIAL_NOT_FOUND   = 10
          PLANT_NOT_FOUND      = 11
          SALES_NOT_FOUND      = 12
          SLOC_NOT_FOUND       = 13
          SLOCNUMBER_NOT_FOUND = 14
          SLOCTYPE_NOT_FOUND   = 15
          TEXT_NOT_FOUND       = 16
          UNIT_NOT_FOUND       = 17.
      CASE SY-SUBRC.
        WHEN C_RC00.
    *       alles o.k.
          RQM01-KZDKZ = MARC-KZDKZ.
          RQM01-KZKRI = MARC-KZKRI.
        WHEN C_RC11.
          MESSAGE E004(QM) WITH P_MATNR
                                P_WERK.
        WHEN C_RC10.
          MESSAGE E005(QM) WITH P_MATNR.
      ENDCASE.
    ENDFORM.                    " MATERIAL_WERK_CHECK
    *&      Module  FCODE  INPUT
    *       text
    MODULE FCODE INPUT.
    *& Inserted by CC  01/24/2007
      II_VIQMEL-FERTAUFNR = RQM01-FERTAUFNR.
    *& End by CC   01/24/2007
      PERFORM FCODE USING OK-CODE.
    ENDMODULE.                 " FCODE  INPUT
    *&      Form  FCODE
    *       text
    *      -->P_OK_CODE  text
    FORM FCODE USING VALUE(P_FCODE) LIKE SY-TCODE.
      CASE P_FCODE.
        WHEN C_FCODE_ENT1.
    *-- Weiter
          SET SCREEN 0.
          LEAVE SCREEN.
      ENDCASE.
      IF SY-UCOMM = 'CANC'.
        SET SCREEN 0.
        LEAVE SCREEN.
      ENDIF.
    ENDFORM.                    " FCODE

  • 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

  • How to retain screen input values in HR program on BACK ?

    Hi,
    I have a report program in HR, using LDB "PNP" and Report category : PSSPCDOC.
    After the program is executed and the report is displayed on screen, if the user clicks the BACK button (F3), the selection screen is displayed with initial values. The input values provided by the user previously get lost.
    I debugged and it seems that the memory gets cleared everytime the BACK button is clicked.
    But i want to retain the user inputs on the selection screen if the user clicks the BACK button because the user wants to change some selection inputs not all.
    I am new to HR module, please let me know how to solve this issue.

    Hi,
    You can make use of SAP memeory. in the AT-SELECTION-SCREEN event, you can upload selection data in the defined memory area. Then you can make a check in the AT-SELECTION-SCREEN OUTPUT for that memory area and if that area has some data, you can show that into the screen in that event.
    Thus, first time when User execute the program, that memory area would be initial. However, if user select Back after execution of selection screen, data will get loaded into the memory area and will display in the screen once again.

  • ADF Dialog Framework Cancel Button

    Hi all,
    We're experiencing, in multiple applications, a problem with a Cancel button (immediate="true") on a page launched by the dialog framework. While the value does not change in the model layer (saving to the database confirms this), it does seem to appear in the application UI, even after clicking the cancel button, until you post data.
    Details follow:
    This code is all JHS-generated, but we've spoken to Steven Davelaar, and he's pretty sure it's not a JHS problem. I certainly can't see anything obviously wrong with the code.
    Here's the component that launches the dialog, minus attributes like "rows" and "columns":
    <af:panelLabelAndMessage label="MIS Notes: "
        id="RpReportDocHeaderVwMisNotesLabel">
        <af:inputText id="SomeAttr" value="#{bindings.SomeAttr.inputValue}"
            required="#{bindings.SomeAttr.mandatory}"
            simple="true" partialTriggers="SomeAttrEditorLink"
            binding="#{SomeAttrEditorItem.editorItem}">
        </af:inputText> 
        <f:facet name="end">
            <af:commandLink id="SomeAttrEditorLink"
                action="dialog:editor" immediate="true" useWindow="true"                           
                partialSubmit="true" windowHeight="320" windowWidth="670"
                returnListener="#{SomeAttrEditorItem.returnedFromEditor}"
                launchListener="#{SomeAttrEditorItem.launchEditor}">
                <af:objectImage source="/jheadstart/images/editor.gif"/>
            </af:commandLink>
        </f:facet>
    </af:panelLabelAndMessage />The editor window, minus layout, form, etc. elements, is as follows:
    <af:inputText rows="10" columns="100"
        value="#{processScope.editorValue}"
        maximumLength=
            "#{processScope.editorMaxLength==0 ? null : processScope.editorMaxLength}" />
    <af:panelButtonBar>
        <af:commandButton text="Cancel" immediate="true">
            <af:returnActionListener/>
        </af:commandButton>
        <af:commandButton text="OK">
            <af:returnActionListener value="#{processScope.editorValue}"/>
        </af:commandButton>
    </af:panelButtonBar>Now, SomeAttrEditorItem is a managed bean of type oracle.jheadstart.controller.jsf.bean.EditorItemBean, so it's JHS code, but nothing about it should really matter if the returnActionListener for the Cancel button doesn't contain a value and is immediate, should it?
    Any help much appreciated. Thanks much,
    Avrom

    Thanks, Frank. This looks like a JHS bug (albeit one we can work around by writing our own template)--JHS should probably not be generating code that leaves cancelled changes in place. I'll notify them on their forum.
    [Edit:] Actually, there's something I don't understand about the instructions. In a case like this, I really only want to undo changes to a particular attribute--whatever attribute the dialog changed. And ideally, I don't want to refresh to the last pre-commit point; I want to just discard the changes that were made by this particular dialog. So I don't really think Row.refresh() is going to work here.
    Now, I could do something like this: In the launch listener, store the relevant attribute in some transient location, and on return, refresh it. But that seems overly complicated; isn't there a way to just not submit a dialog's values upon returning to the original form, or, at least, to prevent them from updating the model?
    Message was edited by:
    Avrom
    [Further edit:] Wait, no, there's something even stranger going on here. Note that the text input in the dialog isn't bound to "#{bindings.SomeAttr.inputValue}"; it's bound to "#{processScope.editorValue}". And the cancel button doesn't even have a returnActionListener! So how is the value getting passed back to the original form?
    Message was edited by:
    Avrom

  • [JS CS4] ScriptUI Cancel button inoperant during process

    Hi,
    I made a small interface for exporting PDF. I create two buttons, one for launching the export, one to stop it.
    The launch button calls the exportPDF() function. This function sets two the values of the progressbar.
    The problem is that once the export is launched, the cancel button is no more cliackable. I would like my users to have the opportunity to stop the export process.
    I saw this thread but can't succeed in applying it.
    http://forums.adobe.com/message/1909296#1909296
    TIA Loic
    The script is build like this :
    win = new Window(...)
    +button export
    +button cancel
    +progressbar
    button export onClick > exportPDF();
    function exportPDF()
           doc.export(...);
           progressbar.value=...;

    Hi steven and thanks a lot for input.
    I was starting feeling desperate to get a hint on that topic.
    I tried your lead but it didn't do it. (I can assume I misused it however)
    I create the window on clicking the green button. The cancel window appears fine but I am still unable to switch the button. It's frozen like any other interactrive elements.
    That's ok, I am giving up this cancel button issue. It would be nice to get it but that's ok.
    For the record :
    main win
    green button
    onClick > Make new Window with cancel button and own interactive function
                    exportPDF(...)
    I wasn't any longer as the canceling window appears but still without interactivity.
    Thanks a lot for trying to help me anyway.
    Loic

  • Mismatch found in username and password means clear input componet as well.

    hi jdev experts,
    Using 11.1.1.5.0 - adfbc stack.
    my requirement is to simple.
    while hitting the button the username and password doesnt match with db means it throw the error. at the same time
    compoenets should clear the value. where should i handle this .
    am get confused where should i handle to reset the input component ....
    beans code.
        public String cb2_action() {
            String returnStr="error";
            if(p_user == null || p_password == null ){
                FacesContext ctx = FacesContext.getCurrentInstance();
                FacesMessage fm =
                    new FacesMessage(FacesMessage.SEVERITY_ERROR, "Invalid UserName/Password!", "");
                ctx.addMessage(null, fm);
                return null; 
            else{
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("checkLogin");
            operationBinding.execute();
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
            returnStr= "success";
            System.out.println("returnStr : " + returnStr);
            return returnStr;
    amimpl code.
        public String checkLogin(String p_user, String p_password) {
            System.out.println("Parameter Username :" + p_user +
                               "Parameter  Password :" + p_password);
            ApplUsersVOImpl vo = (ApplUsersVOImpl)this.getApplUsers1();
            /*set the bind variable value*/
            vo.setNamedWhereClauseParam("p_user", p_user);
            System.out.println("Am Implementation Username :" + p_user);
            vo.setNamedWhereClauseParam("p_password", p_password);
            System.out.println("Am Implementation Password :" + p_password);
            vo.executeQuery();
           int rowCount = (int)vo.getEstimatedRowCount();
            System.out.println("rowCount :" + rowCount);
            try {
        catch (Exception e) {
                System.out.println("Exception in check login" + e.getStackTrace());
            if (rowCount == 0) {
                throw new JboException("Invalid UserName/Password!");
            return "Welcome" + "User" + p_user.toUpperCase();
        }can any point me.
    little more info am not using adf security.

    naveeth
    thanks for pointing. but it does't works for me.
        public String cb2_action() {
            String returnStr="error";
            if(p_user == null || p_password == null ){
                FacesContext ctx = FacesContext.getCurrentInstance();
                FacesMessage fm =
                    new FacesMessage(FacesMessage.SEVERITY_ERROR, "Invalid UserName/Password!", "");
                ctx.addMessage(null, fm);
                return null; 
            else{
            System.out.println("User Logged Succefully");
            BindingContainer bindings = getBindings();
            System.out.println ("Before Login to Bean");
            OperationBinding operationBinding = bindings.getOperationBinding("checkLogin");
            System.out.println ("After Login to Bean");
            operationBinding.execute();
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
            returnStr= "success";
            } else {
                System.out.println("try to reset value"); // it is not going for else part and it is not also printing
                it1.resetValue();
                AdfFacesContext.getCurrentInstance().addPartialTarget(it1);
                it2.resetValue();
                AdfFacesContext.getCurrentInstance().addPartialTarget(it2);
            System.out.println("returnStr : " + returnStr);
            return returnStr;
    login popup code in  homepage.jspx
       <af:popup binding="#{HomePage.p1}" id="p1">
                  <af:dialog title = "xxxx Login" binding="#{HomePage.d2}"
                             contentWidth="220"
    contentHeight="100" id="d2"  modal="true" type="none">
                    <af:spacer width="100" height="30" id="s11"/>
                    <af:activeImage source="/Images/index.gif" id="ai3"/>
                    <af:panelGroupLayout id="pgl16" halign="center"
                                         layout="vertical">
                      <af:spacer width="2" height="10" id="s14"/>
                      <af:inputText label="UserName"  id="it1"
                                            value="#{HomePage.p_user}"
                                    binding="#{HomePage.it1}"/>
                      <af:spacer  height="2" id="s13"/>
                      <af:inputText label="Password"  id="it2"
                                            value="#{HomePage.p_password}"
                                            secret="true"
                                            binding="#{HomePage.it2}"/>
                                            </af:panelGroupLayout>
                    <af:spacer width="10" height="5" id="s2"/>
                    <af:panelGroupLayout id="pgl4" layout="horizontal">
                    <af:toolbar id="t1">
                     <af:spacer width="70" height="5" id="s1"/>
                    <af:commandToolbarButton text="Login"
                                             id="ctb2"
                                             action="#{HomePage.cb2_action}"/>
                        <af:spacer width="10" height="10" id="s12"/>
                        <af:commandToolbarButton text="Exit"
                                                 id="ctb3"
                                                 action="#{HomePage.cb1_action2}"/>
                      </af:toolbar>
                                                   </af:panelGroupLayout>
                  </af:dialog>
                          </af:popup> will you point me where am going wrong.?
    Edited by: ADF7 on Apr 6, 2012 9:39 AM
    Edited by: ADF7 on Apr 6, 2012 9:40 AM

  • RE: Clear cache values

    Hi all,
    I am using Jdeveloper 11.1.2.3.0
    I one page with two tabs named List and New
    In list tab i have adf table and in new tab i have form.
    In the form i have one unique constraint field, so whenever i am trying to enter already existed data it is giving an error message and however it is fine.
    But the problem is even though it is not committing the data it is showing in the table in the list tab and moreover the data is not saved in db.
    If i refresh the page then the values are not there in table.
    So how can i clear those values in the table without refreshing the page.
    Thanks,
    Syam

    Hi,
    you should clear the data in the form when you press e.g. cancel. For this have the cancel button doing as follows
    1. access the binding layer BindingContext.getCurrent().getCurrentBindingsEntry()
    2. access the iterator (DCIteratorBinding) bindings.get("Name of iterator")
    3. get current row iterator.getCurrentRow()
    4. remove row  row.remove();
    This then will also remove the row from the table. Still you may have to refresh the table to make the change visible. Here you can use the table's PartialTrigger property and point it to the tab ID of tha tab that switches back to the table
    Frank

  • Creating a customized Cancel Button

    I have a page with 2 regions.
    The 1st region has several text items and 2 buttons that are displayed conditionally.
    When the page first renders, Button A is displayed. The user then enters a value in one of the text items and clicks Button A. This displays the 2nd region. Button A then disappears and Button B appears.
    But I want the user to be able to start this process from scratch, i.e., have Button A appear on the form once again, with the form ready for him to enter another value in the text item and click Button A This is essentially just a Cancel button that returns the form back to its original state when the app was first entered.
    Can somebody please tell me how to do that?

    Hi Prohan
    You can add a button to a page that clears the cache of any page. What I think you are asking for is a button on page N that redirects to page N and also clears the cache on page N.
    To do this create a new button through the wizard and specify the page to re-direct to as the page you are adding the button to. When you've created the button you'll also have a branch created on this page for the button. Select the branch and in the Clear Cache section enter your page number.
    Alternatively, if you only want to clear some of the items on the page then create the button as above and leave the Clear Cache field empty. Instead enter the fields you want to clear in the 'Set these items' field and only enter comma's in the 'With these values' field. For example, to only clear fields 1, 2 and 3 enter
    Set these values - P1_ITEM1, P1_ITEM2, P1_ITEM3
    With these values - ,,
    Hope this helps.
    Sara
    http://www.apex-blog.com

Maybe you are looking for

  • Regarding Upload of Goods Issue  data from flat file

    Hi, i am working with interface for Goods Issue The following fields are provided in the flat file: BLDAT , BUDAT ,BWARTWE , WERKS and LGORT. We also have to maintain Internal Order number in SAP which is not provided in the flat file ; how to go abo

  • I updated my iphone to the ios6 and now it wont work.

    i updated my iphone to the ios6... and now it wont work at all. it wont even turn on, it keeps going back and forth between the black screen and then the apple mark pops up for a few seconds, and then turns back to the black screen again... and that

  • Short Dump when trying to display transformations.

    hello Experts, When I am trying to display the rule details in the transformations i am facing the follwing shortdump messages. I just want to see the rooutine in the rule details of the transformation.Could you please help me to resolve this issue.

  • Need to download only in .csv format

    hi i need to download only in .csv file if any one gives the other format file then it must change to.csv onthe selectionscreen itself and then it is to be executed i mean the last 3 digits to be changed ' csv' urgent regards sachin

  • "XDM: too many retransmissions" Error.

    Hi, I try to connect my Mac to a distant linux server using the command: " xhost +" "X :1 -query HOSTID" from the X11 application. Its open Xquark and say that it creates a display. But, nothing appear on my monitor. I wait few minute and it returns