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

<htmlb:link> with target-attribute

Hello,

I want to use the htmlb-tag <htmlb:link> with the attribute target="_blank" to open the target-page in a new browser-window. I did the following coding:

...

<htmlb:link id = "idLink"

onClick = "showDetails"

reference = "./detail.htm"

target = "_blank">

<htmlb:image src="./s_bgmore.gif"

alt="details"/>

</htmlb:link>

...

But the new page opens in the same frame. Without the "onClick"-attribute a new window opens, but the server-site eventhandler "onInputProcessing" is just processing when the "onCLick"-attribute is set. And I need this eventhandler to select data before calling the next page.

The online-docu says that the target-attribute is just regarded if an HREF is set. How can the problem be resolved?

Thanx for all hints,

Mathias

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Oct 30, 2003 at 01:19 PM

    Mathias,

    The problem is here "either-or". Either we can go back to the server (with the onClick), or stay in the browser and do the link handling. Not both.

    Once you set the onClick handler, this means that you request an event back at the server that user clicked on the link. So the HTTP request is send to the server.

    What you can do here is to return information to open window later. This can NOT be done from server. So typical code would be (in Layout!):

    27, there are exactly these examples.

    brian (closing a number of opened windows here)

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 17, 2004 at 09:42 PM

    Here's how I did it.... first the javascript function (place this in the head part of your html):

    <script type="text/javascript" language="javascript">

    <!--

    // this will be used to load a help window, about 2/3

    // size of main window.

    function pwloadit(url) {

    //var width = Math.round(screen.width * 2 / 3);

    var width = 820;

    var height = Math.round(screen.height * 2 / 3);

    var height = 610;

    var top = Math.round( (screen.height - height) / 3);

    var left = Math.round( (screen.width - width) / 3);

    attr = "width="width",height="height",top="top",left="+left;

    attr = attr+",resizable=yes,scrollbars=yes"

    var pwloadit = window.open(url,'',attr); }

    // -->

    </script>

    Next, the htmlb link (coded in the body of the html). myurl is a proper URL with HTTP:// at the beginning, gv_help_text is the name visible to the user at run time, myttip is a "tooltip":

    <htmlb:link id = "HELP"

    reference = "javascript:pwloadit( '<%=myurl%>' )"

    text = "<%= gv_help_text %>"

    tooltip = "<%=myttip%>" />

    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.