creating popup
hello,
i just want to open new window after clicking a command button. The new window should have a content of one jsp site. Sth. like:
myFirst.jsp
-
<h:commandButton onmousedown="window.open('mySecond.jsp','SecondJsp');
onclick="return false"
/>
mySecond.jsp
<f:view>
<h:outputText value="mySecond.jsp">
</f:view>
unfortunately i get errors.
any ideas how to realize it?
[553 byte] By [
naekoa] at [2007-11-27 7:11:35]

# 2
thanks that's was:-)
the other problem i have is, before calling javascript function i would go in the bean to set some values for mySecond.jsp, but unfortunately the action will never called, so the javascript comes before and mySecond.jsp doesn't have values it has to, so:
myFirst.jsp
-
<h:commandButton action="#{mySecond.action}" onmousedown="window.open('mySecond.jsp','SecondJsp');
onclick="return false"
/>
mySecond.java
void action()
{
//do something, set some values
}
how to make it calling action first and then js-function?
naekoa at 2007-7-12 19:03:14 >

# 4
sorry, not really
i just want to launch myBean.action before my javascript-function. Otherwise i get my popup with old values, because the action will be called after popup has been shown. So this way is wrong:
<h:commandButton action="#{myBean.action}" value="..." onclick="window.open('mySite.jsf','popup');return true>
</h:commandButton>
so any idea how to realize it?">
naekoa at 2007-7-12 19:03:14 >

# 5
So you have to call the button action first and than trigger the popup after the response has reached the client. For the first request you can use Ajax. Or you use the normal button action and include the script in the response. That is nearly, what I have described in the other posts.