Button Click event

Hello

I added a button on the screen of my Blackberry and I have a class called WebCall who has the Socket connection

http://www.BlackBerry.com/developers/docs/7.1.0api/javax/microedition/IO/SocketConnection.html

I want that when I click the button, it calls the WebCall class.

How to archive this?

Thank you

Hamid Weiss

Citing a treatment on a button click has been discussed on this thread:

http://supportforums.BlackBerry.com/T5/Java-development/pushing-screen/TD-p/2399831

In this case, you should be aware that the button click process runs on the event Thread.  But to make blocking as network activity operations, you must do this in your own Thread:

http://supportforums.BlackBerry.com/T5/Java-development/what-is-the-event-thread/Ta-p/446865

http://supportforums.BlackBerry.com/T5/Java-development/blocking-operation-not-permitted-on-event-di...

So, you need start a Thread to do the treatment on your network.  Processing on BlackBerry thread is quite similar to the standard Java Thread processing, so there is no specific documentation of BB for this, but you should a lot of samples of Java if you look around.

According to the first link that I've referenced, I would recommend that you study the samples you will find.  They will never do exactly what you want, but while you are learning, it is better to start with a sample of work and make small changes to get to what you want, try to create everything from scratch.

And you should make yourself familiar with this micro-site:

http://developer.BlackBerry.com/Java/

Good luck and have fun!

Tags: BlackBerry Developers

