Skip to Content
author's profile photo Former Member
Former Member

open new window

Hello,

I want to open new browser window in a DynPage. For this I have the code:

...

...

...

public void onClick(Event event) throws PageException

{

IPortalComponentRequest request =

(IPortalComponentRequest) this.getRequest();

IPortalComponentResponse response =

(IPortalComponentResponse) this.getResponse();

..

.. HttpServletResponse resp = request.getServletResponse(true);

try

{

resp.sendRedirect(

"<b>http://localhost:50000/irj/servlet/prt/portal/prtroot/Pa.MyDynPage</b>");

}

catch (IOException e)

{

e.printStackTrace();

}

}

...

How could I open a new window and then to redirect the bolded URL in already opened window.

Thank for any feedback

Best Regards.

Altafin

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 26, 2004 at 10:24 AM

    Hi Altafin,

    you have various options:

    - create a link with attribute target:

    <a href="somewhere" target="_blank" >mylink</a>

    - create a new window using javascript:

    <a href="javascript:window.open("somewhere") >mylink</a>

    - use the client framework

    <a href="javascript:

    EPCM.doNavigate ('ROLES://portal_content/folder1/role1/workset1/iView111')" >mylink</a>

    The third option (which has some varietes, plz see Client Side Eventing documetation in the PDK) has the advantage that you

    - can harness the workprotect mode of the EPCF (open an extra window/ open in same window, depending on some client side dirty flag)

    - can easily link to pcd/other navigation connector addresses (opening a portal page with navigation in place and as if the user had opened that page by himself)

    (To be honest, the second feature can also be achieved with normal linking.)

    If you don't want to hardcode your link address (because you want to be application name independent), you can also use the prt api to create the URI:

    (written from the top of my head)

    IPortalComponentURI uri = request.createPortalComponentURI()

    uri.setContextName(request.getComponentContext().getApplicationName()+".MyDynPage");

    response.write("<a href=\""uri.toString()"\" > mylink</a>");

    (this code creates a link to a component in the same application, component named MyDynPage, application name ignorant)

    Regards,

    Armin

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.