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");
}

Similar Messages

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

  • 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

  • In File Dialog, when click Cancel button, it prompts error and VI exits

    Does anyone can give me an idea on how to solve this problem? When the user click on the Cancel button in the File Dialog box, it prompts out error and says "Operation canceled by user". How can I handle this error?
    I got the same error when I click on the Cancel button when the system prompts me for replacing an existing file. Btw, how can I stop the system from prompting me to replace an existing file? Thankssss.....

    Hi,
    A similiar topic was discussed here
    http://forums.ni.com/ni/board/message?board.id=170&message.id=151316#M151316
    Hope it helps

  • 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

  • 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

  • How to handle "ok" and "cancel" button of dialog popup?

    Hello everyone,
    I'm using a dialog with type="okCancel". My question is how to handle ok and cancel button of this popup window. Here is my code below:
    <af:popup id="kriterPopup">
    <af:dialog title="Kriter Seçiniz" type="okCancel" inlineStyle="width:500px;height:400;" id="d2"
    dialogListener="#{BasvuruDegerlendirmeBean.kriterDialog}">
    <af:selectManyCheckbox label="Kriterler :" id="smc2"
    binding="#{BasvuruDegerlendirmeBean.kritersCheckbox}">
    <af:forEach items="#{BasvuruDegerlendirmeBean.kriterList}" var="item">
    <f:selectItem itemLabel="#{item.ybKriter.tur}" itemValue="#{item.ybKriter.tur}" id="si3"/>
    </af:forEach>
    </af:selectManyCheckbox>
    </af:dialog>
    </af:popup>
    I want to handle ok and cancel button of this window, and redirect to the pages which I want.
    Can anyone help me how I can do?
    Thanks, with my regards.
    Ali

    You need dialogListener..
        public void dialog1_dialogListener(DialogEvent dialogEvent) {
            if (dialogEvent.getOutcome().equals(DialogEvent.Outcome.yes)){ //for Yes
            }else{ //for Cancel
        }

  • Creating a dialog box with OK and Cancel buttons without OADialogPage

    Hi Experts,
    i want to create a dialog box for Delete Confirmation means after clicking on delete it should pop up a small dialog box with OK/Cancel buttons
    and need code for the same to handle the buttons.
    i have created with OADialogPage but its showing in a complete page but i want to show those buttons in a small box.
    Plz help.
    THANKS IN ADVANCE.
    Thanks
    Raja.

    Hi,
    I have not tried using javascript in destination URI as suggested by Mukul.
    I have tried the below code for opening a page as dialog box.
    You can try it for your requirement by creating a dialog page of your own, say XXDialogPage (with OK and Cancel button)
    StringBuffer l_buffer = new StringBuffer();
    l_buffer.append("javascript:mywin = openWindow(top, '");
    String url = "/OA_HTML/OA.jsp?page=/xx/oracle/apps/fnd/dialog/webui/OADialogPG";
    OAUrl popupUrl = new OAUrl(url, OAWebBeanConstants.ADD_BREAD_CRUMB_SAVE );
    String strUrl = popupUrl.createURL(pageContext);
    l_buffer.append(strUrl.toString());
    l_buffer.append("', 'lovWindow', {width:500, height:500},false,'dialog',null);");
    pageContext.putJavaScriptFunction("SomeName",l_buffer.toString());
    In dialog page's controller, you can forward it to the page onc ethe user selects OK or Cancel.
    Pass the selected value back to the main page and further you can use it for deleting.
    Regards.

  • Listener for cancel button of dialog

    Hi
         What shud i add as listener for the dialog , so that when i press cancel button the listener shud get executed?. Alos is there any listener to know if the user has pressed the close(x) mark of the dialog and closed the dialog. Any help wud be appreciable
    Thanks
    Veena

    try beforesubmit handler
    Ref:
    http://dev.day.com/docs/en/cq/current/widgets-api/index.html?class=CQ.Dialog

  • How to create a Dialog Box with two buttons (Acept and Cancel)?

    Hi i am devoloping an application (an applet) that has to throw a Dialog box, if i click on the Acept button makes some thing and if i click on the Cancel button the it makes other things.
    how could i throw this dialog message...?
    Thanks.

    The following would be the code needed for your dialog box:
         JDialog dialog = new JDialog();
         dialog.setModal(true);
         //the following window listener to the dialog box is optional
         dialog.addWindowListener(new WindowAdapter(){
              public void windowClosing(WindowEvent e){
                  System.exit(0);
              }//method
         JButton acceptButton = new JButton("Accept");
         JButton cancelButton = new JButton("Cancel");
         acceptButton.addActionListener(new ActionListener(){
              public void actionPerformed(ActionEvent e){
                  //do what you need to do
              }//method
         cancelButton.addActionListener(new ActionListener(){
              public void actionPerformed(ActionEvent e){
                  //do what you need to do
              }//mehthod
         Container cont = dialog.getContentPane();
         cont.setLayout(new BorderLayout());
         cont.add("West",acceptButton);
         cont.add("East",cancelButton);
         dialog.pack();
         dialog.setVisible(true); I hope this would be useful
    Rizwan

  • Cancel button to display confirmation dialog in an edittable form

    Hi everyone.
    I have got a requirement that in my edittable form, I need to show confirmation popup before canelling the page and discarding all the changes.
    But, before showing that dialog, I need to figure out if any changes happened or not?
    As usual, my cancel button is set to immediate=true, and for that reason, I couldn't find any way to see whether user done any change or not.
    As far as I know, there are two ways to find out the changes:
    1. using Data control
            ApplicationModule am = ADFUtils.getDCBindingContainer().getDataControl().getApplicationModule();
            return am.getTransaction().isDirty();
         OR
            BindingContext bc = BindingContext.getCurrent();
            String currentDataControlFrame = bc.getCurrentDataControlFrame();
            return bc.findDataControlFrame(currentDataControlFrame).isTransactionDirty();
    2. using commit button:
    Boolean changed = (Boolean)JSFUtils.getManagedBeanValue("bindings.Commit.enabled");
    But, both of them cannot reflect the change in case of postback caused by cancel button, as mentioned its immediate=true
    Any solution to find out changes if cancel  button pressed?
    Cheers,
    Nasser

    I have the same case, and I'm using the below code for the button action listener, with immediate=true.
        ControllerContext cctx = ControllerContext.getInstance();
            if (cctx.getCurrentRootViewPort().isDataDirty()) {
                RichPopup.PopupHints hints = new RichPopup.PopupHints();
                getExitPopup().show(hints);
    try this, maybe it will help.

  • 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

  • Canceling Dialog Box after a button is pushed

    The problem I have is I open the dialog box and push my button to call another script to run.  But if there is an error the error is hid behind the dialog box.  I would like to Call the dialog box, push button and then close my dialog box before the script runs.  Can that be done.
    So far I have tried this and can get it to do what I want.
    SubButton4_EventClick(ByRef This) 'Created Event Handler
    CallUIAutoRefreshSet(0)
    Call dialog.cancel
    Callscriptinclude ("D:\_Calterm_Configuration_Files\Technical_Information\DIAdem_Scripts\Insite_DataLog_FileLoader.VBS")
    CallUIAutoRefreshSet(1)
    End Sub
    Solved!
    Go to Solution.

    Hi J,
    If you're willing to have the SUDialog close to unubstruct the view of a potential error dialog, then why not conditionally call the next script right after the SudDlgShow() command in the script that calls the SUDialog?  If the user closes the dialog with the Cancel action, you don't run the script, but if they close with the Ok action, you do-- like this:
    Response = SudDlgShow("MyDialog", CurrentScriptPath & "MyDialogFile.SUD")
    IF Response = "IDOk" THEN Call ScriptStart("MyScriptPath")
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Today i made a gamecenter account and when i play a game like clash of clans it takes me to gamecenter and i log in then it takes me to a blank page with a cancel button so my question is how do i sign in to gamecenter when this happens

    today i made a gamecenter account and when i play a game like clash of clans it takes me to gamecenter and i log in then it takes me to a blank page with a cancel button so my question is how do i sign in to gamecenter when this happens

    Try:
    FaceTime, Game Center, Messages: Troubleshooting sign in issues

  • 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){
    }

Maybe you are looking for

  • No itunes or quicktime will install and run

    I dloaded itunes on home pc before I even had ipod video for this Cmas. It works fine. Needed to get it on my laptop so I dloaded and it kept giving me the error message it encountered an error and needed to close (send error report or not). Tonite I

  • How to access SAP database tables with Java (Jco)

    Hi! I need to develop a Java Client for SAP with access to the SAP database. Is there a way to do this directly in Java (the db access) or do I have to use some ABAP logic in between to get the information to the java client? If so, are there any exi

  • Tab titles dont change according to website title. It says either New Tab or Connecting...

    I downloaded and Installed FF4 yesterday from FF website. I am not able to see the Tab Titles. It shows either "New Tab" or says "Connecting... " even though the Page has loaded fully.

  • Trying to find what program is updating a table

    Hello, This does not really fall under ABAP but I didn't know where to put it. I have been trying to find out what process is updating my class. The transaction code is CL02 and some process is re-arranging the characteristics of a certain class.  In

  • Best practices for administering Oracle Big Data Appliance

    -        Best practices as part of administration of Oracle Big Data Infrastructure -        How do we lock down max space usage per project Eg: Project team A can have a max limit of 10 TB space allocated -        Restricting roles, access ( Read, W