3 Replies Latest reply on Oct 23, 2008 11:04 AM by goompas

    HtmlPanelMenuItem target open new window but target frame ex

    goompas

      Hello
      I have menu that have items as belove
      This code is from bean that bind menu.

      Item = new HtmlPanelMenuItem();
       Item.setLabel("label");
      
       Item.setTarget("window");

      i wana get action from this item and include new page to content.
      I have action="nextb" for this item and as see target="window"
      Now, i have template
      index_template.xhtml
      
      
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:c="http://java.sun.com/jstl/core"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:t="http://myfaces.apache.org/tomahawk">
      
       <head>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
       <link href="../css/default.css" rel="stylesheet" type="text/css" />
       <link href="../css/tableLayout.css" rel="stylesheet" type="text/css" />
       <title>Facelets Template</title>
       </head>
      
       <body>
      
      
      
       <frameset frameborder="0" id="frM" framespacing="0" border="0" cols="*" rows="0,0,*">
       <frame marginwidth="0" marginheight="0" name="header" noresize="true" scrolling="no" >
       <ui:insert name="top">Top</ui:insert>
       </frame>
       <frame marginwidth="0" marginheight="0" name="subHeader" noresize="true" scrolling="no" >
       <ui:insert name="right">Right</ui:insert>
       </frame>
       <frameset id='fr0' frameborder="0" framespacing="0" border="0" cols="230,*" rows="*">
       <frame marginwidth="5" marginheight="5" name="menu" noresize="true" scrolling="auto" frameborder="0" >
       <ui:insert name="left">Left</ui:insert>
       </frame>
       <frame marginwidth="5" marginheight="5" name="window" noresize="true" >
       <a4j:form>
       <h:panelGrid id="window">
       <ui:insert name="content">Content</ui:insert>
       </h:panelGrid>
       </a4j:form>
       </frame>
       </frameset>
      </frameset>
       </body>
      
      </html>
      


      index.html
      
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich">
      
       <body>
      
       <ui:composition template="index_template.xhtml">
      
       <ui:define name="top">
       <ui:include src="/content/top.xhtml"/>
       </ui:define>
      
       <ui:define name="left">
       <ui:include src="/content/left.xhtml"/>
       </ui:define>
      
      
       <ui:define name="right">
       <ui:include src="/content/top.xhtml"/>
       </ui:define>
      
       <ui:define name="content" id="content" >
      
       <a4j:include viewId="/content/content.xhtml" id="window1">
       <ui:param name="rere" value="content"/>
       </a4j:include>
       </ui:define>
      
       <ui:define name="bottom">
       <ui:include src="/content/bottom.xhtml"/>
       </ui:define>
      
       </ui:composition>
      
       </body>
      </html>
      


      in faces-config.xml i have
      <navigation-rule>
      
       <navigation-case>
       <from-view-id>/content/content.xhtml</from-view-id>
       <from-outcome>nextb</from-outcome>
       <to-view-id>/content/bottom.xhtml</to-view-id>
       </navigation-case>
       <navigation-case>
       <from-outcome>nextc</from-outcome>
       <to-view-id>/content/right.xhtml</to-view-id>
       </navigation-case>
       </navigation-rule>


      When i click item in menu it open this new page(/content/bottom.xhtml) i new window but it should be included instead "/content/content.xhtml" in frame named "window", but this dont work and open new browser window where open this page. When i second time click on link its refresh page in this new browser window. Its seems that it cant find frame named "window" and open new. Any ideas? Sory for my english. I check View/Source generated page and frame "window" exist.
      <ui:define name="content" id="content" >
      
       <a4j:include viewId="/content/content.xhtml" id="window1">
       <ui:param name="rere" value="content"/>
       </a4j:include>
       </ui:define>