open a new tab of current browser in a process

338 views
Skip to first unread message

Nicolas Micoud

unread,
May 16, 2013, 10:30:35 AM5/16/13
to idem...@googlegroups.com
Hi,

I would like to create a process which open an url when finishing.
I duplicated this code from WLocationDialog :

String urlString = MLocation.LOCATION_MAPS_URL_PREFIX + "my address";
Executions.getCurrent().sendRedirect(urlString, "_blank");

And it fails with a NPE.


Then, i try to put those lines in a beforeSave method and it works.

Any idea ?


Thanks,

Nicolas

Nicolas Micoud

unread,
Nov 4, 2013, 11:02:56 AM11/4/13
to idem...@googlegroups.com
Hi,

hengsin give tips here https://idempiere.atlassian.net/browse/IDEMPIERE-1280.
But, it's like Klingon to me and i can't manage to open my url at the end of my process :(.

Anyone could give an example please ?

[process...]
String url = "idempiere.org";
Desktop desktop = AEnv.getDesktop();

And then ???       


Thanks,

Nicolas

Hiep Lq

unread,
Nov 4, 2013, 9:52:50 PM11/4/13
to idem...@googlegroups.com

Hi Nicolas.
see class ServerPushTemplate i think flow as below.

1. make class  MyServerPushCallback implement IServerPushCallback
implement all update ui code in function updateUI

2. Desktop desktop = AEnv.getDesktop();

3. make pushUpdateUi = new ServerPushTemplate (desktop)

4. make callback = new MyServerPushCallback()

5. call pushUpdateUi.execute (callback) for sycn
or call pushUpdateUi.executeAsync (callback) for asynchronous.

Nicolas Micoud

unread,
Nov 5, 2013, 3:41:42 AM11/5/13
to idem...@googlegroups.com
Hi,

It's working fine !
Thanks a lot.

Regards,

Nicolas
Reply all
Reply to author
Forward
0 new messages