bitmapbuttonfield onclick problem

Hello everyone,

I implement the audio recording and playback... in this record bitmapbutton will begin recording the first click (some change in bitmapbuttonfield as the change of background color) or change of bitmap in bitmapbuttonfield to indicate the first click, and stop recording on the second click on (to restore the previous bitmapbuttonfield onclick to indicate the second click)...

How can I change bitmap in bitmapbuttonfield onclick...

Please guide the procedure.

If it's standard BitmapField, then changing the image Bitmap will work as shown in this example:

http://supportforums.BlackBerry.com/T5/Java-development/show-focus-changes-using-BitmapField/Ta-p/44...

This changes the Bitmap on Focus, but you can do the same thing during the processing of a click or clear.

If you have created your own domain, then you will have to implement similar functionality.  How to do that depends on how you have set your field.  In most cases, it will be to change the bitmap that painted the paint routine, then by calling invalidate() to ensure that the system actually paint your field.

Tags: BlackBerry Developers

Similar Questions

  • Registry onClick problem

    could you please help me in this matter

    nav bar has a button when click the button open a dialog box. threr are three buttons.

    When I click a duty take this event and close the parent dialog box.

    Implement the navigation bar

    function buildNavbar (doc)

    {

    retrieve the object predefined navigation bar

    the default type is "scriptui".

    var bottombar = doc.navbars.filesystem.bottom;

    Post it

    bottombar. Visible = true;

    adjust the height

    bottombar. Height = 50;

    Add a frame to display ScriptUI

    bottombar.pathPanel = bottombar.add ('panel', undefined and 5.5 (480,35));  Bounds = [left, top, right, bottom]

    Add user interface components to the frame

    bottombar.pathPanel.browseField = bottombar.pathPanel.add ('statictext', [3, 3, 395, 22],' ');

    bottombar.pathPanel.browseBtn = bottombar.pathPanel.add ("button", 400, 3, 465 (22) and 'Log In');

    bottombar.pathPanel.browseField.text = doc.thumbnail.path;

    Add the event handler of the button that navigates to the log in form

    bottombar.pathPanel.browseBtn.onClick = function()

    {

    res = "dialog {------}.

    Info: Panel {orientation: 'column', alignChildren: 'right', \}

    text: 'Log in Info,------. "

    name: group {orientation: 'row', \}

    s: StaticText {text:'User ID: ""},

    e: EditText {characters: 30}.

    }, \

    addr: group {orientation: 'row', \}

    s: StaticText {text:' password:'}, \

    e: EditText {characters: 30, properties: {noecho:true}}------}}

    } \

    }, \

    buttons: group {orientation: 'row', \}

    testBtn: button {text: 'Test'}, \

    okBtn: button {text: 'OK', properties: {name: 'ok'}}, \

    cancelBtn: button {text: 'Cancel', properties: {name: 'Cancel'}}.

    } \

    }";

    win = new window (res);

    Win.Center ();

    Win.Show ();

    $.writeln (win.info.name.e.text);

    $.writeln (win.buttons.okBtn.text);

    $.writeln (win.buttons.okBtn.properties.name.text);

    Add the event handler of the button that navigates to the log in form

    win.buttons.testBtn.onClick = function()

    {

    Alert ('here');

    }

    win.buttons.okBtn.onClick = function()

    {

    Alert ('here2');

    }

    }

    }

    Win.Show (); should be after the onClick events...

    // Set up the navigation bar
    function buildNavbar(doc){
            // retrieve the predefined NavBar object
            // the type defaults to "scriptui"
            var bottombar = doc.navbars.filesystem.bottom;
            // display it
            bottombar.visible = true;
            // set the height
            bottombar.height = 50;
            // add a ScriptUI display frame
            bottombar.pathPanel = bottombar.add( "panel", [5,5, 480,35], undefined);  // bounds = [left, top, right, bottom]
            // add UI components to the frame
            bottombar.pathPanel.browseField = bottombar.pathPanel.add( "statictext",[3, 3, 395, 22],"");
            bottombar.pathPanel.browseBtn = bottombar.pathPanel.add( "button",[400, 3, 465, 22],"Log In");
            bottombar.pathPanel.browseField.text = doc.thumbnail.path;
            // add the button's event handler, which navigates to the log in form
            bottombar.pathPanel.browseBtn.onClick = function(){
                res = "dialog { \
                    info: Panel { orientation: 'column', alignChildren:'right', \
                                    text: 'Log In Info', \
                                    name: Group { orientation: 'row', \
                                                    s: StaticText { text:'User ID:' }, \
                                                    e: EditText { characters: 30 } \
                                                }, \
                                    addr: Group { orientation: 'row', \
                                                    s: StaticText { text:'Password:' }, \
                                                    e: EditText { characters: 30, properties:{noecho:true}} \
                                                } \
                                }, \
                            buttons: Group { orientation: 'row', \
                                                      testBtn: Button { text:'Test' }, \
                                                okBtn: Button { text:'OK', properties:{name:'ok'} }, \
                                                cancelBtn: Button { text:'Cancel', properties:{name:'cancel'} } \
                                            } \
                }";
                win = new Window (res);
                //$.writeln( win.info.name.e.text);
                $.writeln( win.buttons.okBtn.text);
                $.writeln( win.buttons.okBtn.properties.name.text);
                 // add the button's event handler, which navigates to the log in form
                win.buttons.testBtn.onClick = function(){
                    alert('here');
                }
            win.buttons.okBtn.onClick = function(){
                win.close(0);
                    alert('here2');
                }
             win.center();
            win.show();
            }
    };
    buildNavbar(app.documents[0]);
    
  • Problem OnClick Javascript WebHelp

    Hello

    I wanted to include a return e-mail link in my webhelp file.

    So, in my Master Page I added the following link in the heading of the page:

    < a href = "Send feedback" onClick = "parent.location ='mailto: " [email protected] ? Subject = blah blah ' "> < / a > "

    It works very well. The link is displayed on all pages, and when I click on an email is generated. Problem is after that I click on the link of webhelp, the right of the image page, that is the subject I see is updated and he says: "Internet Explorer cannot display the webpage".

    Any ideas how can I fix?

    Thank you

    Try this script.

    http://www.Grainge.org/pages/snippets/mailto.htm

    I'm not sure it will work from a master page, but it works in the body.

    See www.grainge.org for creating tips and RoboHelp

    @petergrainge

  • Dynamically add checkboxes: problem w / .onClick)

    I working on a script that detects a folder in my project, named "compsRENDER" and then creates the checkboxes for each model and sets the text for the name of comp - that works. I do not know how to handle the. onClick() so that each checkbox element represents precisely the corresponding model. If I click on the checkbox: "comp1" it will send "comp1" in the renderQueue, for example.

    Comps: "comp1", "comp2", "comp3',"comp4", etc...

    Checkboxes: "comp1", "comp2", "comp3',"comp4", etc...

    The script below works currently as follows: is all the comps in the compsRENDER folder, adds checkboxes with each name of comps. When I click on a square, it refers to the last model instead of the corresponding model - I guess because of the loop that adds checkboxes.

    #include "/ GFXM1/Script_Workflows/commonFunctions.jsx".

    myWindow = new window ("palette", "my window name', undefined, {resizable: true}");

    checkboxPanel = myWindow.add ('panel');

    var compNamesArray = new Array();

    var renderFolder = locateProjItems (FolderItem, "compsRENDER");  Use CompItem to comps

    Create check boxes

    for (i = 0; i < renderFolder.numItems; i ++) {}

    var currentCheckbox = checkboxPanel.add ('checkbox');

    currentCheckbox.text = renderFolder.items [i + 1] .name;

    currentCheckbox.onClick = function() {sendCompToRQ (currentCheckbox.text) ;}

    }

    function sendCompToRQ (checkboxName) {}

    Alert (checkboxName);

    for (c = 0; c < renderFolder.numItems; c ++) {}

    If (checkboxName is {renderFolder.items [c + 1] .name})

    app.project.renderQueue.items.add(renderFolder.items[c+1]);  ADD: Model RQ

    }

    }

    }

    myWindow.show ();

    I thought about it.

    currentCheckbox.addEventListenter ('click', function (event) {sendCompToRQ (event.currentTarget.text) ;})

  • problem with the onclick toolbar do not work

    Hi, I can not do this control works very well. I can see the toolbar, but I can't make a click and the event do not work. Thank you.

      ToolbarManager tbManager = new ToolbarManager(Field.USE_ALL_WIDTH);
    
                StringProvider spTest = new StringProvider("Test button");
                Image myImage = ImageFactory.createImage(barraTXON);
                ToolbarButtonField tbbTest = new ToolbarButtonField(myImage,spTest);
    
                  tbbTest.setCommand(new Command(new CommandHandler(){
                    public void execute(ReadOnlyCommandMetadata metadata, Object context)
                     {
                         Dialog.inform("Toolbar button clicked");
                     }
                }));
    
                tbManager.add(tbbTest);
    
                StringProvider spTest2 = new StringProvider("Test button2");
                Image myImage2 = ImageFactory.createImage(barraPAON);
                ToolbarButtonField tbbTest2 = new ToolbarButtonField(myImage2,spTest2);
                  tbbTest2.setCommand(new Command(new CommandHandler(){
                    public void execute(ReadOnlyCommandMetadata metadata, Object context)
                     {
                         Dialog.inform("Toolbar button clicked");
                     }
                }));
    
                tbManager.add(tbbTest2);
                if (tbbTest.isFocus()){
                    Dialog.inform("Toolbar button clicked1-");
                }
    
                if (tbbTest2.isFocus()){
                    Dialog.inform("Toolbar button clicked2-");
                }
    
                //with the line below - no action is displayed when clicking on the button
                setStatus(tbManager);
    
        }
    

    I have to use a panel of buttons.

    HorizontalFieldManager buttonPanel = new HorizontalFieldManager(Field.FIELD_TOP | Field.USE_ALL_WIDTH);
    
          //  Background background = BackgroundFactory.createBitmapBackground(barraTXON);
            buttonTX = new CustomButtonImage(barraTXOFF,barraTXON,barraTXOFF);
            buttonPanel.add(buttonTX);
    
  • After the recent Firefox updates prevent links to several websites to operate while it doesn't have this problem with other browsers - help please.

    Since a recent update of Firefox links to several Web sites is no longer working. They used to be fine and I liked Firefox. The problems do not exist with other browsers such as Internet Explorer, Google Chrome. Specifically, on talktalk.co.uk news links do not work, any more than those in 'my account '. On Barclays.co.uk the link to print my statement works no-same on MBNA.com
    There are several solutions proposed around the internet, but all are complex, so far none have worked and I don't see why I should have to make the suggested adjustments. Firefox has been great - now, it is not. The problem seems to be the update. Please help me get my Firefox where it should be.

    AFAICT then who are perfectly normal links on the news page

    The http://www.talktalk.co.uk/ opens if I click the guide Link TV/news on the https://sales.talktalk.co.uk/ page.

    If I right click on a link and use inspect element to open the Inspector then I see that there is an event onclick on the links (annex 'ev' button), so make sure that you are not blocking JavaScript.

    Start the computer in safe mode Windows with network support (on the startup screen, press F8) as a test to see if that helps.

  • Why the story to does not work on onclick in Firefox?

    Why doesn't javascript:history.back() not working on onclick in Firefox? All the form fields are empty if recaptcha filled with evil and the page is reloaded. This works fine on chrome, but not Firefox. Please suggest how we can solve this problem. Make it work like chrome charge back that all fields should not be empty.

    The server sends "no-store" with the page, while Firefox does not store the form once you leave the page. (See attached screenshot).

  • OnClick works not

    I was hoping that someone could tell me why the onclick for the works of blue button 'Try a free search' (allows the clicks) on www.theatrebuddies.co.za using the left button of the mouse... STILL on www.theatrebuddies.co.uk the left button of the mouse does not work and does that using the central button of the mouse... In ADDITION, it will open in a new tab. It's really strange for me.

    The main reason I'm using onclick is for the implementation of Google Analytics.

    I just spent hours and hours of coding of hundreds of onclick variable only discover this confusion why it works on the. co.za site but not the other. Is this a Firefox problem?

    You have the following in your ZA but not your UK:

    _gaq.push(['_setAllowLinker', true]);
    

    Isn't it? Would be an easy fix...

  • automatic redirection problem 9.3 IOS

    I'm almost in tears at the moment that my Apple products are practically unusable - I even had to resurrect my faithful laptop windows in order to access the Apple support. We have pro iPad and iPhone 6 s, 6th Gen iPod, iPad Air II and since upgrading to ios 9.3 navigation or by clicking on the links on any device with java script enabled because of the problems. With all the loading links active js, but at the last second auto redirects through a series of ad sites onclick (up to 12 redirects in some cases, sometimes only half that much). Each series of redirects is found in an amazing where I won a new product from apple or £ 1000 to spend in Ladbrooks or trying to take me to the App store. Some end on a popup where the only option is to click to access a site that cannot be left or to force close the application/browser and try again.

    After reading the forums, I tried the following (several times and their many variants):

    Updated to ios 9.3.1 (thought what made the case but 5 minutes in and everything happened in shape yet pear).

    Reset the browser history

    Reset the network settings (wish I had not done this - network customer support left 6 settings)

    Forced shutdown of all applications

    Forced shutdown of devices

    NOTHING (except the js that is not really a solution to this problem by disabling) stopped the automatic redirects - they happen links in emails, messages, applications, Web pages, directly from search results, Safari app, Google app, and all the other applications that load external Web pages.

    I now have a house full of devices that are almost unusable - js is used in almost all websites. Cannot even log on this forum of support without him, so back to the computer windows laptop.

    Eager and willing to try almost anything to solve this - my frustration level is ridiculously high - for someone who works in THIS medium that is a pretty damning level!

    Hope someone can help me here. Thank you.

    We have pro iPad and iPhone 6s, iPod 6th Gen, iPad Air II and since upgrading to ios 9.3

    You work in computer support and that you updated all devices at the same time?  I know that ios is stalking update you to upgrade but a device, then wait a few days.  Latest versions of ios were buggie.

    Have you tried another browser?

    Change your dns to

    8.8.8.8

    8.8.4.4

    Here's the google dns servers.  Does not hurt.

    Have you tried to cope and paste address web browser?

    Too bad apple doesn't let you downgrade.

  • Silverlight / Web site problems?

    I upgraded to OME 2.1.0.265 and have updated my Silverlight (v5), but it seems that Silverlight gives me a horrible time.  When you add a range with WSMAN to add a new range of discovery, I can't use the Finish button

    I tried the Web page in several browsers, Chrome/Firefox.  I tried IE8 and IE11 as well.

    If I just add a range to and use SNMP it will add.  But as soon as I use WS - MAN the Finish button depresses but does not remove the configuration screen, therefore, the beach is never added.  I must just add SNMP and finishing and the go back and change the configuration.  I still see an error on the page in Internet Explorer.  I have to click on the top right X to exit the screen.

    Anyone experience this problem?

    (Error on page pasted below)

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729 .NET CLR 3.0.30729; NET4.0C;. NET4.0E)
    Timestamp: Thursday, December 10, 2015 19:35:07 UTC

    Message: Error unhandled in a Silverlight Application [Arg_NullReferenceException]
    Arguments:
    Debugging resource strings are not available. Often the key and arguments provide enough information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.41105.00&File=mscorlib.dll&Key=Arg_NullReferenceException in SmartConsole.Wizard.Discovery.DiscoveryWizard.PersistData)
    at SmartConsole.Wizard.WizardFooter.OKButton_Click (Object sender, RoutedEventArgs e)
    at System.Windows.Controls.Primitives.ButtonBase.OnClick)
    at System.Windows.Controls.Button.OnClick)
    to System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp (MouseButtonEventArgs e)
    at System.Windows.Controls.Control.OnMouseLeftButtonUp (control ctrl, ByVal e As EventArgs)
    to the millisecond. Internal.JoltHelper.FireEvent (IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, string eventName, UInt32 flags)
    Line: 1
    Char: 1
    Code: 0
    URI: https://wma-dell-admin.nbcorp.newsbank.com:2607/Web/Default.aspx

    Message: Error unhandled in a Silverlight Application [Arg_NullReferenceException]
    Arguments:
    Debugging resource strings are not available. Often the key and arguments provide enough information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.41105.00&File=mscorlib.dll&Key=Arg_NullReferenceException in SmartConsole.Wizard.Discovery.DiscoveryWizard.PersistData)
    at SmartConsole.Wizard.WizardFooter.OKButton_Click (Object sender, RoutedEventArgs e)
    at System.Windows.Controls.Primitives.ButtonBase.OnClick)
    at System.Windows.Controls.Button.OnClick)
    to System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp (MouseButtonEventArgs e)
    at System.Windows.Controls.Control.OnMouseLeftButtonUp (control ctrl, ByVal e As EventArgs)
    to the millisecond. Internal.JoltHelper.FireEvent (IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, string eventName, UInt32 flags)
    Line: 1
    Char: 1
    Code: 0
    URI: https://wma-dell-admin.nbcorp.newsbank.com:2607/Web/Default.aspx

    Message: Error unhandled in a Silverlight Application [Arg_NullReferenceException]
    Arguments:
    Debugging resource strings are not available. Often the key and arguments provide enough information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.41105.00&File=mscorlib.dll&Key=Arg_NullReferenceException in SmartConsole.Wizard.Discovery.DiscoveryWizard.PersistData)
    at SmartConsole.Wizard.WizardFooter.OKButton_Click (Object sender, RoutedEventArgs e)
    at System.Windows.Controls.Primitives.ButtonBase.OnClick)
    at System.Windows.Controls.Button.OnClick)
    to System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp (MouseButtonEventArgs e)
    at System.Windows.Controls.Control.OnMouseLeftButtonUp (control ctrl, ByVal e As EventArgs)
    to the millisecond. Internal.JoltHelper.FireEvent (IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, string eventName, UInt32 flags)
    Line: 1
    Char: 1
    Code: 0
    URI: https://wma-dell-admin.nbcorp.newsbank.com:2607/Web/Default.aspx

    Hi PCSEMA,

    Thanks for the details in your message.

    I will propose to check one thing here:

    -Go to settings-> discovery settings and check what "Assistant Configuration of discovery" is selected. It's "Assistant Standard"?

    If so, can you try to "Guided Wizard" and the addition of the new range of discovery works with guided Assistant?

    Thank you
    Vijay

  • ActionBar / bbUI.js - event onclick in the Menu tab overflow of unmarked tab

    Hello

    I use the collection of great bbUI.js for my application.

    Thanks to the team of developer for such things.

    Is it possible to trigger an onclick event to a tab that is not marked as action of overflow in the tab overflow Menu or to hide the tabs not spotted in the overflow Menu?

    Currently the tabs not spotted inside the overflow Menu is any cause at the end of the onclick event missing.

    I hope that someone has ideas for my problem.

    Thanks for the tips!

    Moritz

    Thanks for the tip.

    I opened a new show.

    The link for those interested:

    https://github.com/BlackBerry/bbUI.js/issues/259

  • BUG: OS6 / JavaScript 'onclick' event when pulling ball control to help

    Hello

    I'm developing a web application targeting OS6 devices (torch and no key, for example Curve 9300). The problem is that an 'onclick' event does not fire when you use a Trackball to click on the object (torch and Curve 9300).

    It seems to be a bug (browser) OS6 as an "onmouseover" works without problem.

    ......
    
    var submitButton = document.getElementById('submit-button');submitButton.onclick = testOnClick;
    
    function testOnClick() {    alert('onclick never gets triggered by trackball, but when you touch the button it does!');}
    

    This causes a problem deploying the application to a mixed environment of OS6 devices.

    Someone else has a similar problem, or miss me something?

    Thank you

    Hi Sasha,

    I tried the code on the following simulators below:

    Torch 9800: 6.0.0.227, 6.0.0.246, 6.0.0.337

    Style 9670: 6.0.0.309

    NOTE: I couldn't find a simulator of 9300 with 6.0

    This code, everything seems to work properly on those built using the trackpad to move the pointer over the button and click it.

    Are maybe run you document.getElementById () in a script page that is not related to a document loaded event online?  I wonder if the purpose of the document is not yet loaded until you take a reference to it?

    
    
        
            
            Untitled Page
            
        
        
            
        
    
    
  • Box problems

    I have problems to call the function c ++ for the
    OnCheckedchanged {}
    Whenever I call a function,
    Example: _app.sum (...)
    the console says: could not find the application variable

    But I am able to use the same function in buttons with {onClicked}
    Sum function is defined as ApplicationUI::sum (QString) voi...

    Oh! Lol, I just responded to someone on WhatsApp who asked the exact same question, I would copy and paste of my response.

    You should treat your listItem, as if she lives in a different world and all they know is their parent (ListView). So, if you want to use the Q_PROPERTY foo in bar class that you have setContextProperty() with the name _bar, you can't use _bar.foo
    Instead, create a property in your ListView that point to it, like this:
    property variant foo: _bar.foo

    And in your listItem, use this:
    Title: mainItemName.ListItem.view.foo

    (mainItemName is the ID that you will give to your content in your ListItemComponent, it's usually a StandardListItem or a container)

    You can see an example in this code:
    https://github.com/RodgerLeblanc/tutorial/BLOB/master/assets/tutorial/TutorialSheet.QML

  • Prevent the onClicked if the context menu is open

    I added a context menu to a button.  The problem is that the buttons still gets clicked even if the context menu is opened.  As my button opens a new page, it would be confusing.

    How can I prevent the button is enabled when the context menu is visible?

    Thank you

    The simplest way is to set a Boolean flag in the crack of visualStateChanged() which is read by your location of onClicked() of buttons and acted accordingly...

    http://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__contextmenuhandler.html#func...

    It said that change the default action for a button that invokes a context Menu is a UI change that will confuse a user and you're better stick to the UI guidelines.

    How did the user knows to long press your button?

  • Problem with MenuDefinition and sheet

    I'm having a problem with the Menu and leaves, if I use the Menu to open the sheet of more than twice the leaf is not open and the Menu do not reappear. If I use the button on the page, it works as expected.

    import bb.cascades 1.0
    
    Page {
        Menu.definition: MenuDefinition {
            settingsAction: SettingsActionItem {
                onTriggered : {
                    settingsSheet.open();
                }
            }
        }
        attachedObjects: [
            Sheet {
                id: settingsSheet
                content: Page {
                    Button {
                        text: "Close"
                        onClicked: {
                            settingsSheet.close()
                        }
                    }
                }
            }
        ]
    
        Container {
            layout: DockLayout {}
            Button {
                text: qsTr("Open")
                onClicked: settingsSheet.open();
    
            }
        }
    }
    

    To hear that it is a known problem that was corrected in the next update, I have also just heard is expected by Friday-ish (a firmware of the device and an SDK Update).

Maybe you are looking for