You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by laine78 <me...@hotmail.com> on 2012/05/03 20:10:24 UTC
Open page in new window when clicking on button
I have two buttons - Back and Display.
The back button is supposed to take you back to the previous page within the
same window.
The Display button is to open up a new window with some info in it.
The issue that I'm running into is that both buttons cause new windows to
open up.
Here is the code:
File.html
<form wicket:id="form">
<div wicket:id="groupBox" target="_blank>
<div wicket:id="containerPanel" align="left"></div>
</div>
<div align="center">
<button wicket:id="back"></button>
<button wicket:id="display"></button>
</div>
</form>
File.java
private Button getBackButton(){
Button backButton = new Button("back", new ResourceModel("label_back")){
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public void onSubmit(){
SearchPage searchPage = new SearchPage();
setResponsePage( searchPage );
}
};
return backButton;
}
private Button getDisplayButton() {
displayButton = new Button("display", new ResourceModel("label_display"))
{
private static final long serialVersionUID = 1L;
@Override
public void onSubmit() {
DisplayPage displayPage= new DisplayPage();
setResponsePage(displayPage);
}
};
return displayButton;
}
Both of these buttons are added to the form.
I tried putting the target=_blank on the display button itself, but that
just opened up the new page in the same window. I tried overriding the
onComponentTag for the print button...once again, opened up the new page in
the same window. It only seems to work when I override the onComponentTag
for the form. Any suggestions?
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Open-page-in-new-window-when-clicking-on-button-tp4606718.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org