myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "H. Swaczinna" <>
Subject [Tobago] Problem with target attribue (Reminder)
Date Thu, 19 Apr 2007 10:14:30 GMT

I want to display the result of an action (a new page) in a new
browser window. So I set the target attribute of tc:link or
tc:button to the window name. This works fine. But when I click another
button or link in the page the action is not executed (the page is
rendered again). I always have to click the button twice.

I think this is a known problem with a known solution. In my code for
the PDF download I included this two lines to avoid this problem:

// Save serialized view or else after clicking on the export button,
// user will have to click TWICE to invoke another action
StateManager stateManager = (StateManager)facesContext.getApplication().getStateManager();

(Taken from

Maybe this code should be included in Tobago (or myFaces?) when the
target attribute is set. 

Here's a simple test case for you:


<tc:page id="testPage1" width="300px" height="200px">
<tc:out value="Page 1"/>
<tc:link label="new window"
action="#{controller.newWindowAction}" />
<tc:button label="another action"
action="#{controller.anotherAction}" />


<tc:page id="testPage2" width="300px" height="200px">
<tc:out value="Page 2"/>



public String newWindowAction() {
return "newWindow";

public void anotherAction() {

When you click the "new window" link in test1.jsp a new window is
opened with test2.jsp. But when you click the link again test1.jsp
is displayed in the new window. When you click the "another action"
button after clicking the "new window" link the anotherAction()
is not called. You have to click the button once again.

I'm using myFaces 1.1.5 and Tobago 1.0.11 from yesterday.
I think you should be able to reproduce this behavior.


View raw message