facebook

Can’t get navigation rule to work

  1. MyEclipse Archived
  2.  > 
  3. ICEfaces Integration
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #279652 Reply

    shookie10
    Member

    Hi Folks,

    I am having trouble getting a navigation rule to work in Icefaces. Can anybody help? Here is my faces-config.xml:

    
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    
    <faces-config>
        <managed-bean>
            <managed-bean-name>testBean</managed-bean-name>
            <managed-bean-class>test.Test</managed-bean-class>
            <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>
        <navigation-rule>
            <from-view-id>/MyJsp.jsp</from-view-id>
            <navigation-case>
                <from-outcome>goto</from-outcome>
                <to-view-id>/destination.jsp</to-view-id>
            </navigation-case>
        </navigation-rule>
    </faces-config>
    

    Here is my first page called MyJsp.jsp:

    
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://www.icesoft.com/icefaces/component" prefix="ice"%>
    <html>
        <head>
            <meta http-equiv="Content-Type"
                content="text/html; charset=ISO-8859-1" />
            <title>ICEfaces, Ajax for Java EE</title>
            <link rel="stylesheet" type="text/css" href="./xmlhttp/css/xp/xp.css" />
        </head>
        <body>
            <f:view>
                <ice:outputText value="Thank you for using ICEfaces." />
                <ice:form partialSubmit="true">
                    <ice:messages />
                    <ice:commandButton action="goto" type="submit"></ice:commandButton>
                </ice:form>
            </f:view>
        </body>
    </html>
    

    and here is my second page that I wish to navigate to, called destination.jsp:

    
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://www.icesoft.com/icefaces/component" prefix="ice"%>
    <html>
        <head>
            <meta http-equiv="Content-Type"
                content="text/html; charset=ISO-8859-1" />
            <title>ICEfaces, Ajax for Java EE</title>
            <link rel="stylesheet" type="text/css" href="./xmlhttp/css/xp/xp.css" />
        </head>
        <body>
            <f:view>
                <ice:outputText value="I did it!" />
                <ice:form partialSubmit="true">
                    <ice:messages />
                </ice:form>
            </f:view>
        </body>
    </html>
    

    When I click on the button in MyJsp.jsp, nothing happens. No messages are displayed, nada. I’ve also tried substituting the action=”goto” in the button to a dynamic call to a session bean method, and I can verify that the method is getting called and returns the string “goto”, but it still does not work.

    Thanks for any help you can give.

    #279789 Reply

    Riyad Kalla
    Member

    Hmm… looks like it could be an ICEfaces bug:
    http://jira.icefaces.org/browse/ICE-1957

    what happens when you remove the from clause and just make a global navigation case?

    #279919 Reply

    shookie10
    Member

    That did it! Thanks for the reply. I would add that the link you provided specifically mentions Facelets, which I am not using, so perhaps the bug is more general than they realize. Thanks again.

    #281485 Reply

    lmckinney
    Member

    Hello, I am having a similar issue.

    I have tried the above suggestion and also tried implementing a “page.xhtml” rule and a “page.iface” rule as suggested by the release notes in icefaces.

    I am using facelets with icefaces on a glassfish appserver (2.x).

    When I try to navigate using button click, it won’t. The strange thing is that when I refresh the page in the browser, it goes to the right page. The browser I am using is FireFox 2. I am at a loss.

    Any help would be appreciated

    #282776 Reply

    girijagdish
    Member

    @shookie10 wrote:

    Hi Folks,

    I am having trouble getting a navigation rule to work in Icefaces. Can anybody help? Here is my faces-config.xml:

    
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    
    <faces-config>
        <managed-bean>
            <managed-bean-name>testBean</managed-bean-name>
            <managed-bean-class>test.Test</managed-bean-class>
            <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>
        <navigation-rule>
            <from-view-id>/MyJsp.jsp</from-view-id>
            <navigation-case>
                <from-outcome>goto</from-outcome>
                <to-view-id>/destination.jsp</to-view-id>
            </navigation-case>
        </navigation-rule>
    </faces-config>
    

    Here is my first page called MyJsp.jsp:

    
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://www.icesoft.com/icefaces/component" prefix="ice"%>
    <html>
        <head>
            <meta http-equiv="Content-Type"
                content="text/html; charset=ISO-8859-1" />
            <title>ICEfaces, Ajax for Java EE</title>
            <link rel="stylesheet" type="text/css" href="./xmlhttp/css/xp/xp.css" />
        </head>
        <body>
            <f:view>
                <ice:outputText value="Thank you for using ICEfaces." />
                <ice:form partialSubmit="true">
                    <ice:messages />
                    <ice:commandButton action="goto" type="submit"></ice:commandButton>
                </ice:form>
            </f:view>
        </body>
    </html>
    

    and here is my second page that I wish to navigate to, called destination.jsp:

    
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://www.icesoft.com/icefaces/component" prefix="ice"%>
    <html>
        <head>
            <meta http-equiv="Content-Type"
                content="text/html; charset=ISO-8859-1" />
            <title>ICEfaces, Ajax for Java EE</title>
            <link rel="stylesheet" type="text/css" href="./xmlhttp/css/xp/xp.css" />
        </head>
        <body>
            <f:view>
                <ice:outputText value="I did it!" />
                <ice:form partialSubmit="true">
                    <ice:messages />
                </ice:form>
            </f:view>
        </body>
    </html>
    

    When I click on the button in MyJsp.jsp, nothing happens. No messages are displayed, nada. I’ve also tried substituting the action=”goto” in the button to a dynamic call to a session bean method, and I can verify that the method is getting called and returns the string “goto”, but it still does not work.

    Thanks for any help you can give.

    Here u r using iceface technologies but u didn’t follow the rule of using icefaces.
    i am sending one sample jsf and icefaces page:;;::

    <f:view xmlns:f=”http://java.sun.com/jsf/core&#8221;
    xmlns:h=”http://java.sun.com/jsf/html&#8221;
    xmlns:ice=”http://www.icesoft.com/icefaces/component&#8221;
    xmlns:t=”http://myfaces.apache.org/tomahawk&#8221;
    xmlns:odc=”http://www.ibm.com/jsf/BrowserFramework&#8221;
    xmlns:hx=”http://www.ibm.com/jsf/html_extended”&gt;

    <html>
    <head>

    <link rel=”stylesheet” type=”text/css” href=”../../css/SSA.css” />
    <link rel=”stylesheet” type=”text/css” href=”theme/stylesheet.css” title=”Style”/>
    <link rel=”stylesheet” type=”text/css” href=”theme/tabpanel.css” title=”Style”/>
    <link rel=”stylesheet” type=”text/css” href=”theme/datagrid.css” title=”Style”/>

    </head>
    <body>

    <hx:scriptCollector id=”scriptCollector1″>
    <ice:form id=”ActivityMasterForm” style=”text-align:center” partialSubmit=”true”>
    <f:subview id=”subActivityMasterList”>
    <ice:panelGrid columns=”1″ style=”text-align:left;width:100%;color:red;font-size:x-small;height:60px”>
    <h:outputText value=”” style=”color:green” />
    </ice:panelGrid>
    <ice:panelGrid columns=”1″>
    <f:facet name=”header”>
    <h:outputText value=”Activity Master List” styleClass=”outputtextwidth”/>
    </f:facet>
    <br></br>
    <ice:panelGrid columns=”2″>
    <h:outputText value=”Select Program” styleClass=”outputtextwidth” />
    <ice:selectOneListbox id=”selectquestionid0″
    title=”select any one in this menu” styleClass=”inputtextwidth”>
    <f:selectItem id=”selectQuestionId0″ itemLabel=”Select Program”
    itemValue=”” />
    </ice:selectOneListbox>
    <h:outputText value=”Activity Level” styleClass=”outputtextwidth” />
    <ice:selectOneListbox id=”selectquestionid1″
    title=”select any one in this menu” styleClass=”inputtextwidth”>
    <f:selectItem id=”selectQuestionId1″ itemLabel=”Activity Level”
    itemValue=”” />
    </ice:selectOneListbox>
    <h:outputText value=”Activity Code” styleClass=”outputtextwidth” />
    <h:inputText id=”ActivityCode” styleClass=”inputtextwidth” />
    <h:outputText value=”Activity Name” styleClass=”outputtextwidth” />
    <h:inputText id=”ActivityName” style=”width:140″ value=”” />
    <h:outputText value=”Physical Activity Name”
    styleClass=”LoginmiddleTile1″ />
    <h:inputText id=”PhysicalActivityName” styleClass=”inputtextwidth” />

    </ice:panelGrid>
    <br></br>
    <ice:panelGrid columns=”1″ style=”width:100%;text-align:center”>
    <ice:panelGrid columns=”2″>
    <ice:commandButton value=”Search” styleClass=”linkbut” action=”#{pc_DynamicExample.doBtnExecuteQueryAction}” />
    <ice:commandButton value=”Add Activity” styleClass=”linkbut” action=”goTOActivityDetail” />
    </ice:panelGrid>
    </ice:panelGrid>
    <br></br><br></br>
    </ice:panelGrid>
    </f:subview>

    <odc:tabbedPanel slantActiveRight=”3″ styleClass=”tabbedPanel” width=”730″ slantInactiveRight=”3″ height=”395″
    variableTabLength=”false” showBackNextButton=”true” showTabs=”true”
    id=”tabbedPanel1″ slantActiveLeft=”1″ numOfTabs=”4″
    slantInactiveLeft=”1″>
    <odc:bfPanel id=”bfpanel1″ name=”Grid”
    showFinishCancelButton=”false”>
    <h:panelGrid styleClass=”panelGrid” id=”grid3″></h:panelGrid>
    </odc:bfPanel>

    <odc:bfPanel id=”bfpanel2″ name=”Field”
    showFinishCancelButton=”false”>
    <h:panelGrid styleClass=”panelGrid” id=”grid4″></h:panelGrid>
    </odc:bfPanel>
    <odc:bfPanel id=”bfpanel3″ name=”Config”
    showFinishCancelButton=”false”>
    <TABLE border=”1″ width=”438″ height=”140″>

    <TBODY>
    <TR>
    <TD width=”104″>Driver</TD>
    <TD width=”220″><h:inputText styleClass=”inputText”
    id=”txtDriverName” size=”35″></h:inputText></TD>
    </TR>
    <TR>
    <TD width=”104″>URL</TD>
    <TD width=”220″><h:inputText styleClass=”inputText”
    id=”txtURLConnection” size=”35″></h:inputText></TD>
    </TR>
    <TR>
    <TD width=”104″>User Name</TD>
    <TD width=”220″><h:inputText styleClass=”inputText”
    id=”txtConnectionUserName” size=”10″></h:inputText></TD>
    </TR>
    <TR>
    <TD width=”104″>Password</TD>
    <TD width=”220″><h:inputSecret styleClass=”inputSecret”
    id=”txtConnectionPassword” size=”10″></h:inputSecret></TD>
    </TR>
    <TR>
    <TD width=”104″>Last Message</TD>
    <TD width=”220″><h:outputText styleClass=”outputText”
    id=”text5″ value=””></h:outputText></TD>
    </TR>
    </TBODY>

    </TABLE>

    <hx:commandExButton type=”submit” value=”Test Connection”
    styleClass=”commandExButton” id=”btnTestConnection”
    action=””></hx:commandExButton>
    <BR></BR>
    <BR></BR>
    </odc:bfPanel>

    <f:facet name=”back”>
    <hx:commandExButton type=”submit” value=”< Back”
    id=”tabbedPanel1_back” style=”display:none”></hx:commandExButton>
    </f:facet>
    <f:facet name=”next”>
    <hx:commandExButton type=”submit” value=”Next >”
    id=”tabbedPanel1_next” style=”display:none”></hx:commandExButton>
    </f:facet>
    <f:facet name=”finish”>
    <hx:commandExButton type=”submit” value=”Finish”
    id=”tabbedPanel1_finish” style=”display:none”></hx:commandExButton>
    </f:facet>
    <f:facet name=”cancel”>
    <hx:commandExButton type=”submit” value=”Cancel”
    id=”tabbedPanel1_cancel” style=”display:none”></hx:commandExButton>
    </f:facet>
    </odc:tabbedPanel>

    <h:inputHidden id=”text2″ value=””></h:inputHidden>
    <A href=”index.jsp”>Return to Menu</A>

    <script language=”javascript”>

    var action = document.getElementById(“form1:text2”).value;

    // alert(“action: ‘” + action + “‘”);

    if(action == “view”)
    {
    var button = document.getElementById(“form1:tabbedPanel1_back”);
    button.click();
    }

    if(action == “edit”)
    {
    var button = document.getElementById(“form1:tabbedPanel1_next”);
    button.click();

    // document.getElementById(‘form1:tabbedPanel1tabbedPaneltabTable’).tabControl.NextTab();
    }

    if(action == “delete”)
    {
    var button = document.getElementById(“form1:tabbedPanel1_next”);
    button.click();
    }

    document.write(“Active Pane = ” + document.getElementById(“form1:text2”).value);
    </script>
    </ice:form>
    </hx:scriptCollector>

    </body>
    </html>
    </f:view>

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Can’t get navigation rule to work

You must be logged in to post in the forum log in