How can we change the visibility of the drop-down list after its creation?

I create a QML document with three drop-down lists.  Depending on how "trans_type" is selected, only to drop Extra should be displayed.  If the option "account" is selected, the drop-down list is visible and the DD category is hidden.  The reverse is true if the 'category' option is selected.

Here's how I build my QML document:

void Testing::updateFields()
{
    if (m_form.isNull())
        return;

    // Clear all fields from the form
    m_form->removeAll();

    // Clear the internal mapping
    m_fields.clear();

    //get the transaction page ready
    QmlDocument *qml = QmlDocument::create("asset:///transaction.qml").parent(this);

    DropDown* trans_type = qml->createRootObject();
    trans_type = DropDown::create().title("Transaction Type");
    trans_type->add(Option::create().text("Accounts").value("0"));
    trans_type->add(Option::create().text("Categories").value("1"));
    trans_type->setSelectedIndex(0);
    connect(trans_type, SIGNAL(selectedIndexChanged (int)), this, SLOT(onDDChange(int)));
    m_form->add(trans_type);

    DropDown* account_dd = qml->createRootObject();
    account_dd = DropDown::create().title("Account");
    account_dd->add(Option::create().text("No Account").value("0"));
    //... code to populate account drop down here...
    account_dd->setSelectedIndex(0);
    m_form->add(account_dd);

    DropDown* category_dd = qml->createRootObject();
    category_dd = DropDown::create().title("Category").visible(false);
    category_dd->add(Option::create().text("No Category").value("0"));
    //... code to populate category drop down here...
    category_dd->setSelectedIndex(0);
    m_form->add(category_dd);

}

Everything is displayed properly on the page.  onDDChange is called and it shows a Toast that the option has been selected.  Here is what I currently have in onDDChange:

void Testing::onDDChange(const int &info)
{
    QString msg = "Switched To: ";
    if(info == 0) {
        msg = msg + "Account";
    } else if(info==1) {
        msg = msg + "Category";
    } else {
        msg = msg + "Unrecognized";
    }
    showToast(msg);
}

I can't figure out how to get the drop down lists to be visible/hidden depending on the needs.  There is a function "setVisible()" for the drop, but I can not understand how to operate without the app crashing.  http://developer.BlackBerry.com/Cascades/reference/bb__cascades__dropdown.html#function-setVisible-v...

My questions are:

1. How can I change the visibility of the appropriate dropdown lists in a different function when the status of the main drop-down list is changed?

2. is there a way to define an id for drop-down lists?  If not, how am I supposed to go into the drop-down lists in a variable later so I can receive their value or change the visibility?

Any help would be great.  I've been struggling with this for a while.

There are a number of methods you could use signals and slots between your code and the QML or something simple is assign "objectName" as a property, then this search in C++.

http://developer.BlackBerry.com/Cascades/documentation/dev/integrating_cpp_qml/

Something like

DropBox db = mRootContainer->findChild("dropboxname");
db->setVisible(true);

Tags: BlackBerry Developers

