Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
Posts: 104
Registered: ‎09-25-2013
My Device: BB 10
My Carrier: BB 10
Accepted Solution

Drop down alignment in BB 10 cascades

Here i am facing one problem,I need to change the Drop down option to align right.

now i am pushing the value like...

 

foreach (int key, map.keys()){
if(position ==1 && key >1000) {
    Option* option = Option::create();
    option->setText(map[key]);
    option->setValue(key);
    dropDown1->add(option);
    //dropDown1->setHorizontalAlignment(HorizontalAlignment::Right);
}else
    if(position ==2 && key < 1000) {
        Option* option = Option::create();
        option->setText(map[key]);
        option->setValue(key);
        dropDown1->add(option);
    }
}

 and my qml is like

 

 DropDown {
                   // title: "Select Symbol"
                    objectName: "myDropDown"
                    enabled: true

                    layoutProperties: StackLayoutProperties {
                        spaceQuota: 3.0
                    }

                    onSelectedOptionChanged: {
                    _addOrDelRef.getDropDownValue(selectedOption.value);
                        //labelOption.text= selectedOption.text;
                    }

 

if key is below 1000 align left otherwise align right.How to do that in bb 10 cascades...

Please help, Thanks...

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Drop down alignment in BB 10 cascades

[ Edited ]

Mixing alignment in dropdowns is not something I've tried.

 

Are you having trouble aligning the text right or working out how to do it at key 1000?


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Drop down alignment in BB 10 cascades

For the alignment I did a quick test and I don't think is possible the format of the option is pretty fixed.

I would suggest doing your own CustomPicker.

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
New Developer
Posts: 104
Registered: ‎09-25-2013
My Device: BB 10
My Carrier: BB 10

Re: Drop down alignment in BB 10 cascades

Thanks for your reply, but i have observed the drop down is aligning to right when Language settings are changed to Arabic.How is that posible?

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Drop down alignment in BB 10 cascades

That's because the underlying QML object library is being switched when the language changes. In effect it is using a different QML template.
Sure you may be able to hack it where you dynamically change the language as you hit 1000 but I wouldn't like to guarantee there won't be any glitches as likely all of the items will change.

If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Drop down alignment in BB 10 cascades

You can think about it in the same way as the static asset selector works for our apps but instead of switching the objects used based on theme or screen sizes it switches them based on language/localisation.

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
New Developer
Posts: 104
Registered: ‎09-25-2013
My Device: BB 10
My Carrier: BB 10

Re: Drop down alignment in BB 10 cascades

can you please give me a small example / link while QML object library is being switched when the language changes...

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Drop down alignment in BB 10 cascades

This is encoded in the BB10 OS and not available to us.

 

The closest thing we developers have akin to this is the static asset selector...

 

http://developer.blackberry.com/native/documentation/cascades/best_practices/resolution/using_static...

 

Currently language and localisation are not included in this.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
New Developer
Posts: 104
Registered: ‎09-25-2013
My Device: BB 10
My Carrier: BB 10

Re: Drop down alignment in BB 10 cascades

Thanks Alot !!!

New Developer
Posts: 104
Registered: ‎09-25-2013
My Device: BB 10
My Carrier: BB 10

Re: Drop down alignment in BB 10 cascades

can you please post one example, how above Drop down code is converted into Custom piscker  through C++