You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Scott Stevenson <js...@scottstevenson.com> on 2006/11/14 19:44:03 UTC

Navigation across frames using commandLink. Broken?

I have just upgraded from Tomahawk 1.1.3 to 1.1.5 nightly and I'm now
encountering a problem with page navigation across frames.

We are using two frames:  A navigation frame and a main work area.  We are
using command links in the navigation frame to navigate to the appropriate
page in the main frame using the "target" attribute.

This worked fine at Tomahawk 1.1.3 but at 1.1.5 nightly, only the first
selected page is displayed whatever link is selected.

So in the example below, if I select "Test 1" first time into the session
then the "Test 1" page is displayed correctly.  If I then select "Test 2",
"Test 1" is displayed again which is, of course, incorrect.

If "Test 2" is the first selected page of the session then "Test 2" is
displayed correctly but if I then select "Test 1", "Test 2" is displayed
again.

No matter which link I select, it's always the first selected page of the
session which is displayed.

I put some logging into my phase listener and it seems that somehow the
view-id gets "locked" at the very first one which is selected. (I use 
phaseEvent.getFacesContext().getViewRoot().getViewId(); )

The problem only occurs when I navigate across frames.  If I navigate
within the same frame then everything works as I would expect.

Any ideas, suggestions or workarounds will be very welcome.  If someone
can even point me to where the problem might lie then I'll be happy to try
and provide a patch if it turns out to be a bug.

Thanks in advance.

Scott.


Here is a simplified version of the navigation frame:

<t:panelGrid columns="1">
  <t:commandLink  action="test1" target="workarea_frame" value="Test 1"/>
  <t:commandLink  action="test2" target="workarea_frame" value="Test 2"/>
</t:panelGrid>

And an extract from the faces config:

<navigation-rule>
    <from-view-id>*</from-view-id>
    <navigation-case>
        <from-outcome>test1</from-outcome>
        <to-view-id>/test1.jsp</to-view-id>
   </navigation-case>
</navigation-rule>

<navigation-rule>
    <from-view-id>*</from-view-id>
    <navigation-case>
        <from-outcome>test2</from-outcome>
        <to-view-id>/test2.jsp</to-view-id>
   </navigation-case>
</navigation-rule>