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
Highlighted
Developer
Posts: 114
Registered: ‎11-19-2008
My Device: Not Specified
Accepted Solution

TextInputProperties.onSubmitted no longer works on OS 10.2

I ran into a strange problem as code in one of my apps stopped working on OS 10.2 but works without a problem on OS 10.0 and 10.1. I am simply trying to catch when the user hits ENTER in a TextField:

 

    TextField {
        id: myTextField
        horizontalAlignment: HorizontalAlignment.Left 
        verticalAlignment: VerticalAlignment.Center
        input {
            submitKey: SubmitKey.Default
            
            onSubmitted: {
                //code here....
            }
            
            flags: TextInputFlag.AutoCapitalization 
        }
    }

 For some strange reason this piece of code stopped working on OS 10.2 (Z30) and onSubmitted never gets fired. Anyone have an idea why this could be happening?

 

Interestingly, changing to

 

submitKey: SubmitKey.DONE

 makes onSumbitted get fired again. Ideally I would like to keep the default virtual keyboard look if possible and don't overwrite it with "DONE" just to make things to work.

BlackBerry Development Advisor
Posts: 252
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: TextInputProperties.onSubmitted no longer works on OS 10.2

[ Edited ]

Hi bbdevguy,

 

Starting 10.2, the onSubmitted signal only fires when the submit key of the text control is set to "Submit" or obviously "Done". Before the 10.2 release, the "onSubmitted" signal would also fired on a regular "Enter" (the default), but it is designed not to fire anymore on default, i.e. that's not a bug.

 

For that you need to chance the submitKey property line to SubmitKey.Submit

 

submitKey: SubmitKey.Submit

 

 

@SamarAbdelsayed

Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Developer
Posts: 114
Registered: ‎11-19-2008
My Device: Not Specified

Re: TextInputProperties.onSubmitted no longer works on OS 10.2

Thanks for the clarification, Samar!