Page 1 of 1

Link-style label with server-side VClick event

PostPosted: 10 Jan 2014 10:28
by magosk
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?

Re: Link-style label with server-side VClick event

PostPosted: 10 Jan 2014 10:54
by Alexander Bulei
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.

Re: Link-style label with server-side VClick event

PostPosted: 10 Jan 2014 15:28
by magosk
Thanks, brilliant! I hoped it would be as easy as this...