Page 1 of 1

Text property empty

PostPosted: 07 May 2015 17:38
by Ryszard
Hi,

I'm testing a form based on the mobile demo.

If I pre-set the text for username, on the click the login button, though the text is visible on screen, the value of dbUsername.Text is empty.

I was on 2.5.0.48 and have tried 2.6.0.60, both the same results, am I missing something?

Image

Code: Select all
procedure TfrmLoginMobile.btnLoginJQMButtonOptionsEventsVClick(Sender: TObject;
  AParams: TStringList);
var
  Username: String;
  Password: String;
begin

  Username := Trim(dbUsername.Text); { <======= dbUsername.Text = '' }

  if StringIsEmpty(Username) then
  begin
    laUsername.Text := '<font color="#FF0000">Email address is required</font>';
    laUsername.Visible := True;
  end else
  if (not ValidEmailAddress(Username)) then
  begin
    laUsername.Text := '<font color="#FF0000">Email address is invalid</font>';
    laUsername.Visible := True;
  end else
  begin
    laUsername.Visible := False;
  end;

  Password := dbPassword.Text;

  if StringIsEmpty(Password) then
  begin
    laPassword.Text := '<font color="#FF0000">Password is required</font>';
    laPassword.Visible := True;
  end else
  begin
    laPassword.Visible := False;
  end;

  if StringIsEmpty(Username) or StringIsEmpty(Password) then
  begin
    Exit;
  end;


http://www.sfd.co/images/login.zip

Thank you,

Ryszard

Re: Text property empty

PostPosted: 08 May 2015 09:29
by Alexander Bulei
Hi Ryszard,

Please explain better the problem.

Best Regards.

Re: Text property empty

PostPosted: 08 May 2015 10:32
by Ryszard
Hi Alexander,

I'm trying to retain the information entered into anyone of the TIWCGJQMEdit after the TIWCGJQMButton is clicked.

The most simple example would be to use the JQMobileDemoIW14 demo, set the TJQMLoginFrame.TJQMLoginFrame.Text to 'Test', run then click the login button. Though the screen shows 'Test', when evaluation the value it's ''.

So if I'm designing a register page for example and all the fields but one is filled in and the user clicks a button and an error shown / displayed, the on screen edits still show what has been entered, but on second click of the button all .Text properties return ''

Hope this helps, if not can I send example.

Thank you,

Ryszard

Re: Text property empty

PostPosted: 08 May 2015 15:23
by Alexander Bulei
Hi Ryszard,

Can you reproduce it in attached demo?

Best Regards.

Re: Text property empty

PostPosted: 08 May 2015 15:45
by Ryszard
Hi Alexander,

This works correctly, I'll look at properties to see if I can work out the difference?

Kind regards,

Ryszard

Re: Text property empty

PostPosted: 08 May 2015 16:40
by Ryszard
Hi Alexander,

Found it:

The demo has JQMButtonOptions.Events.OnVClick.Ajax = False.

I've taken that form as starting point and this results in empty .Text

Thank you for your help,

Ryszard

Re: Text property empty

PostPosted: 09 May 2015 09:00
by Ryszard
Hi Alexander,

That being said,is it possible to get the .Text value if JQMButtonOptions.Events.OnVClick.Ajax = False?

Kind regards,

Ryszard

Re: Text property empty

PostPosted: 12 May 2015 09:14
by Alexander Bulei
Hi Ryszard,

You're right!
We will fix it asap.

Best Regards.

Re: Text property empty

PostPosted: 12 May 2015 11:37
by Alexander Bulei
Hi Ryszard,

Fixed in next beta build.
Btw, I recommend you to uses Ajax = True, because faster and avoid the full resfresh of page.

Best Regards.