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
Developer
d3v3l0p3r
Posts: 162
Registered: ‎07-19-2012
My Device: Q5, Q10, Z10, Z30, PlayBook
My Carrier: Carrier

Cannot use requestFocus anymore (in Gold)

I'm trying to set the focus of the TextField (field1)  as soon as the DropDown is expanded.

 

Page {
    Container {
        layout: StackLayout {}
        DropDown {
            onExpandedChanged: {
                field1.requestFocus();
            }
        }
        TextField {
            id: field1
        }
    }
}

 This worked just fine in beta 3 and beta 4 but all of suddenly started blowing up the app in Gold with the following:

 

 

Thread [1] (Suspended : Signal : SIGSEGV:smileyfrustrated:egmentation fault)
__cxxabiv1::__si_class_type_info::__do_dyncast() at 0xb9998df7
__cxxabiv1::__si_class_type_info::__do_dyncast() at 0xb9998e81
__cxxabiv1::__si_class_type_info::__do_dyncast() at 0xb9998e81
__cxxabiv1::__si_class_type_info::__do_dyncast() at 0xb9998e81
__cxxabiv1::__si_class_type_info::__do_dyncast() at 0xb9998e81
__cxxabiv1::__si_class_type_info::__do_dyncast() at 0xb9998e81
__dynamic_cast() at 0xb9996064
0xb9173a1d
0xb9173aad
0xb9173db6
<...more frames...>
 
 
According to gold release notes "This is expected behavior; text-related controls must be in the active UI tree to request focus."
 
So i assume this was not supposed to work in betas (but was working) and just got fixed now.
 
I'm trying to figure out now how I can set the input focus on the textField as soon as the dropDown is expanded.... 
---
If you find my post helpful please "like" it and "accept as a solution"
Please use plain text.
Developer
kylefowler
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: Cannot use requestFocus anymore (in Gold)

How would this work? If a dropdown is expanded then it has focus, and therefore would collapse when you set focus on the textfield right?

 

Do you not want the dropdown to expand?

Like all of my posts
Please use plain text.
Developer
d3v3l0p3r
Posts: 162
Registered: ‎07-19-2012
My Device: Q5, Q10, Z10, Z30, PlayBook
My Carrier: Carrier

Re: Cannot use requestFocus anymore (in Gold)

No, I am expecting the DropDown to collapse as soon as TextField gets the requestFcus which is how it worked up to Beta 4. It just crashed in Gold.

---
If you find my post helpful please "like" it and "accept as a solution"
Please use plain text.
Contributor
nico411
Posts: 34
Registered: ‎12-20-2010
My Device: DevAlpha Beta 2
My Carrier: Orange

Re: Cannot use requestFocus anymore (in Gold)

Hello,

 

Did you find a solution ? I'm facing the exact same problem ?

 

Thank you

Please use plain text.
Developer
d3v3l0p3r
Posts: 162
Registered: ‎07-19-2012
My Device: Q5, Q10, Z10, Z30, PlayBook
My Carrier: Carrier

Re: Cannot use requestFocus anymore (in Gold)

I submitted a bug request in jira and was told its a bug in gold and will be fixed in future releases. For now I left my app in bit of half working state as don't want to waste time redoing it all for a workaround.
---
If you find my post helpful please "like" it and "accept as a solution"
Please use plain text.