Skip to Content
author's profile photo
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 comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • 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 comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    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 comment
    10|10000 characters needed characters exceeded