CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Link-style label with server-side VClick event

by magosk » 10 Jan 2014 10:28

I would like a link on my mobile web app start page that points to the full version web site. If I add a TIWCGJQMLabel to the form and set Text = '<a href="url">Go to full web site</a>' it displays like I want to (underlined blue text) and the link leads to the specified URL, but the mobile web app session is of course then not terminated. So my idea is to have the label display itself in the same way as the standard HTML link, but when clicked instead trigger a server-side VClick event where I can perform a WebApplication.TerminateAndRedirect. Is this possible, and if so, how (I have played around with some properties and events without success)? Or do you suggest a different approach?
magosk
 
Posts: 181
Joined: 07 Oct 2013 08:41

by Alexander Bulei » 10 Jan 2014 10:54

Hi magosk,

  1. Drag and drop JQMLabel
  2. For style, set the Link property to #
  3. on Events.OnVClick put your code:

    delphi code
    procedure TIWAppForm1.IWCGJQMLabel1EventsVClick(Sender: TObject; AParams: TStringList);
    begin
    WebApplication.TerminateAndRedirect('http://www.google.com');
    end;

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 magosk » 10 Jan 2014 15:28

Thanks, brilliant! I hoped it would be as easy as this...
magosk
 
Posts: 181
Joined: 07 Oct 2013 08:41


Return to JQMLabel

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.