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.


1 person has 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

 

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

 


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

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