CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Text property empty

by Ryszard » 07 May 2015 17:38

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
Ryszard
 
Posts: 5
Joined: 13 Nov 2014 21:26

by Alexander Bulei » 08 May 2015 09:29

Hi Ryszard,

Please explain better the problem.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by Ryszard » 08 May 2015 10:32

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
Ryszard
 
Posts: 5
Joined: 13 Nov 2014 21:26

by Alexander Bulei » 08 May 2015 15:23

Hi Ryszard,

Can you reproduce it in attached demo?

Best Regards.
You do not have the required permissions to view the files attached to this post.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by Ryszard » 08 May 2015 15:45

Hi Alexander,

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

Kind regards,

Ryszard
Ryszard
 
Posts: 5
Joined: 13 Nov 2014 21:26

by Ryszard » 08 May 2015 16:40

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
Ryszard
 
Posts: 5
Joined: 13 Nov 2014 21:26

by Ryszard » 09 May 2015 09:00

Hi Alexander,

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

Kind regards,

Ryszard
Ryszard
 
Posts: 5
Joined: 13 Nov 2014 21:26

by Alexander Bulei » 12 May 2015 09:14

Hi Ryszard,

You're right!
We will fix it asap.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by Alexander Bulei » 12 May 2015 11:37

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.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to JQMEdit

Who is online

Users browsing this forum: No registered users and 2 guests

Contact Us.