Good day all and thanks for this project!  I'm sorry if this is 
slightly off topic, but I think that masny in the community may 
have related experience that will be insightful to my 
problem/question.  First some background; I'm attempting to 
build what I am referring to as a "composite application" where 
the screen display at any single point in time will consist of 
the combination of multiple, yet entirely independant and 
separate web apps (think portal - yet we cannot use a portal 
due to our requirements).  Of course, each application must be 
functional independantly of the others, so I'm faced with the 
problem presented by the single request/response model of 
HTML ... namely all would typically need to be refreshed.  I'm 
hoping to overcome this hurdle with AJAX  - whereby, I could 
refresh just one portion (a subview???) of the display 
ajaxically.  Does anyone know if this is possible?  What 
follows is my presently failing attempts with AjaxAnywhere to 
accomplish this.  Any and all insights, suggestions, 
alternatives will be greatly appreciated!

I'm brand new to AjaxAnywhere and am having what I hope is a 
newbie type problem that someone can easily point out for me. 
I'm using ajaxanywher-1.1.06 with MyFaces 1.1.1. 

I have page4.jsp with a single <aa:zoneJSF> as follows: 

<%@ page language="java" contentType="text/html; charset=UTF-8" 
%>

<%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
<%@ taglib uri="http://ajaxanywhere.sourceforge.net/"; 
prefix="aa" %>

<f:loadBundle basename="nuwss.sisp.sispweb.assets.messages" 
var="msgs"/>

<f:view>
<html>
        <head>
                
        </head>
        <body>
                <h2>At Page 4</h2>
                Errors: <h:messages/><br>
                
                <p><br>
                <c:import url="pages/refreshCounter.jsp"/>
                
                <p><br>
                
                <div style="border: medium solid black;">
                        <h:form id="irl">
                        
                                <aa:zoneJSF id="contentPane">
                                        <c:import 
url="pages/test.jsp"/>
                                </aa:zoneJSF>
                        
                        </h:form>
                </div>
                
                
        </body>
</html>
</f:view>

<script type="text/JavaScript" src="scripts/aa.js"></script>

<script>
            ajaxAnywhere.getZonesToReload = function
(url,submitButton) {
                //alert( "Submitting: " + url + " from " + 
submitButton );

                return "contentPane";
            }
        
                
            ajaxAnywhere.formName = "irl";
            ajaxAnywhere.substituteFormSubmitFunction();
            ajaxAnywhere.substituteSubmitButtonsBehavior(true);
            
</script>




As you can see, it JSTL imports pages/test.jsp that contains 
the main form content as follows: 



<%@ page language="java" contentType="text/html; charset=UTF-8" 
%>

<%
    System.out.println( "In test.jsp" );                        
%>

<%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles-
1.1" prefix="tiles" %>
<%@ taglib uri="http://ajaxanywhere.sourceforge.net/"; 
prefix="aa" %>

<f:loadBundle basename="nuwss.sisp.sispweb.assets.messages" 
var="msgs"/>

        <f:verbatim>Hello, World (you are at 
</f:verbatim><h:outputText value="#
{util.currentViewId}"/><f:verbatim escape="false">).
        <p>
        </f:verbatim>
        <f:verbatim escape="false"><p>
        What is your address:
        </f:verbatim>
                <h:panelGrid columns="2">
                        <h:outputText id="street1Label" 
value="Street1:"/>
                        <h:panelGroup id="Street1">
                                <h:inputText id="Street1I" 
value="#{address.street1}"/>
                                <h:message id="street1Msg" 
for="Street1"/>
                        </h:panelGroup>
                        
                        <h:outputText id="street2Label" 
value="Street2:"/>
                        <h:panelGroup id="Street2">
                                <h:inputText id="Street2I" 
value="#{address.street2}"/>
                                <h:message id="street2Msg" 
for="Street2"/>
                        </h:panelGroup>

                        <h:outputText id="cityLabel" 
value="City:"/>
                        <h:panelGroup id="City">
                                <h:inputText id="CityI" value="#
{address.city}"/>
                                <h:message id="cityMsg" 
for="City"/>
                        </h:panelGroup>

                        <h:outputText id="stateLabel" 
value="State:"/>
                        <h:panelGroup id="State">
                                <h:inputText id="StateI" 
value="#{address.state}"/>
                                <h:message id="stateMsg" 
for="State"/>
                        </h:panelGroup>                         
                                                

                        <h:outputText id="zipLabel" 
value="Zip:"/>
                        <h:panelGroup id="Zip">
                                <h:inputText id="ZipI" value="#
{address.zip}"/>
                                <h:message id="zipMsg" 
for="Zip"/>
                        </h:panelGroup>
                </h:panelGrid>
                <h:commandButton id="goButton" value="Submit" 
action="#{address.execute}" />



Upon successful form submission, the faces navigation events 
(note that I have verified that this works just fine prior to 
adding ajaxAnywhere) should take us to pages/altNext.jsp as 
follows: 

<[EMAIL PROTECTED] language="java" contentType="text/html; charset=UTF-8" %
>

<%
        System.out.println( "In 
altNext.jsp" );                       
%>

<%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles-
1.1" prefix="tiles" %>

<f:loadBundle basename="nuwss.sisp.sispweb.assets.messages" 
var="msgs"/>
<f:subview id="nextPage"> 

                        <f:verbatim>Hello, World (you are at 
</f:verbatim><h:outputText value="#
{util.currentViewId}"/><f:verbatim escape="false">).
                        <p></f:verbatim>
                        <f:verbatim escape="false"><p>
                        Your address is:
                        </f:verbatim>
                        
                        <h:outputText id="street1" value="#
{address.street1}"/>
                        <h:outputText id="street2" value="#
{address.street2}"/>
                        <h:outputText id="city" value="#
{address.city}"/>
                        <h:outputText id="state" value="#
{address.state}"/>
                        <h:outputText id="zip" value="#
{address.zip}"/>
                        
                        <p>
                                <h:commandLink id="backCommand" 
action="back">
                                        <h:outputText 
id="backButton" value="Back"/>
                                </h:commandLink>

</f:subview>



Bringing the app up works just fine (page4.jsp does 
successfully import pages/test.jsp and the rendered pages 
looks/acts just fine. Upon submitting the form, ajaxAnywhere 
handles the submit (I see the default Loading status indicator 
and have verified it through alerts). Debug statements have 
verified that my managed bean has executed as desired and that 
the subequent page (altNext.jsp) was indeed invoked as 
expected! The problem is that while the contentPane 
<aa:zoneJSF> is indeed updated - it is with entirely BLANK 
content (i.e. the span shrinks back to nothing but the border 
have there via CSS)????? The console does display two 
interesting/tell-tale items, namely: 

state = null 
tree = null 

>From a quick view of the source, this appears to come from 
MyFacesClientStateSavingPreSendHandler probably indicating that 
it does not have the state info it needs. However, I have 
verified that my faces STATE_SAVING_METHOD is indeed client and 
have also verified (vi browser view source) that the apparently 
associated hidden input field name="jsf_tree_64" is indeed part 
of the original page4.jsp content and within the form. 

What am I missing and/or doing wrong? Any and all help is 
greatly appreciated! 

TIA! 


Reply via email to