cancel
Showing results for 
Search instead for 
Did you mean: 

Close Current Window using html page

Former Member
0 Kudos

Hi

We have migrated a WDJ dc from 7.0 to 7.3, before migration there was a code to close window using html file as given below. This code is not working on 7.3 now as this might be removed from API & no javadocs are available for the same.

Please provide some suitable way to redirect to URL(created for close.html), as I want to close window using the same html file. Also I'm not able to create fireplugs, so exitplug method wont work.

 

String Url = WDURLGenerator.getWebResourceUrl(wdComponentAPI.getComponent().getDeployableObjectPart(),"close.html");

TaskBinder.getCurrentTask().getClient().sendRedirect(Url, 0);

Thanks

Akanksha

Accepted Solutions (1)

Accepted Solutions (1)

govardan_raj
Contributor
0 Kudos

hi akansha ,

As ervin already suggested , you can 

create an Exit Plug with suitable  name  having   a boolean parameter called closeWindow .

and it  is case sensitive.

wdThis.wdGet*******WindowController().wdFirePlugPlugName(true);


if you can create an exit plug in the window that you wanted close.


can u please explain the issue u r facing in create exitplugs , as u have suggested that u r not able to create any exitplugs ?



In case u still want to redirect then you can use this


  WDClientUser.forceLogoffClientUser(url);



Regards

Govardan


Former Member
0 Kudos

Hi

Thank you all for the replies.

But my issue got solved using below given code:

String Url = WDURLGenerator.getWebResourceUrl(wdComponentAPI.getComponent().getDeployableObjectPart(),"close.html");

wdComponentAPI.getWindowManager().startExternalApplication(Url);

Regards

Akanksha

Answers (2)

Answers (2)

junwu
Active Contributor
0 Kudos

for 7.1+, there is standard api support for closing window, no need to use that workaround for nw7

former_member191044
Active Contributor
0 Kudos

Hello Akanksha,

This should initiate a redirect:

IWDResponse responseObject = WDProtocolAdapter.getProtocolAdapter().getResponseObject();

HttpServletResponse response = (HttpServletResponse)responseObject.getProtocolResponse();

response.setHeader("Location", yourURL);

response.setStatus(302);

Hope this helps.

Regards,

Tobias.

ErvinSzolke
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

try this:

Here I described a procedure at

Ervin Szolke Jun 26, 2013 3:00 PM (in response to Vallabhaneni Suresh Kumar)

I hope this helps.

Best Regards,

Ervin