6 Replies Latest reply on Mar 30, 2009 10:49 AM by Michael Schmidt

    action methods not called in <a4j:include>

    Michael Schmidt Newbie

      Hi there,

      I've got a working jsp page using jsf which uses a subview instead of a view component so I can include it. The thing now is, that if I use a commandbutton of any sort and use it to invoke a method, I can see the page being rerendered, but the action is not called at all.

      The message component doesn't show anything at all either. That is if I include the page. If I use it on its own everything works as it is supposed to be. Not using subview in the included page doesn't help either. It only makes it impossible to use it on its own.

      This is driving me crazy. How should I proceed to find the error? I'm still new to jsf :/

      Does anyone please have some advice for me how to approach this?

      I'm using the richfaces-ui-3.3.0.GA binaries. Before I had 3.2.2.SR1 but this screwed up the extendedDataTable component in an included page. Buttons didn't work either.

      mike

        • 1. Re: action methods not called in <a4j:include>
          Ilya Shaikovsky Master

          1) please try to use RF 3.3.1 Beta 2
          2) if not helps include http://www.jsftutorials.net/faces-config/phaseTracker.html to the application and paste its log for the wrong request

          • 2. Re: action methods not called in <a4j:include>
            Michael Schmidt Newbie

            I just tried the newest build of RF but the page still shows the same behavior.

            Phasetracker doesn't show that much different output in the wrong request in comparison to the right one. It only calls restore and response multiple times because I included more than 1 page, I think:

            Mar 30, 2009 1:01:53 PM org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE RESTORE_VIEW 1
            Mar 30, 2009 1:01:53 PM org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER RESTORE_VIEW 1
            Mar 30, 2009 1:01:53 PM org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE APPLY_REQUEST_VALUES 2
            Mar 30, 2009 1:01:53 PM org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER APPLY_REQUEST_VALUES 2
            Mar 30, 2009 1:01:53 PM org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE PROCESS_VALIDATIONS 3
            Mar 30, 2009 1:01:53 PM org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER PROCESS_VALIDATIONS 3
            Mar 30, 2009 1:01:53 PM org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE UPDATE_MODEL_VALUES 4
            Mar 30, 2009 1:01:53 PM org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER UPDATE_MODEL_VALUES 4
            Mar 30, 2009 1:01:53 PM org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE INVOKE_APPLICATION 5
            Mar 30, 2009 1:01:53 PM org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER INVOKE_APPLICATION 5
            Mar 30, 2009 1:01:53 PM org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE RENDER_RESPONSE 6
            Mar 30, 2009 1:01:54 PM org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER RENDER_RESPONSE 6
            Mar 30, 2009 1:01:54 PM org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE RESTORE_VIEW 1
            Mar 30, 2009 1:01:54 PM org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER RESTORE_VIEW 1
            Mar 30, 2009 1:01:54 PM org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE RENDER_RESPONSE 6
            Mar 30, 2009 1:01:54 PM org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER RENDER_RESPONSE 6
            Mar 30, 2009 1:01:54 PM org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE RESTORE_VIEW 1
            Mar 30, 2009 1:01:54 PM org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER RESTORE_VIEW 1
            Mar 30, 2009 1:01:54 PM org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE RENDER_RESPONSE 6
            Mar 30, 2009 1:01:54 PM org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER RENDER_RESPONSE 6
            Mar 30, 2009 1:01:54 PM org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE RESTORE_VIEW 1
            Mar 30, 2009 1:01:54 PM org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER RESTORE_VIEW 1
            Mar 30, 2009 1:01:54 PM org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE RENDER_RESPONSE 6
            Mar 30, 2009 1:01:54 PM org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER RENDER_RESPONSE 6
            Mar 30, 2009 1:01:54 PM org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE RESTORE_VIEW 1
            Mar 30, 2009 1:01:54 PM org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER RESTORE_VIEW 1
            Mar 30, 2009 1:01:54 PM org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE RENDER_RESPONSE 6
            Mar 30, 2009 1:01:54 PM org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER RENDER_RESPONSE 6
            


            I just tried facestrace as well but it shows no apparent difference between those two calls. No error messages, no phases skipped etc... this definitely is driving me insane... it seems like even the css properties are affected by the include since a lot of them just don't want to work anymore. I have to adjust the components explicitly with the style attribute of the parent components.

            • 3. Re: action methods not called in <a4j:include>
              Ilya Shaikovsky Master

              ok shown then your pages.

              • 4. Re: action methods not called in <a4j:include>
                Michael Schmidt Newbie

                That's the main page:

                <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
                <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
                <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
                <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
                <%@ page language="java" session="true"%>
                
                <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
                <html>
                <head>
                <title>WAIL - Web Administration Interface for LASSI</title>
                <META http-equiv="content-language" content="de">
                <META name="description"
                 content="ASDF">
                <script type="text/javascript" language="JavaScript"
                 src="../js/basix.js"></SCRIPT>
                <script type="text/javascript" language="JavaScript"
                 src="../js/prototype-1.6.0.2.js"></SCRIPT>
                <LINK REL="stylesheet" type="text/css" HREF="../css/divisions.css">
                <LINK REL="stylesheet" type="text/css" HREF="../css/positioning.css">
                <LINK REL="stylesheet" type="text/css" HREF="../css/head.css">
                <link rel="STYLESHEET" type="text/css" href="../css/styles.css">
                <link rel="STYLESHEET" type="text/css" href="../css/main.css">
                <link rel="STYLESHEET" type="text/css" href="../css/fonts.css">
                
                </head>
                <body>
                <f:view>
                 <a4j:form id="mainForm">
                 <DIV ID="head">
                 <a4j:include id="headPage" viewId="head.jsp" />
                 </DIV>
                
                 <DIV ID="navigation">
                 <a4j:include id="navigationPage" viewId="navigation.jsp" />
                 </DIV>
                
                 <DIV ID="content">
                 <a4j:include id="contentPage" viewId="V97web.jsp" />
                 </DIV>
                
                 <DIV ID="bottom">
                 <a4j:include id="bottomPage" viewId="bottom.jsp" />
                 </DIV>
                
                
                 <form name="Formular"></form>
                 <NOSCRIPT>Please activate Javascript.</NOSCRIPT>
                 </a4j:form>
                </f:view>
                </body>
                </html>


                This is one page I'm trying to include (navigation.jsp). There are more pages but the mistake happening here should be the same as on any other page and this one at least is not a total mess, I think...

                <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
                <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
                <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
                <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
                <%@ taglib uri="http://facestrace.sourceforge.net" prefix="ft"%>
                <%@ page
                 language="java" session="true"%>
                
                <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
                <html>
                <head>
                <title>bla</title>
                <META name="robots" content="noindex">
                <link rel="STYLESHEET" type="text/css" href="css/styles.css">
                <link rel="STYLESHEET" type="text/css" href="css/main.css">
                <link rel="STYLESHEET" type="text/css" href="css/fonts.css">
                <link rel="STYLESHEET" type="text/css" href="css/positioning.css">
                <script type="text/javascript" language="JavaScript" src="js/basix.js"></SCRIPT>
                <script type="text/javascript" language="JavaScript" src="js/scripts.js"></SCRIPT>
                </head>
                <body>
                <f:subview id="navigation">
                <h:messages showSummary="true" showDetail="true"></h:messages>
                <rich:spacer height="5px"></rich:spacer>
                 <h:form id="loginForm"
                 rendered="#{not userBean.loggedIn}">
                 <rich:panel id="loginPanel" style="z-index:2;position: absolute; top:5px;left:10px;right:10px;">
                 <h:panelGrid columns="2" rowClasses="defaultText">
                 <h:outputText value="Benutzer: " style="text-decoration: underline" />
                 <h:inputText value="#{userBean.userId}" style="font-weight: bold"
                 maxlength="10" size="10"></h:inputText>
                 <h:outputText value="Passwort: " style="text-decoration: underline" />
                 <h:inputSecret value="#{userBean.password}"
                 style="font-weight: bold" maxlength="10" size="10"></h:inputSecret>
                 <h:commandButton id="loginButton" value="Login" action="#{userBean.login}" />
                 </h:panelGrid>
                 </rich:panel>
                 <br>
                 </h:form>
                 <h:form id="logoutForm"
                 rendered="#{userBean.loggedIn}">
                 <rich:panel id="logoutPanel" style="z-index:2;position: absolute; top:5px;left:10px;right:10px;">
                 <h:panelGrid columns="2" rowClasses="defaultText">
                 <h:outputText value="Benutzer: " style="text-decoration: underline" />
                 <h:outputText value="#{userBean.userId}" style="font-weight: bold" />
                 <h:outputText value="Letzter Login: "
                 style="text-decoration: underline" />
                 <h:outputText value="24.12.1987" style="font-weight: bold" />
                 <h:commandButton id="logoutButton" value="Logout" action="#{userBean.logout}" />
                 </h:panelGrid>
                 </rich:panel>
                 <!--
                 <rich:separator style="z-index:2;position: absolute; top:120px;left:10px;right:10px;"></rich:separator>
                 -->
                 </h:form>
                
                 <h:panelGrid id="menuGrid" border="0"
                 columns="1" width="150" rendered="#{userBean.loggedIn}"
                 style="z-index:2;position: absolute; top:120px;left:10px;right:10px;">
                 <h:form id="menuForm">
                 <rich:panelMenu id="navigationPanelMenu"
                 mode="server"
                 binding="#{userBean.navigationPanelMenu.navigationPanelMenu}"
                 value="item"
                 selectedChild="#{userBean.navigationPanelMenu.selectedChild}"
                 iconExpandedGroup="disc" iconCollapsedGroup="disc"
                 iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
                 iconCollapsedTopGroup="chevronDown"
                 valueChangeListener="#{userBean.navigationPanelMenu.processValueChange}">
                 </rich:panelMenu>
                 </h:form>
                 </h:panelGrid>
                
                 <div id="transparent_border">
                 <form><input name="temp" type="hidden" value="temp" /></form>
                 </div>
                 <ft:trace />
                 </f:subview>
                </body>
                </html>
                


                • 5. Re: action methods not called in <a4j:include>
                  Ilya Shaikovsky Master

                  nested forms not allowed in JSF.

                  • 6. Re: action methods not called in <a4j:include>
                    Michael Schmidt Newbie

                    wohoo :D thanks a lot! I would never have guessed that... My problem seems to be solved all together :)