You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Brian Smith <un...@gmail.com> on 2007/05/24 15:44:06 UTC

Re: [Trinidad] PPR - getting full page refresh instead of partialrefresh

I am also having problems with PPR.  I have followed every example but just
can't seem to get PPR to work.  I am using Facelets.  I have a main template
that uses a trh:body tag (required for PPR to work) to enclose my content.

Here is an example,  I am trying to create dependent selectOneInput boxes.
I have placed a button on the form to submit the request manually so I know
the database logic is fine.

<ui:define name="content">
            <tr:form id="assignmentForm">
                <tr:panelFormLayout maxColumns="1">
                    <tr:selectOneChoice id="department_input"
                                        label="#{messages['
Department.department']}"
                                        value="#{department}"
                                        valueChangeListener="#{
workOrder.change}"
                                        autosubmit="true">
                        <s:selectItems label="#{dept.departmentNumber} - #{
dept.departmentName}"
                                       value="#{allDepartments.resultList}"
                                       var="dept"
noSelectionLabel="(None)"/>
                    </tr:selectOneChoice>
                    <tr:selectOneChoice id="departmentSection_input"
                                        label="#{messages['
Department.section']}"
                                        value="#{departmentSection}"
                                        partialTriggers="department_input">
                        <s:selectItems label="#{sect.sectionName}"
                                       value="#{sectionList}"
                                       var="sect"
noSelectionLabel="(None)"/>
                    </tr:selectOneChoice>
                    <h:commandButton actionListener="#{
workOrder.fillSectionList}"/>
                </tr:panelFormLayout>
            </tr:form>
    </ui:define>

I have been working with Trinidad for a while now and have never been able
to get PPR of any kind other than the Dialog Framework to work.  I am
thinking there must be something wrong with my configuration or some other
issue going on.

Thanks for any help.

-Brian

ps If needed I can post my web.xml and faces-config

On 5/24/07, Luka Surija <lu...@iytim.hr> wrote:
>
> your partial trigger is set to refresh the tr:panelBox, that means, only
> components inside tr:panelBox and the tr:panelBox will be updated. If
> you put partialTriggers="preview" in tr:form, then the text will be also
> updated.
>
>
> noah wrote:
> > Maybe I just don't understand how PPR is supposed to work.
> >
> > I have this page (Facelets, 1.2-07-apr-SNAPSHOT, 1.2 RI, FF 2):
> > <tr:document xmlns="http://www.w3.org/1999/xhtml"
> > xmlns:ui="http://java.sun.com/jsf/facelets"
> > xmlns:f="http://java.sun.com/jsf/core"
> > xmlns:c="http://java.sun.com/jstl/core"
> > xmlns:tr="http://myfaces.apache.org/trinidad"
> > xmlns:h="http://java.sun.com/jsf/html" title="Trinidad Test">
> > <tr:form >
> >
> > <tr:panelBox background="transparent" partialTriggers="preview">
> > <h:outputText escape="false" value="#{pageFlowScope.text}" />
> > </tr:panelBox>
> >
> > <tr:inputText value="#{pageFlowScope.text}" columns="100" rows="25"/>
> >
> > <tr:commandButton id="preview" partialSubmit="true" text="Preview" />
> >
> > Text='#{pageFlowScope.text}'
> >
> > </tr:form>
> > </tr:document>
> >
> > Now I get the expected rendering. I get Text='' (i.e. no update) and
> > the panelBox is updated, but it's happening as a normal POST with full
> > page refresh. Have I done something wrong or is this the expected
> > behavior?
> >
>
>
> --
> Luka Ĺ urija
> luka.surija@iytim.hr
> +385 98 434 061
>
> I.Y. tim d.o.o.
> www.iytim.hr
> info@iytim.hr
>
>
>

ImageMap and JSF

Posted by Balaji Saranathan <ba...@wipro.com>.
Hi,

 

I'm trying to simulate a device UI with JSF.

 

I have defined  a <h:graphicImage> to use a ImageMap that I created.
However, I'm not clear how my "onclick" javascript event on the part of the
map can set some value for a <h:selectOneMenu> in the page and re-render it.

 

I would appreciate if anyone could help me associate the JS event to the
backing bean.

 

Regards

Bala




The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

Re: [Trinidad] PPR - getting full page refresh instead of partialrefresh

Posted by Brian Smith <un...@gmail.com>.
Yes I am using Seam as well but I have not seen anything that says Trinidad
PPR and Seam conflict.  Here is my web.xml and faces-config

