We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Cannot set ReturnType and ReturnCommand

Thread ID:

Created:

Updated:

Platform:

Replies:

141990 Jan 14,2019 08:29 AM UTC Jan 21,2019 11:42 AM UTC Xamarin.Forms 5
loading
Tags: SfMaskedEdit
armin rasoulian
Asked On January 14, 2019 08:31 AM UTC

I have a login page with a SfMaskedEdit to get user's phone number and a switch for KeepMeLoggedIn and a login button bellow it.
When the user focuses on SfMaskedEdit on android platform, soft keyboard opens with next button as action key.
If user press the next button on keyboard my app crashes with the following error.

"java.lang.IllegalStateException: focus search returned a view that wasn't able to take focus!"

I looked at the properties of SfMaskedEdit and did not find ReturnType and ReturnCommand properties.
 How can I fix this problem?

Dhanasekar R [Syncfusion]
Replied On January 17, 2019 01:09 PM UTC

Hi Armin, 
 
Greetings from Syncfusion. 
 
We can change the Keyboard of SfMaskEdit with Done button by using custom renderer as mentioned below. 
 
 protected override void OnElementChanged(ElementChangedEventArgs<SfMaskedEdit> e)
        {
            base.OnElementChanged(e);
            Control.ImeOptions = Android.Views.InputMethods.ImeAction.Done;
        }    
 
We have prepared a sample for the same, please download it from the link given below. 
 
Sample linkSfMaskEditSample 
 
Regards, 
Dhanasekar 


armin rasoulian
Replied On January 19, 2019 07:17 AM UTC

Thank you for your help.
But it is much more better if we can set this through SfMaskedEdit control in our XAML file. Just as we do in the Xamarin.Forms Entry.

Thank you so much.

Christian
Replied On January 20, 2019 09:25 AM UTC

Hi, the example has not the event handler named OnElementChanged...

Dhanasekar R [Syncfusion]
Replied On January 21, 2019 11:38 AM UTC

Hi Christian, 
 
The override OnElementChanged code has been included on the CustomRenderer.cs file under MaskEdit.Android project. 
 
File location from the provided project: 
 
 //..../MaskedEdit/MaskedEdit.Android/CustomRenderer.cs 
 
Regards, 
Dhanasekar 


Dhanasekar R [Syncfusion]
Replied On January 21, 2019 11:42 AM UTC

Hi Armin, 
 
Thanks for the update.  
 
We are considering your request “Customize SfMaskedEdit keyboard in XAML as like Entry” and this will be included in any one of our upcoming volume releases. 
 
Regards, 
Dhanasekar 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon