-
1. Re: a4j:include question
sergeysmirnov Jun 7, 2007 4:01 AM (in response to mcrob427)You do not need to reRender myPanelGroup explicitly. I.e. remove reRender.
What else /pages/sub1.jsp has? It might be important to find the reason. Are you sure the action method is invoked? -
2. Re: a4j:include question
mcrob427 Jul 6, 2007 7:31 PM (in response to mcrob427)Hi Sergey,
I'll post my complete code. Here it is -
This is my main page called myReports.jsp -<%@ page errorPage="/error" %> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%> <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%> <f:view> <%-- Load Resource Bundles --%> <f:loadBundle basename="InquiryCenterMessages" var="bundle" /> <f:loadBundle basename="HelpLocations" var="helpBundle" /> <a4j:log level="ALL" popup="true" name="_blank" hotkey="y"/> <div id="rptCntNvDv" class="contentnav"> <h2> <h:outputText id="NvPgTtlTxt" value="#{message.my_reports_page_title}"/> </h2> <%@ include file="/WEB-INF/jspf/tiles/reports/myReportsContentNav.jspf" %> <form id="rptCntFrm" > <div id="rptCntMnDv" class="contentmain"> <div id="rptCntMnPnTtlDv" class="panetitle"> <h:outputText id="PnTtlSelRptTxt" value="#{myReportsBean.selectedReport.title}"/> </div> <div id="MnPnTtlDtlsDv" class="details"> <h:panelGroup id="myPanelGroup"> <a4j:include viewId="/reports/myReportExecuteContent.jsp" /> </h:panelGroup> </div> </div> </form> </div> </f:view>
And here is the a4j:include page myReportExecuteContent.jsp -<%@ page buffer="none" errorPage="/error" %> <%-- No buffer required to included JSF pages. Alternative to verbatim tags --%> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%> <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%> <f:loadBundle basename="InquiryCenterMessages" var="message"/> <div id="ExDtlsHdrDv2" class="sectionheader"><span class="title"><h:outputText id="HdrSttngLblTxt" value="#{message.my_reports_form_report_settings_label}"/></span></div> <div id="ExDtlsCntDv2" class="sectioncontent"> <table id="CntTbl" class="formtable"> <tr id="CntTblRw" > <td id="CntTblRwLblCol" class="label"> <h:outputText id="CntTblRwShLblTxt" value="#{message.my_reports_form_show_label}"/> </td> <td id="CntTblRw2LblCol" class="label"> <h:outputText id="CntTblRw2FrmBLblTxt" value="#{message.my_reports_form_between_label}"/> </td> <td id="CntTblRw2InCol" class="input"> <h:outputText id="CntTblRw2FrmLblTxt" value="#{message.my_reports_form_and_label}"/> </td> </tr> </table> </div> </div> <a4j:commandButton id="execReportLink" action="#{reportExecutionBean.executeReport}" actionListener="#{myReportsBean.onExecuteReport}" type="button" value="#{message.my_reports_form_run_report_button_label}"/>
my faces-config file contains the following navigation case -<navigation-rule> <from-view-id>/reports/myReportExecuteContent.jsp</from-view-id> <navigation-case> <description>Navigates to the report execution detail results page</description> <from-outcome>detailResults</from-outcome> <to-view-id>/reports/reportDetailResultsContent.jsf</to-view-id> </navigation-case> </navigation-rule>
And the action binding for the a4j:commandButton reportExecutionBean.executeReport contains only the following code -return "detailResults";
which is the from-outcome for the navigation case
And I'm positive that the action is invoked, I've set a breakpoint there and it does hit everytime I click the command button
Any ideas? Appreciate the help.
Robert Lin -
3. Re: a4j:include question
mcrob427 Jul 11, 2007 2:43 PM (in response to mcrob427)I've debugged into IncludeTag.doStartTag() and it seems like when I click on the command button the first two times, the viewId is still the original page, but the third click I get the correct viewId, however I get a NullPointerException inside AjaxViewHandler.restoreView() when it is calling externalContext.redirect(actionURL).
Has anyone seen this before? I'm using Ajax4jsf 1.1.0 and JSF 1.1
Any help would be greatly appreciated. Thanks.
Robert -
4. Re: a4j:include question
ilya_shaikovsky Jul 12, 2007 10:46 AM (in response to mcrob427)I think ajax4jsf 1.1.0 is too old. To many bugs has been fixed from that time.
Also check if you have jsf 1.1_02. 1.1_01 is too buggy. -
5. Re: a4j:include question
mcrob427 Jul 17, 2007 5:39 PM (in response to mcrob427)Ok, I got jsf 1.1_02 and ajax4jsf 1.1.1. I got around my initial problem by explicitly specifying an id for the <a4j:include> tag.
However, I've ran into a new problem -
for some reason when the command button on the included page is clicked, AjaxViewHandler.restoreView() is called with the viewId of the targeted page for the include. On line 150 of AjaxViewHandler, the ViewHandler attemps to restore view and retrieve the viewRoot. However, since this targeted page has never been loaded before, the viewRoot will be null, and on line 154 the if statement will be true, and eventually at line 180 there will be a redirect with the targeted page as the actionURL. This basically is throwing an IllegalStateException. Why is this happening?
Any ideas? Thanks.
Robert