Interactive Ink

Android How to create a form with multiple text field such as mobile number, postal code & name on single editor view

I am able to create multiple configuration, although I am unable to configure my Text Document having specific configuration for each Content Block.


What should be the way forward to achieve it.


2 people have this question

Hi Irshad,

Currently, it is not possible to configure the blocks of a Text Document to each have different configurations.
To achieve what you are trying to do, you can either combine multiple editors inside your UI (if you have just a few fields) or you can have a pool of editors that you can properly configure and use depending on which "field" of your form is active.
With the latter approach, you may want to modify the UI Reference Implementation to have a shared InputController and dispatch the input to the right editor. You can also have your renderers all share the same render target (a single Android view), provided that each editor is configured with the appropriate margins when used for a particular field (so that the content is rendered at the right location in your view).

Best regards,
Thomas

 


1 person likes this

Thanks for input, currently I have created multiple Editors as well multiple engine (to have different configuration for fields eg: Name, Number or Date).

I was unable to make single Engine works with multiple editor with multiple configuration, since ContentPart only takes parameter as "Text" or "Math" whereas I need to specify type only as Text but part of configuration to be changed.

Can you help me how I can change on runtime between mutiple configuration for engine for the same Type (i.e "Text").

 

Bundle-Version: 1.0
Bundle-Name: en_US
Configuration-Script:
 AddResDir ../res_lang/

Name: name
Type: Text
Configuration-Script:
 AddResource en_US-ak-cur.res
 AddResource en_US-lk-text.res
 AddResource name_subset.res
 AddResource indian_name.res
 SetTextListSize 1
 SetWordListSize 3
 SetCharListSize 1

Name: number
Type: Text
Configuration-Script:
 AddResource en_US-ak-cur.res
 AddResource en_US-lk-text.res
 AddResource number_only.res
 SetTextListSize 1
 SetWordListSize 1
 SetCharListSize 1

 



1 person likes this

Hi Irshad,

As of today, configuration is only available at engine level. However, you can take benefit from the fact that "text.configuration.*" settings are taken into account when you call editor.setPart() to achieve what you want to do, rather than having multiple engines.

The following sequence should allow having a single engine and several editors with various configurations:

engine.getConfiguration().setString("text.configuration.name", "text");
editor1.setPart(part_text);
engine.getConfiguration().setString("text.configuration.name", "number");
editor2.setPart(part_number);

Best regards,

Thomas


1 person likes this

1. In a use case of type "form with multiple fields", how to know which "field" of the form is active at runtime, so as to configure the editor from editor pool to that particular "field".

2. What should be the configuration of an editor, configured on a particular "field", so that it only accepts "number" i.e. 24589 or "text" i.e. "swapnil".

Thanks,

Swapnil Gaikwad.

Dear Swapnil,


We are actually working on a form code sample to provide to our customers.

I wouldn't forget to keep you informed when it will be done.


Regards,


Maël

Hi Mael,

Thanks for Responding.

May I know when can I get the form code sample.

Regards,

Swapnil


1 person likes this

Dear Swapnil,


We do our best to implement a good solution.

I don't have a date by now but it will take few weeks.


Regards,


Maël

Hi Swapnil,

Were you able to implement this?

Piyush

Hi,

Was anyone able to figure this out?

Regards,

Piyush

Hi Piyush, No I was not able to implement it. These guys were working on form sample code, but don't why they are taking so long to get this sample code. Thanks, Swapnil
Hi Mael, Could please let us know by when we will be getting this form sample code. As per your previous response you said few weeks, may I know how long we need to wait for your sample code, please respond.

Dear Swapnil,


currently, my colleague Mael is currently off, and did not have time to work on a sample.


Nevertheless, I updated the other post on the forum, to provide with explanations : https://developer-support.myscript.com/support/discussions/topics/16000024164


Following the guidelines, you should be able to deal by yourself.


Best regards,


Olivier

Dear Maël,

Just wanted to check if you guys are working on a sample code for the above?

Piyush

Dear Piujsh,


Indeed we are working on a form code sample but we can't commit which date it will become available.


We will keep you informed about this.


Regards,


Maël

Login or Signup to post a comment
  • Support
  • Forums
  • Interactive Ink
  • Android How to create a form with multiple text field such as mobile number, postal code & name on single editor view