Similar Questions

  • How can I clear the drop-down list in the user credentials dialog box in windows XP?

    I deleted a .net passport account by using the network password manage
    I have cleare IE cache and everything related to passwords
    But when I opened a credential information, such the connection to Outlook dialog box, in the drop-down list I see still some old user names, none of them is not in the list of Auditors .net.
    How can I delete all the entries in the drop-down list?

    Hi PiterAsquini,

    You can review the article and check if that helps:

    How to handle the names of stored user and passwords on a computer that is not in a domain in Windows XP

  • How can I change the default topics listed in Windows Explorer?

    When I look at the files in Windows Explorer there are positions that I find little use for me. I would like to change the default headings listed to display only those that I use most often as update, size, Type and Date of creation. How can I change the default settings for securities so that these topics, such as tags and side are not displayed?

    To change the headers, right-click on the header bar, and click more.  You will see a list of options to be included in the header, and you can place about to adapt to your desires.  But they will not stick unless you modify the template for this type of file.  Procedures for this follow-up.

    Here's how to change the default template for a folder: http://www.vistax64.com/tutorials/70819-windows-explorer-folder-view-settings.html.  Default behavior is to select the model based on the first type of file placed in the folder (you must choose something).  Vista sets the folder type template according to what are the types of files in the window and the settings display window Explorer. This will show you how reset the display settings of Windows Explorer folder (which is what I think you want), disable Automatic folder Type discoveryand increase the view of the folder cache to have Vista don't forget not the display, model of file type settings, the size or the position of a window for when it was still closed to the location of specific path.

    It does not work with the Sub record under, Open with, open in a new tab (Internet Explorer), etc... dialog windows of type through the good File menu bar item. These don't seem to be able to have their size or their position to recall. For the latter, you can use the free program http://autosizer.en.softonic.com/ to resize them.

    Here is another article on how to modify the columns in Windows Explorer and sort in Vista: http://www.vistax64.com/tutorials/108665-column-customize.html.  This will show you how Add, Remove, move, change the widthand change the sort order of the columns in Windows Explorer in the way that you want.

    Here is another article on how to change the display of the default folders in Vista (but she argues, it is not a perfect solution and can revert to the previous behavior is not as good as the two prior links provided: http://news.cnet.com/8301-13880_3-10019957-68.html.)

    I hope this helps in your situation.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How can I right - justify text in a drop-down list field in Acrobat 11?

    I have a literal that we want to include as a prefix in front of a field of account number.  Users wanted an option to use a No.:o account r
    Account number:, so I was going to justify the choices in the right drop-down selections but I do not see where to change the alignment propterty.  I used spaces before the non-literal account, but it would be better if I could right - justify the selections in the drop-down list box.

    Please let me know if there is a way to do it.

    Thank you!!!

    What exact version number? Look under help - about Adobe Acrobat.

    I also use Pro XI and that's what I see:

    I just thought of something, you should try... Look under Edit - Preferences - language and make sure that "Enable right-to-left language options" is checked. Maybe cause this option to appear.

  • How can I get the drop down tool to show options menu?

    Can anyone help.  I am using the adjustment tool, but when I click it, the drop down options do not appear.

    It's the same for all options on this line (my crop button does not show me options to block certain size etc.)

    What I support on so he can show.

    It is cc in lightroom

    This small black triangle is a toggle that expands / contracts an adjustment Panel.

    Try and then click on it.

  • Change the drop-down list of AutoComplete for kind of metadata in music files

    How can I get rid of the entries, unwanted metadata AutoComplete drop-down list boxes in my windows music files.  Specifically in the list of genres.  It seems that everything I never typed in the field of the type is in the list.  The list is very long and includes the wrong spelling, genres, I wish not to use, etc.).  The unwanted entries do not seem to go away if I do not use them.  Is anyway to fix this?

    In case you didn't see my answer below, I'm post it here as well.

    I had the same problem and finally found an answer with the registry editor.  It is explained here:

    Run regedit, and then select HKEY_CURRENT_USER-> software-> Microsoft-> Mediaplayer-> AutoComplete.  You will find lists of AutoComplete items and just delete the ones you don't want to have there.
    I hope this helps!
    Mike
  • My list of selection includes values that are long enough. Can I do the drop-down list "wrap text" so that it is not on one line?

    According to the title. My drop-down list offers entire sentences, which sometimes extend over the entire page that I don't like. Can I do extend over several lines instead?

    Daniel Jakes wrote:

    According to the title. My drop-down list offers entire sentences, which sometimes extend over the entire page that I don't like. Can I do extend over several lines instead?

    Lol this is not possible in the standard selection lists. The element plugin Select2 can support this, but this looks like a redesign of the interface user is really necessary. Radio buttons or check boxes are a better choice to make selections of the options with long descriptions. Redesign/reformulation of the interface would be the best approach. What are these options? Why are they used?

  • How can I change the default numbered list formatting?

    I started a new project HR 10 and every time I turn a paragraph in a numbered list by clicking the numbering on the toolbar button, the font is changed to Arial. I need it to match my Normal style.

    In all other HR projects if I click the numbering button, it creates the list but does not change the rest of the formatting. What is going on?

    I looked in help, but he tells me that I need to define a new style etc etc. I've never done this before so am rather confused.

    Is it possible to change the formatting of a list numbered according to my Normal style so I can just click the toolbar button to convert a paragraph in list?

    It is probably because the body tag is set to Arial.

    Normal is equivalent to a p tag, while lists are ul/ol/li tags and will inherit the police body, unless configured otherwise.

    If you have two options for editing the style sheet in the editor of HR (double-click on the style sheet):

    1. You might change others > lists to your fonts.
    2. You might change others > background + text (BODY) to your fonts. With this option, all your text should use this font, unless you set a different font for a specific style (for example, the headings).

    If you change the background + text (BODY), you could edit your style sheet in a text editor and remove the entry from the family of police for the p tag, but it depends on how comfortable you are with css.

  • How can I activate the drop down bookmarks menu?

    I've just updated to version 19.0.2 (I don't know which version I had before) but the favorite icon does not have the little arrow on it and there is no drop-down underneath (on the right side of the screen) when I click on it; the entire sidebar is opening on the left side. How can I get directly the menu drop-down back?

    If you don't see an item on a toolbar and in the toolbar palette, then click on the "Restore default" button to restore the default toolbar set up.

    You can check for problems with the file localstore.rdf.

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance).

    • Do NOT click on the reset button on the start safe mode window or make changes.
  • How can I customize the drop-down menu that appears when I right-click on an image to save him?

    When I right-click on an image that I order to save on the web on my computer, the menu drop-down is displayed. And there, the topic "save image under" will this stupid "image send by e-mail! When I right click too, sometimess I miss and choose the "send image...". "and then another stupid email"send letter"appears. Hell, I hate! Please help me to remove (or hide permanently) this option "send image...". "in this menu the menu drop down.
    Because if I ever want to send any image by e-mail, I'll do it myself and I don't need FireFox to help me with this!
    Thanks much adavance! (My version of FireFox - 18.0.1)

    You can use this extension to change the menu.

    You can find this code in the file userChrome.css below default @namespace.

    Customization files (interface) userChrome.css and userContent.css (Web sites) are located in the chrome folder in the user profile folder.

    @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    
    #context-sendimage,
    #context-sendvideo,
    #context-sendaudio { display:none!important; }
  • Re: Satellite A50 - how can I change the boot with BIOS password priority?

    I have a Satellite A50. I need to restore to factory default to recover DVD, how do I boot from the DVD?

    The default boot priority is the HARD drive and is more bootable has been formatted. My BIOS is password protected, how can I change the boot priority? After having inserted the password, its always boot from the HARD drive.

    Thank you

    The boot priority, that you can change in the BIOS.
    Go into the BIOS with ESC, enter your password and then you can change it.
    But don t forget to save the changes.

    That s all and then you can boot from the CD.

  • How can I get an address of record is displayed in the drop-down list the address Windows 7 bar.

    I am referring to what used to be called 'Windows explorer '. No IE. The address at the top of a folder window bar has a drop down menu that accumulates the addresses of record for quick navigation.  I frequently navigate to a particular folder, but it is never appear on the drop-down list. How to appear on the drop-down list?

    Nothing in the link answers the question, but I thought about it.  If you copy and paste a folder address in the address bar, it will be added to the drop-down list.

  • Change the drop down CTRL D

    Is there a way to change the drop-down list that appears when you enter CTRL D? I would like to see 10 to 15 lines rather than 5

    Try this extension of the functionality.
    https://addons.Mozilla.org/en-us/Firefox/addon/add-bookmark-here-2/
    The third screenshot shows how to drag the folder listing down to enlarge.

  • Change the content of the drop-down list

    Hello

    Is it possible to change the content of a drop-down list after its done?

    I have a dialog box, and based on user input, the drop-down list should change

    I saw the opportunity to add to a drop-down list, but I did see the possibility of changing the entire list

    Is this possible?

    Thank you

    Davey

    #targetengine test
    var w = new Window ('palette'),
        d1 = w.add('dropdownlist', undefined, [1,2,3,4,5]),
        b1 = w.add('button', undefined, "Slow Refresh"),
        b2 = w.add('button', undefined, "Fast Refresh"),
        myNewItems = [6,7,8,9,10];
    
    b2.onClick = function () {refreshList (myNewItems)};
    b2.onClick = function () {refreshList2 (myNewItems)};
    d1.onChange = function () {alert(d1.selection)};
    function refreshList (newItems) {
        var l = d1.items.length,
            c;
        while (l--) d1.remove(d1.children[l]);
        l = newItems.length, c;
        for (c = 0; c < l; c++) d1.add('item', newItems[c]);
    }
    
    function refreshList2 (newItems) {
        tempDropdownlist = w.add('dropdownlist', d1.bounds, newItems);
        tempDropdownlist.onChange = d1.onChange; // etc.
        w.remove (d1);
        d1 = tempDropdownlist;
    }
    w.show();
    

    Trevor

  • Validation in the drop-down list box

    Hello

    I use JDev 11.1 with fusion ADF

    I have the drop-down list box, this drop-down list box include a description and the value I want to if the user choose value e.g. - 2 and press the button Save appear validation said cannot insert this value, how can I do?

    Note that this drop-down list box to retrieve data from managed bean (not the view object)

    Concerning

    Hello

    You add a validator to your combobox component.

    Select your component in the property inspector-> Behaivour-> Validator-Edit... and create a method, and then you add the validation code it.

    More details on custom validators: http://database.in2p3.fr/doc/oracle/Oracle_Application_Server_10_Release_3/web.1013/b25947/web_val004.htm#CIHFJBDI

    Greetings,
    Bogdan

Maybe you are looking for

  • OMEN of HP 15-5220nr

    Anyone know if the OMEN HP 15-5220nr can support two monitors external, one with the HDMI and the other with the port of 'mini display'?

  • The MX870 printer paper jam?

    I have a paper get stuck in my printer, but cannot figure out how to open the back to find. Can anyone help?

  • I need help, bandwidth management

    To our offices there are two that IT guys me and Jay. I use a desktop PC and Jay use a laptop. We have a T3 line connected to a Linksys WRV210, which is updated to the latest firmware and a small staff with about 8 total workstations. I started notic

  • No output device and no sound card in Device Manager

    Hello I installed today on my Acer 7520 G laptop Windows7, I was pretty happy with it much but I have 1 problem. The arrival of the installation I had sound, but after windows updated itself the next time I got this done installed peripheral No. outp

  • Mixer volume + USB wireless headset Bug

    It's my first post My name is Chris and my computer (Asus U56E-BAL7) had problems with Windows 7 64 bit operating system. When I click on my Volume Mixer and click to change my volume, it does not. When this happens, Skype also seems to have its own