I may trying switching to Trinidad 1.2 and the JSF RI 1.2 to see if that
helps at all.  JBoss 4.2 now ships with JSF RI 1.2 instead of MyFaces.

Thanks,
-Brian

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <context-param>
        <param-name>com.sun.faces.verifyObjects</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>com.sun.faces.validateXml</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.xhtml</param-value>
    </context-param>
    <context-param>
            <param-name>facelets.REFRESH_PERIOD</param-name>
            <param-value>2</param-value>
    </context-param>
    <context-param>
        <param-name>facelets.DEVELOPMENT</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
    </context-param>
    <context-param>
        <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER
</param-name>
        <!--<param-value>com.sun.facelets.FaceletViewHandler
</param-value>-->
        <param-value>org.jboss.seam.ui.facelet.SeamFaceletViewHandler
</param-value>
    </context-param>

    <context-param>
        <param-name>org.apache.myfaces.trinidad.USE_APPLICATION_VIEW_CACHE
</param-name>
        <param-value>false</param-value>
    </context-param>

    <context-param>
        <param-name>facelets.SKIP_COMMENTS</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>org.jboss.seam.core.init.debug</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION
</param-name>
        <param-value>true</param-value>
    </context-param>
    <!--
    <context-param>
        <param-name>facelets.VIEW_MAPPINGS</param-name>
        <param-value>*.xhtml</param-value>
    </context-param>
    -->
    <!--****************Seam Listener*******************-->
    <listener>
        <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
    </listener>

    <!--MyFaces-->
    <listener>
        <listener-class>
org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
    </listener>

    <!--****************JSF 1.2RI Listener**************
    <listener>
        <listener-class>com.sun.faces.config.ConfigureListener
</listener-class>
    </listener>
    -->

<!-- ************************ AJAX4JSF Filter ****************************
-->
    <!-- If you have other filters declared in the web.xml, be sure that
Ajax4jsf Filter is declared before the others. -->
    <filter>
        <display-name>Ajax4jsf Filter</display-name>
        <filter-name>ajax4jsf</filter-name>
        <filter-class>org.ajax4jsf.Filter</filter-class>
        <init-param>
            <param-name>forceparser</param-name>
            <param-value>false</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>ajax4jsf</filter-name>
        <url-pattern>*.seam</url-pattern>
    </filter-mapping>

    <!--****************Trinidad Filter*****************-->
    <filter>
        <filter-name>Trinidad</filter-name>
        <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter
</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>Trinidad</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
        <!--<url-pattern>*.seam</url-pattern>-->
    </filter-mapping>

    <!--*****************Seam Filter*******************-->
    <filter>
        <filter-name>Seam Filter</filter-name>
        <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>Seam Filter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!--****************Seam Servlet Mapping***********-->
    <servlet>
        <servlet-name>Seam Resource Servlet</servlet-name>
        <servlet-class>org.jboss.seam.servlet.ResourceServlet
