Combo-box Cursor Issue

Discussions about creating CAPI applications to run on Android devices
Forum rules
New release: CSPro 8.0
Post Reply
dipesh.desme
Posts: 1
Joined: June 30th, 2022, 11:08 am

Combo-box Cursor Issue

Post by dipesh.desme »

I used a dynamic valueset to get name of Guardian from previously entered names. If Name does not exist then user can enter a new name.
The field for Guardian Name is a Combo-box.
The code for dynamic valueset to get name of Guardian is:
//Array Declaration for Guardian name
array string guardian_list(50);
//Dropdown list for Guardian Name

function string guardian_option()
x = 1;
guardian_list.clear();
guardian_list(x-1)= strip(GUARDIAN_NAME(1));
while x < curocc() do
guardian_list(x)= strip(HH_MEMBER_NAME(x));
x=x+1;
enddo;
guardian_list(x) = "";

setvalueset(GUARDIAN_NAME, guardian_list,guardian_list);
end;
However, in the Combo-box, the cursor initial position is the end of field length. If user wants to enter new name then he/she must press back button multiple times to clear the blank spaces and only then can enter a name.
Please help solve this issue. PS: This occurs in Android and not on desktop.
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Combo-box Cursor Issue

Post by Gregory Martin »

You are right. This is a bug on Android. We will fix this for the next release. In the meantime, you can keep your program as it is, and have the enumerators delete the spaces, or you could also design the value set to include an option to type a name and then use the Drop Down capture type instead of Combo Box. Something like this:
PROC GUARDIAN_NAME

onfocus

    valueset string
guardian_vs;
   
    // add the option to enter a name
   
guardian_vs.add("Enter Name", "-");
   
    // add the other options (replace with your code from the guardian_option function)
   
guardian_vs.add("John", "John");
    guardian_vs.add("Jane", "Jane");
   
    // add the current value (if applicable), because it may not be in the above entries
   
if GUARDIAN_NAME <> "" and guardian_vs.codes.seek(strip(GUARDIAN_NAME)) = 0 then
       
guardian_vs.add(strip(GUARDIAN_NAME), GUARDIAN_NAME);
    endif;
   
   
    // set the value set
   
setvalueset(GUARDIAN_NAME, guardian_vs);
   
postproc

   
// if the user wants to enter a name, use prompt to get it
   
if GUARDIAN_NAME = "-" then
       
GUARDIAN_NAME = prompt("Enter the Guardian Name");
        reenter;
    endif;
Post Reply