Noob question opening mail client or skype

Dear sirs,

I have searched the web for hours now and allthough it is not a TMS related problem perhaps someone can help me:

I have a TIWAdvImageButton on a customers data form next to an EMail Edit field. When pressing the button I want to open the local mail client with the email address stored in the edit comp.

Using WebApplication.NewWindow('mailto:xxx') works, but a new blank window is opened every time and this sucks.
Using WebApplication.GotoURL does nothing at all.

Is there any way to open the mail client or skype with a phone number without opening a blank window every time?

Thank you very much for your assistance!



There's two possible solutions for this:

1) Add the following javascript to the ScriptEvents.OnClick event:
document.location.href = "mailto:" + document.getElementById("IWEDIT1").value;
(replace IWEDIT1 with the ID of your email edit field)

2) Execute the same javascript using the OnAsyncClick event:

procedure TIWForm6.TIWAdvImageButton1AsyncClick(Sender: TObject;
  EventParams: TStringList);
  js: string;
  js := 'document.location.href = "mailto:' + IWEdit1.Text + '";';

(Please not that currently the IWAdvImageButton OnAsyncClick event gets fired twice. This has been fixed and the update will be available with the next release of the TMS IW Component Pack.)

Hurray! That works!

Many thanks, Bart!