0

Using the code below to show an InputQuery with two fields and all is fine in windows and Android. The same code works fine with one field on ios but not with two producing the above error message. Any ideas of what the issue would be. I have seen this https://quality.embarcadero.com/browse/RSP-27777 report that seems to show the two input field on ios but with a caption issue. Also the issue with cancel Async InputQuery doesn't handle Cancel button but nothing with this message. Thank you in advance.

procedure TFrmMain.user_level_lbClick(Sender: TObject);
var
  code_now, old_user_type: integer; 
begin
code_now := 12;
 TDialogServiceAsync.InputQuery('Please enter code to change user level password', ['Code','Level'], 
  ['000','1'],
procedure(const AResult: TModalResult; const AValues: array of string)
begin
 if Aresult = mrOk then
   if Strtoint(Avalues[0]) = code_now
       then begin
            old_user_type := user_type;
            user_type := strtoint( Avalues[1]);
            showmessage('You have changed your level from ' +  inttostr(old_user_type) + 
               ' to ' +inttostr(user_type));
            end
       else showmessage('Wrong code');  // go to setup for debug
if Aresult = mrCancel then ;
  end);
end;
na38
  • 109
  • 2
  • 12

1 Answers1

1

On iOS, InputQuery uses a UIAlertView "under the hood", which means it is limited in the inputs it has available. Please refer to:

https://developer.apple.com/documentation/uikit/uialertviewstyle?language=objc

Bottom line: You would need to submit a feature request for it to support what you want (which would mean that something other than UIAlertView would be used), or implement it another way

Dave Nottage
  • 3,411
  • 1
  • 20
  • 57
  • Thanks Dave for the clarification. I noticed that on your post linked above you managed to get the InputQuery to show more than one item. I assume then that you used something other than the UIAlertView. Also I have accepted your answer. – na38 Dec 30 '20 at 14:51
  • My post above? Are you referring to the report on Quality Portal? It's a username/password scenario, which is one of the options for UIAlertView – Dave Nottage Dec 30 '20 at 20:39
  • Yep that is the one. I thought that it may be a special case to show two edit fields. – na38 Dec 30 '20 at 21:58