cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew <andrewm...@gmail.com>
Subject Re: Matcher not catching ajax-request
Date Mon, 17 Jul 2006 14:02:15 GMT
Hi Slava,
I have done all of the following (an earlier email I sent about the
problem):

in my jx file:

<jx:import uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml
"/>
    <tableR>
        <ft:form-template action="creditCard.kont" id="Form1" method="POST"
ajax="true">

and in my sitemap doing:

1. <map:transformer name="browser-update" src="
org.apache.cocoon.ajax.BrowserUpdateTransformer"/> in map:transformers and:

2. <map:selector name="ajax-request" src="
org.apache.cocoon.ajax.AjaxRequestSelector"/> in my map:selectors

and my pipeline being defined as so:

            <map:match pattern="**viewform-*">
                <map:generate type="jx" src="jx/{2}_.jx"/>
                <map:transform type="browser-update"/>
                <map:transform type="forms"/>
                <map:transform type="i18n">
                  <map:parameter name="locale" value="en-US"/>
                </map:transform>
                <map:transform src="resources/forms-
advanced-field-styling2.xsl"/>
                <map:transform type="cinclude"/>
                <map:transform type="xslt-saxon"
src="style/CreditCardDetails.xsl"/>
                <map:transform type="cinclude"/>
                <map:transform type="i18n">
                  <map:parameter name="locale" value="en-US"/>
                </map:transform>
                <map:select type="ajax-request">
                  <map:when test="true">
                    <map:serialize type="xml"/>
                  </map:when>
                  <map:otherwise>
                    <map:serialize type="xhtml"/>
                  </map:otherwise>
                </map:select>
            </map:match>

when the form is submitted the whole page is submitted even when required
elements have not been validated successfully, which leads me to believe
that ajax is not happening, am I right? If so, what could be the cause of
the problem and how do I resolve it? My flow snippet is as follows:

    var form = new Form("forms/CreditCardDetails_.xml");
    //Load in credit card page
    form.showForm("viewform-CreditCardDetails", {"userGlobal":userGlobal});

I gained all the above information from the cocoon wiki concerning ajax
implementation:
http://cocoon.apache.org/2.1/userdocs/ajax.html


On 17/07/06, Slava Schmidt <S.Schmidt@projektinter.net> wrote:
>
> Hi Andrew,
>
> have you this import
>
> <jx:import
> uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml" />
>
> in your template?
>
> regards
>
> Slava
>
> Andrew wrote:
> > Hi Slava,
> > many thansk for your reply. I removed the transform element as you
> > mentioned, but when I submit a page for which there are required
> > elements which fail validation a full page reload still happens. This
> > should not happen right?
> >
> > regards
> >
> > Andrew
> >
> > On 17/07/06, *Slava Schmidt* <S.Schmidt@projektinter.net
> > <mailto:S.Schmidt@projektinter.net>> wrote:
> >
> >     Hi
> >
> >        <map:transform type="forms"/> should be removed.
> >
> >     Regards, Slava
> >
> >     Andrew wrote:
> >     > Hi,
> >     > could someone kindly help me in resolving this issue?! I have been
> >     > racking my brains for the last 3 days over this issue but seem to
> be
> >     > no closer in resolving it.
> >     >
> >     > regards
> >     >
> >     > Andrew
> >     >
> >     > On 14/07/06, *Andrew Madu* <andrewmadu@gmail.com
> >     <mailto:andrewmadu@gmail.com>
> >     > <mailto:andrewmadu@gmail.com <mailto:andrewmadu@gmail.com>>>
> wrote:
> >     >
> >     >     Any ideas, anyone?
> >     >
> >     >     regards
> >     >
> >     >     Andrew
> >     >
> >     >
> >     >     On 14/07/06, *Andrew Madu * <andrewmadu@gmail.com
> >     <mailto:andrewmadu@gmail.com>
> >     >     <mailto:andrewmadu@gmail.com <mailto:andrewmadu@gmail.com>>>
> >     wrote:
> >     >
> >     >         Hi,
> >     >         anyone got any ideas about this one?
> >     >
> >     >         regards
> >     >
> >     >         Andrew
> >     >
> >     >
> >     >         On 13/07/06, *Andrew Madu* < andrewmadu@gmail.com
> >     <mailto:andrewmadu@gmail.com>
> >     >         <mailto:andrewmadu@gmail.com
> >     <mailto:andrewmadu@gmail.com>>> wrote:
> >     >
> >     >             Hi,
> >     >             I have a cform with ajax="true" and in my sitemap I
> have
> >     >             the following matcher:
> >     >
> >     >                         <map:match pattern="**
> >     CreditCardDetails.xml">
> >     >                             <map:generate type="jx"
> >     >             src="jx/CreditCardDetails_.jx"/>
> >     >                             <map:transform type="browser-update"/>
> >     >                             <map:transform type="forms"/>
> >     >                             <map:transform type="i18n">
> >     >                               <map:parameter name="locale"
> >     >             value="en-US"/>
> >     >                             </map:transform>
> >     >                             <map:transform
> >     >             src="resources/forms-advanced-field-styling2.xsl "/>
> >     >                             <map:transform type="cinclude"/>
> >     >                             <map:transform type="xslt-saxon"
> >     >             src="style/CreditCardDetails.xsl"/>
> >     >                             <map:transform type="cinclude"/>
> >     >                             <map:transform type="i18n">
> >     >                               <map:parameter name="locale"
> >     >             value="en-US"/>
> >     >                             </map:transform>
> >     >                             <map:select type="ajax-request">
> >     >                               <map:when test="true">
> >     >                                 <map:serialize type="xml"/>
> >     >                               </map:when>
> >     >                               <map:otherwise>
> >     >                                 <map:serialize type="html"/>
> >     >                               </map:otherwise>
> >     >                             </map:select>
> >     >                         </map:match>
> >     >
> >     >             jx file:
> >     >             <ft:form-template action=" creditCard.kont" id="Form1"
> >     >             method="post" ajax="true">
> >     >
> >     >
> >     >             Now even though a value of true has been set in my
> >     ft:form
> >     >             tag the html serializer is still being selected.
> >     What is
> >     >             the issue here?
> >     >
> >     >             regards
> >     >
> >     >             Andrew
> >     >
> >     >
> >     >
> >     >
> >
> >
> >
> ---------------------------------------------------------------------
> >     To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >     <mailto:users-unsubscribe@cocoon.apache.org>
> >     For additional commands, e-mail: users-help@cocoon.apache.org
> >     <mailto:users-help@cocoon.apache.org>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Mime
View raw message