Similar Questions

  • ranging from CO to add additional validation to a button click event

    Hello

    I have a requirement as follows:

    1. I want to have a validation via iExpense.

    2. the validation is the same, when the user creates costs report claiming suppose Bill say mobile and tries to submit it, then a check must be made if it already sent the report stating even before spending.

    The expense report is a trail, so when the user selects the type of expense and enters the details and then when he clicks the next button, the validation should take place.

    The problem is already some validations take place on the click of a button. Now, if I measure the CO and the logic of writing for postings on button click events, then the previous validations will be eliminated.

    How can I get this fact... can anyone suggest me a solution for this... Please help its really urgent and I need to give estimates for the same customer.


    Thanks in advance,
    Kaushik Rinaldi

    Hello

    Question: The problem is already some validations take place on the click of a button. Now, if I measure the CO and the logic of writing for postings on button click events, then the previous validations will be eliminated.

    Answer: call the method super in processformRequest (super.processFormRequest) first which means first the basic Oracle code will be executed and then enter your code to capture the details... pass it in a procedure to validate whether the expense was already filed.

    Thank you
    Gerard

  • Custom cursor - button click event does not

    Hello

    I'm looking to use cursors with AS3.  I created a movie object I position using:

    function mouseMoved(event:MouseEvent) {}

    mousePointer.x = this.mouseX;

    mousePointer.y = this.mouseY;

    }

    and by calling the Mouse.hide)

    It works very well on what the custom cursor follows the mouse, but I'm having some trouble using the events with the cursor.  I have several events click on the several buttons.  Events do not trigger when you use the custom cursor.  In my ignorance, I guess the problem is that the custom cursor movieclip is on the top of the key, and then click events are generated only for her and not the button.

    Is there a way to get around this?  And is it usually possible to ignore the events of a clip for a clip that is below?

    Kind regards

    Robbie your

    Try:

    mousePoiner.mouseEnabled = mousePointer.mouseChildren = false;

  • Button Click event doesn't work

    I installed the latest update of flash media and labour component (the one in the toolbar) collapsed button flash. More precisely it gets not the click event. I use:
    on click me
    Alert ("x")
    end

    and nothing happens. I reinstalled and everything went well until what I replaced with new flash support.

    Anyone have this problem?

    Thanks in advance.

    Where and how you apply this code to this component? How are you
    definition of the function "click"?

    If you are using a component in Flash, you must select the sprite, then
    Open the tab "Flash component" from the window of the property inspector. Define the
    'eventPassMode' to #passAlways. This will allow the mouse event pass
    out of the component and back to the Director. Otherwise, the mouse event
    will be captured by the component and runs any code you have
    within the component itself.

    --
    Rob
    _______
    Rob Dillon
    Adobe Community Expert
    http://www.DDG-designs.com
    412-243-9119.

    http://www.Macromedia.com/software/trial/

  • Open local .swf of button, click event

    Hi guys,.

    My brain is on vacation (again); I have lived this before but can't remember the result.

    I have forms with buttons that will be (if lead us ever done) load user guides/help from our server .swf files.

    We use a simple:

    app.launchURL ("https://www.name.com/attachments/xyz1.swf", true "')

    Click on event to do this. works very well.

    but some of the .swf are large, and for everyone, we do an installation customized to (which seems far in the future), we would like to be able to load the .swf locally (internet is always slow where we are):

    So, question, can a livecycle pdf load/play a .swf locally (from pdfswf.dir on c: for the sake of argument) or is it a security issue? I know that flash has problems with security in this area, but hope livecycle would be ok with it.

    Thank you guys

    Do not know if it is a question: http://blogs.adobe.com/asset/2010/07/update_on_functionality_change.html

    I use Acrobat v9.3.3 here.

    N.

  • How to do a table read only based on a button click event

    I have two tables: table of an insert and a single table reading and calculate the button between the two.
    When the user has entered the values of the first array and push the button calculate, the second table is supposed to show the result.
    I want to calculate the first table to read only when the user clicks the button.

    JDev 11.1.1.5.0
    ADF BC

    You will need to write an EL to the readOnly attributes property in the table representing a Boolean parameter and put a PPR on the table during the click on the button calculate

    readOnly=#{pageFlowScope.isCalculateButtonClicked}
    
  • How to display the menu on the my button click event

    I need to show the menu on clickevent on my button and menuitems will be different for the different buttons. How to do this.

    I have the substitution makemenu like that method.

       protected void makeMenu(Menu menu, int instance) {
            super.makeMenu(menu, instance);
            menu.deleteAll();
    
            if (categoryFlag) {
            for (int i = 0; i < list.size(); i++)
                    {
                menu.add(newMenuItem(list[i], 110,10+i) {
                        public void run() {
                        callMeWithScrollField(0);
                        }
                        }
                        );
            }
                menu.setOrigin(categories.getExtent().x, Display.getHeight());
            } else if (optionFlag) {
    
                menu.add(subscriptionMenu);
                menu.add(reOrderMenu);
                menu.add(aboutMenu);
                menu.add(feedBack);
                menu.setOrigin(option.getExtent().x, Display.getHeight());
            }
    
            menu.show();
    
        }
    

    But it shows the menu twice.

    Sorry my mistake.

    You will not be able to do what you want using makeMenu.  Instead, you will need to override onMenu() to the screen.  Here's a sample:

    {} public boolean onMenu (int instance)
    super.makeMenu (menu, for example);
    NewMenu menu = New Menu();
    newMenu.add (new MenuItem ("Test", 110,10) {})
    public void run() {}
    }
    }
    );
      
    newMenu.show ();
    Returns true;
    }

  • Generation of button click event

    Hello

    I would like to generate a Blackberry event that occurs when a key is pressed. Can anyone help?

    Thank you

    Teja.

    Have you looked at EventInjector?

  • Add dynamically with the click event.

    I introduce several add button programmatically. I have sucessfully Add button but I can't able to get the button click event everything. I always click the last button added.

    Event for all I want to separately, click the button.

    I use this code for the Add button.

    ComponentDefinition {
                id: mComponentDefinitionSubmitButton
                Button {
                    id: mButtonID
                    horizontalAlignment: HorizontalAlignment.Center
                    onClicked: {
                        //My Click code. Always detect last button.
                    }
                }
            },
    
    var mButton = mComponentDefinitionSubmitButton.createObject();
    mButton.text = qsTr(title)
    mContainerButton.add(mButton)
    

    I did with signal...

    function checkClick(button)
        {
            console.debug("click..."+ button);
        }
        attachedObjects: [
            ComponentDefinition {
                id: mComponentDefinitionSubmitButton
    
                Button {
                    id: mButtonID
                    signal click(variant text);
                    horizontalAlignment: HorizontalAlignment.Center
                    onClicked: {
                        click(mButtonID.text);
                    }
                }
            }
        ]
    
    ----------------------------------------------------------------
    var mButton = mComponentDefinitionSubmitButton.createObject();
    mButton.text = qsTr("Button");
    mButton.click.connect(checkClick);
    btnContainer.add(mButton);
    
  • Previous screens Menu appearing after button click

    Hi people,

    Do not know how to solve this problem... I'm probably just not to consume an event somewhere.

    My application is a multi-screen application. The user navigates by selecting (especially) options menu or clicking / tapping on the ButtonField. I find that when a user clicks a button in the application that pushes a new screen in the stack of navigation (in his listener to change) the following happens:

    • The new screen is displayed
    • Menu of the previous screen is displayed immediately

    If the user cancels the incorrect menu... Then opens a new menu, then the appropriate menu appears.

    I Build menu on the fly by substituting the screen makeMenu method. I call super first, and then create my own menu items.

    Buttons just run a FieldChangeListener that grows the new screen in the navigation stack.

    This behavior occurs both on my BB 8350i physical device and in the BB Storm Simulator. I use the component package 4.7.0.

    How can I stop the previous screen menu to appear immediately after a button click event pushes a new screen?

    Thank you!

    Add CONSUME_CLICK in your ButtonField constructor style bits.

  • Closing the PDF form on button click

    Hi all

    Is there any command/code to close the PDF form on button click event.

    Thanks and regards-

    Chalukya.

    Hi Chalukya,

    This will close the PDF form, but not the application (Acrobat/Reader):

    app.execMenuItem("Close");
    

    Good luck

    Niall

  • Capture the click event of the button 'back' on DateTimePicker

    How to capture the click event of the button "return" on the DateTimePicker control.

    Show us in the form DateTimePicker.doModal)

    I know that this response is late, but if someone else is asking about this.

    doModal() returns a Boolean value and returns false if the user clicks Cancel.

    I hope this helps.

  • not pulling - click event button position: fixed - 2.0 Playbook

    I have a fixed position "back" button in my application that triggers not when scrolling to the bottom of the screen.

    Here is the code for the button:


    When I scroll the screen to the top, the button triggers without problem. However, if the screen scrolls down at all, the button's click event will not occur.

    I've traced the events Web Inspector and a click event fires when I click the button. However, it does not actually draw the method that I've linked to the click event of the button. Once again, if I scroll the screen to the top, the button click fires very well.

    I must emphasize that the button is displayed correctly at all times. He remains in a fixed position of 5px to the right side of the screen, even when scrolling of the window down. If the button is visible at any time. It's just that when I scroll nothing happens if I click on the button.

    Looks like a bug with WebWorks. If anyone can confirm?

    Thank you

    Thanks for the suggestion ignites.

    I found that this was due to my own bug. It was a problem with z-index. I increased the z-index of the button, and it solved the problem. The button must have been in conflict with lowest elements of the page, but it was very well at the top of the page.

    Thank you

  • How to bind a click event to a button that is embedded in another symbol

    All-

    I'm sure it's easy, but you know...

    So I a menu on the main stage which has 18 buttons.  These buttons are nested inside a symbol called MC_MENU_CONTAINER.  I'm animating this symbol to show/hide the buttons on the main stage, which works very well.  What is Id like to bind an event click for these nested buttons of the main stage.  I was able to access the buttons nested with this code sym.getComposition () .getStage ().getSymbol("MC_MENU_CONTAINER").$("BTN_INTRO").hide ();  This hides the first button, but when I try to attatch a click for 'BTN_INTRO' event, it does not work.  I have the code stored on the stage using compositionReady.

    Any ideas?

    THX

    Hello

    The Stage.compositionReady event, you should be able to attach a click on the symbol nested like this event:

    sym.getSymbol("MC_MENU_CONTAINER").$("BTN_INTRO").bind ("click", function() {alert ("button clicked") ;});

  • Must click the button twice to run the code in the Click event.

    I have a button that has the following code to the click event.
    _SubFormS.setInstances (0);

    Last week, I added the code on the Exit of the next button event.
    xfa.host.setFocus (Subf.ButtonRemove);

    For some reason, I have to click twice for instance 0 value. It's never happened before. If I comment the code on the same output, nothing changes. Ideas of this weird behavior.

    Thank you.

    Hey, 1996

    It seems to me that you have a setfocus soomehwere which is always of the substitution of the click event. For example, if you have a field that does not check if (xfa.event.commitKey == 3) before that setFocus is called, it doesn't matter what other field (or button) you click on, you will be sent to the field specified by the setFocus. 'Double click' isn't a double click, it's a click that is substituted by a setFocus (which sends you somewhere else) then a second click which is not interrupted by a setfocus, which means you can click on the button.

    I don't think I have explained myself well, so here, step by step what I think is happening:

    -You are currently in an area that doesn't have that a setFocus without checking the commitKey.

    -You click on the button.

    -Due to the setFocus, you are sent to another field that does not have the button. This means that the button never fires the click event. the second field that you are sent to has the good commitKey checks.

    -You click on the new button,

    -This time, because the new field that you are in control of the good commitKey, you are not sent to another discipline, and succeeded to your click.

    I hope it did a good job of explaining my guess as to what is happening. Check all your output events to ensure that they all use the If (xfa.event.commitKey == 3) then bit. having forgotten one would explain why that happen all the time... it only occurs when you try to click on the button while you're in the field wihtout the cheque of commitKey.

    Let me know if this is useful,

    -Scott

Maybe you are looking for