cancel
Showing results for 
Search instead for 
Did you mean: 

<htmlb:link> with target-attribute

Mathias_24
Explorer
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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%>" />

former_member181879
Active Contributor
0 Kudos

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)