</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Seam Resource Servlet</servlet-name>
        <url-pattern>/seam/resource/*</url-pattern>
    </servlet-mapping>

    <!--****************Faces Servlet Mapping**********-->
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.seam</url-pattern>
    </servlet-mapping>

    <!--****************Trinidad Resources Servlet**********-->
    <servlet>
        <servlet-name>Trinidad Resources</servlet-name>
        <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet
</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Trinidad Resources</servlet-name>
        <url-pattern>/adf/*</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
    <resource-ref>
        <res-ref-name>jdbc/TXOracleDS</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>

</web-app>

faces-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config
PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
                            "http://java.sun.com/dtd/web-facesconfig_1_0.dtd
">
<faces-config>
        <!--Seam Phase Listener-->
    <lifecycle>
        <!--
        <phase-listener>org.jboss.seam.jsf.SeamPhaseListener
</phase-listener>
        -->
        <phase-listener>org.jboss.seam.jsf.TransactionalSeamPhaseListener
</phase-listener>

        <phase-listener>
            com.stlouiscity.csb.jsf.listener.TrinidadDialogPhaseListener
        </phase-listener>

    </lifecycle>
    <application>
        <default-render-kit-id>org.apache.myfaces.trinidad.core
</default-render-kit-id>
        <!--<el-resolver>org.jboss.seam.jsf.SeamELResolver</el-resolver>-->
        <locale-config>
            <default-locale>en</default-locale>
        </locale-config>
        <message-bundle>com.stlouiscity.csb.jsf.messages.ErrorMessages
</message-bundle>

        <action-listener>
            com.stlouiscity.csb.jsf.listener.TrinidadDialogActionListener
        </action-listener>

    </application>
    <navigation-rule>
        <from-view-id>/*</from-view-id>
        <navigation-case>
            <from-outcome>dialog:chooseCustomer</from-outcome>
            <to-view-id>/AttachCustomer_dlg.xhtml</to-view-id>
        </navigation-case>

    </navigation-rule>
</faces-config>

On 5/24/07, Luka Surija <lu...@iytim.hr> wrote:
>
> This should work, as is. There must be something in your configuration
> file. You are using also seam? May be there is a problem.
>
> Brian Smith wrote:
> > I am also having problems with PPR.  I have followed every example but
> > just can't seem to get PPR to work.  I am using Facelets.  I have a
> > main template that uses a trh:body tag (required for PPR to work) to
> > enclose my content.
> >
> > Here is an example,  I am trying to create dependent selectOneInput
> > boxes.  I have placed a button on the form to submit the request
> > manually so I know the database logic is fine.
> >
> > <ui:define name="content">
> >             <tr:form id="assignmentForm">
> >                 <tr:panelFormLayout maxColumns="1">
> >                     <tr:selectOneChoice id="department_input"
> >                                         label="#{messages['
> > Department.department']}"
> >                                         value="#{department}"
> >
> > valueChangeListener="#{workOrder.change}"
> >                                         autosubmit="true">
> >                         <s:selectItems label="#{dept.departmentNumber}
> > - #{dept.departmentName}"
> >
> > value="#{allDepartments.resultList}"
> >                                        var="dept"
> > noSelectionLabel="(None)"/>
> >                     </tr:selectOneChoice>
> >                     <tr:selectOneChoice id="departmentSection_input"
> >
> > label="#{messages['Department.section ']}"
> >                                         value="#{departmentSection}"
> >
> > partialTriggers="department_input">
> >                         <s:selectItems label="#{ sect.sectionName}"
> >                                        value="#{sectionList}"
> >                                        var="sect"
> > noSelectionLabel="(None)"/>
> >                     </tr:selectOneChoice>
> >                     <h:commandButton
> > actionListener="#{workOrder.fillSectionList}"/>
> >                 </tr:panelFormLayout>
> >             </tr:form>
> >     </ui:define>
> >
> > I have been working with Trinidad for a while now and have never been
> > able to get PPR of any kind other than the Dialog Framework to work.
> > I am thinking there must be something wrong with my configuration or
> > some other issue going on.
> >
> > Thanks for any help.
> >
> > -Brian
> >
> > ps If needed I can post my web.xml and faces-config
> >
> > On 5/24/07, *Luka Surija* < luka.surija@iytim.hr
> > <ma...@iytim.hr>> wrote:
> >
> >     your partial trigger is set to refresh the tr:panelBox, that
> >     means, only
> >     components inside tr:panelBox and the tr:panelBox will be updated.
> If
> >     you put partialTriggers="preview" in tr:form, then the text will
> >     be also
> >     updated.
> >
> >
> >     noah wrote:
> >     > Maybe I just don't understand how PPR is supposed to work.
> >     >
> >     > I have this page (Facelets, 1.2-07-apr-SNAPSHOT, 1.2 RI, FF 2):
> >     > <tr:document xmlns="http://www.w3.org/1999/xhtml"
> >     > xmlns:ui=" http://java.sun.com/jsf/facelets"
> >     > xmlns:f="http://java.sun.com/jsf/core"
> >     > xmlns:c="http://java.sun.com/jstl/core
> >     <http://java.sun.com/jstl/core>"
> >     > xmlns:tr="http://myfaces.apache.org/trinidad"
> >     > xmlns:h="http://java.sun.com/jsf/html" title="Trinidad Test">
> >     > <tr:form >
> >     >
> >     > <tr:panelBox background="transparent" partialTriggers="preview">
> >     > <h:outputText escape="false" value="#{pageFlowScope.text}" />
> >     > </tr:panelBox>
> >     >
> >     > <tr:inputText value="#{pageFlowScope.text}" columns="100"
> >     rows="25"/>
> >     >
> >     > <tr:commandButton id="preview" partialSubmit="true"
> >     text="Preview" />
> >     >
> >     > Text='#{pageFlowScope.text}'
> >     >
> >     > </tr:form>
> >     > </tr:document>
> >     >
> >     > Now I get the expected rendering. I get Text='' (i.e. no update)
> and
> >     > the panelBox is updated, but it's happening as a normal POST
> >     with full
> >     > page refresh. Have I done something wrong or is this the expected
> >     > behavior?
> >     >
> >
>
>

Re: [Trinidad] PPR - getting full page refresh instead of partialrefresh

Posted by Luka Surija <lu...@iytim.hr>.
This should work, as is. There must be something in your configuration 
file. You are using also seam? May be there is a problem.

Brian Smith wrote:
> I am also having problems with PPR.  I have followed every example but 
> just can't seem to get PPR to work.  I am using Facelets.  I have a 
> main template that uses a trh:body tag (required for PPR to work) to 
> enclose my content.
>
> Here is an example,  I am trying to create dependent selectOneInput 
> boxes.  I have placed a button on the form to submit the request 
> manually so I know the database logic is fine.
>
> <ui:define name="content">
>             <tr:form id="assignmentForm">
>                 <tr:panelFormLayout maxColumns="1">
>                     <tr:selectOneChoice id="department_input"
>                                         label="#{messages[' 
> Department.department']}"
>                                         value="#{department}"
>                                         
> valueChangeListener="#{workOrder.change}"
>                                         autosubmit="true">
>                         <s:selectItems label="#{dept.departmentNumber} 
> - #{dept.departmentName}"
>                                        
> value="#{allDepartments.resultList}"
>                                        var="dept" 
> noSelectionLabel="(None)"/>
>                     </tr:selectOneChoice>
>                     <tr:selectOneChoice id="departmentSection_input"
>                                         
> label="#{messages['Department.section ']}"
>                                         value="#{departmentSection}"
>                                         
> partialTriggers="department_input">
>                         <s:selectItems label="#{ sect.sectionName}"
>                                        value="#{sectionList}"
>                                        var="sect" 
> noSelectionLabel="(None)"/>
>                     </tr:selectOneChoice>
>                     <h:commandButton 
> actionListener="#{workOrder.fillSectionList}"/>
>                 </tr:panelFormLayout>
>             </tr:form>
>     </ui:define>
>
> I have been working with Trinidad for a while now and have never been 
> able to get PPR of any kind other than the Dialog Framework to work.  
> I am thinking there must be something wrong with my configuration or 
> some other issue going on.
>
> Thanks for any help.
>
> -Brian
>
> ps If needed I can post my web.xml and faces-config
>
> On 5/24/07, *Luka Surija* < luka.surija@iytim.hr 
> <ma...@iytim.hr>> wrote:
>
>     your partial trigger is set to refresh the tr:panelBox, that
>     means, only
>     components inside tr:panelBox and the tr:panelBox will be updated. If
>     you put partialTriggers="preview" in tr:form, then the text will
>     be also
>     updated.
>
>
>     noah wrote:
>     > Maybe I just don't understand how PPR is supposed to work.
>     >
>     > I have this page (Facelets, 1.2-07-apr-SNAPSHOT, 1.2 RI, FF 2):
>     > <tr:document xmlns="http://www.w3.org/1999/xhtml"
>     > xmlns:ui=" http://java.sun.com/jsf/facelets"
>     > xmlns:f="http://java.sun.com/jsf/core"
>     > xmlns:c="http://java.sun.com/jstl/core
>     <http://java.sun.com/jstl/core>"
>     > xmlns:tr="http://myfaces.apache.org/trinidad"
>     > xmlns:h="http://java.sun.com/jsf/html" title="Trinidad Test">
>     > <tr:form >
>     >
>     > <tr:panelBox background="transparent" partialTriggers="preview">
>     > <h:outputText escape="false" value="#{pageFlowScope.text}" />
>     > </tr:panelBox>
>     >
>     > <tr:inputText value="#{pageFlowScope.text}" columns="100"
>     rows="25"/>
>     >
>     > <tr:commandButton id="preview" partialSubmit="true"
>     text="Preview" />
>     >
>     > Text='#{pageFlowScope.text}'
>     >
>     > </tr:form>
>     > </tr:document>
>     >
>     > Now I get the expected rendering. I get Text='' (i.e. no update) and
>     > the panelBox is updated, but it's happening as a normal POST
>     with full
>     > page refresh. Have I done something wrong or is this the expected
>     > behavior?
>     >
>