You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andrew <an...@gmail.com> on 2006/07/17 11:11:49 UTC

Cocoon-Ajax issue

Hi Simone,
Basically my problem is that after setting ajax="true" in my
ft:form-template and defining my jx-macros line:

<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 ajax-request never resolves to true, it
always fails and picks up the xhtml serializer, 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

regards

Andrew

Re: Cocoon-Ajax issue

Posted by Andrew <an...@gmail.com>.
Hi,
you may want to follow the thread:

XSL: match all elements except one section...
node()[not(self::login_fields)]

which I think is the solution to the problem I am having here.

regards

Andrew

On 19/07/06, Andrew <an...@gmail.com> wrote:
>
> Hi,
> I have noticed that if I place forms-sample-styling.xsl after my jxt line,
> in the sitemap, that it renders the form section properly...which leads me
> to believe that the issue I am having is with the ft:forms-template section
> trying to be transformed twice by the 2 stylesheets!:
>
>
>                 <map:generate type="jx" src="jx/{2}.jx"/>
>                 <map:transform type="browser-update"/>
>                 <map:transform type="xslt-saxon" src="style/{2}.xsl"/>
>                 <map:transform type="cinclude"/>
>
> ft:form-template in jx/{2}.jx, containing all widgets, is (partly?)
> transformed by style/{2}.xsl
>
>
>                 <map:transform type="i18n">
>                   <map:parameter name="locale" value="en-US"/>
>                 </map:transform>
>                 <map:transform src="template-style/forms-
> samples-styling.xsl"/>
>                 <map:transform type="i18n">
>                   <map:parameter name="locale" value="en-US"/>
>                 </map:transform>
>
> A second pass is made on the already, partly?, transformed
> ft:forms-template section. I say partly because all of the ft:form-template
> namesapce (plus all contents of) should only take place in
> forms-samples-styling.xsl. Does this make sense?
>
> Solution:
> style/{2}.xsl is my overall page design, whilst jx/{2}.jx is a subpart of
> that page. So, how to transform jx/{2}.jx, form/widgets, only by the second
> stylesheet transform forms-samples-styling.xsl? Is this possible? Is there
> a way to specify in the jx template that the contents are to be transformed
> by a specific stylesheet only?
>
>
> regards
>
> Andrew
>
> On 19/07/06, Andrew <an...@gmail.com> wrote:
> >
> > Hi,
> > in forms-samples-styling.xsl I came across the following comments:
> >
> >       <!--+ !!! If template with mode 'forms-page' adds text or elements
> >           |        template with mode 'forms-field' can no longer add
> > attributes!!!
> >           +-->
> >
> > Could this have any bearing on the ft:form-template section of my page
> > not processing properly?
> >
> > regards
> >
> > Andrew
> >
> >
> > On 19/07/06, Andrew <an...@gmail.com> wrote:
> > >
> > > Hi Mark,
> > >
> > > >
> > > > > Ok..,
> > > > > si i've managed to get the head elements working but now I can't
> > > > get
> > > > > the body elements to be processed by forms-samples-styling.xsl and
> > > > the
> > > > > html output I get for the jx part of the body section is:
> > > > > <snip...>
> > > >
> > > > Hi Andrew... OK, how do you know that <body> isn't being processed?
> > >
> > >
> > > The body in itself is being processed, but as I mentioned, the JX part
> > > of my page, which is the form itself, is not being processed properly at
> > > all.
> > >
> > > Also —what is the namespace for your form template elements?  Whatever
> > > > it's supposed to be, typically we use the prefix 'ft' to denote it,
> > > > so
> > > > I think we should not be seeing something <form-template> here... it
> > > >
> > > > would be <ft:form-template> if the document was somehow getting past
> > > > the forms stylesheets.
> > >
> > >
> > > The namespace I am using for the form is as per  convetion,
> > > <ft:form-template>, and the  html output,. as shown, reads as
> > > <form-template>. This I do not understand at all!
> > >
> > >  The result you posted looks as though you have
> > > > HTML elements and forms template elements are both in the default
> > > > namespace...?
> > >
> > >
> > >
> > > Yes I have some html  inside the form namespace. My XSL snippet is as
> > > sfollows:
> > >
> > >
> > > <?xml version="1.0" encoding="ISO-8859-1"?>
> > >
> > > <page
> > > xmlns:jx=" http://apache.org/cocoon/templates/jx/1.0"
> > > xmlns:cinclude=" http://apache.org/cocoon/include/1.0"
> > > xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
> > > xmlns:fi=" http://apache.org/cocoon/forms/1.0#instance ">
> > >
> > > <jx:import uri="resource://org/apache/cocoon/forms/generation/jx-
> > > macros.xml"/>
> > >     <login_fields>
> > >         <jx:choose>
> > >           <jx:when test="${userGlobal==null}">
> > >               <ft:form-template action="login.kont" name="Form1"
> > > method="POST" ajax="true">
> > >                 <ft:continuation-id/>
> > >                    <div id="output">
> > >                     <table border="0" cellspacing="0" cellpadding="0">
> > >                         <tr>
> > >                           <td width="55" valign="bottom"><img
> > > src="images/user.gif" width="55" height="16" /></td>
> > >                           <td width="220" valign="top">
> > >                             <fi:group>
> > >                                   <fi:styling type="tabs"/>
> > >                                       <fi:state>
> > >                                           <ft:widget id="activetab" />
> > >                                       </fi:state>
> > >                                       <fi:items>
> > >                                           <ft:widget id="username">
> > >                                               <fi:styling size="30"
> > > type="text" class="keyinbox"/>
> > >                                           </ft:widget>
> > >                                       </fi:items>
> > >                             </fi:group>
> > >                           </td>
> > >                         </tr>
> > >                       </table>
> > >                       <table border="0" cellspacing="0"
> > > cellpadding="0">
> > >                         <tr>
> > >                           <td width="55" valign="bottom"><img
> > > src="images/passwords.gif" width="89" height="16" /></td>
> > >                           <td width="220" valign="top">
> > >                             <fi:group>
> > >                                   <fi:styling type="tabs" />
> > >                                       <fi:state>
> > >                                           <ft:widget id="activetab" />
> > >                                       </fi:state>
> > >                                       <fi:items>
> > >                                           <ft:widget id="password">
> > >                                               <fi:styling size="30"
> > > type="password" class="keyinbox"/>
> > >                                           </ft:widget>
> > >                                       </fi:items>
> > >                             </fi:group>
> > >                           </td>
> > >                         </tr>
> > >                       </table>
> > >                       <table border="0" cellspacing="0"
> > > cellpadding="0">
> > >                         <tr>
> > >                           <td colspan="6" align="right"><img
> > > src="images/tool.gif" width="2" border="0" height="5" /></td>
> > >                         </tr>
> > >                         <tr>
> > >                           <td><img src="images/tool.gif" width="3"
> > > border="0" height="1" /></td>
> > >                           <td width="55" valign="bottom"
> > > class="indextext"><img src="captcha.jpeg" /></td>
> > >                           <td width="220" valign="top">
> > >                               <table border="0" cellspacing="0"
> > > cellpadding="0">
> > >                               <tr>
> > >                                   <td><img src="images/tool.gif"
> > > width="3" border="0" height="1" /></td>
> > >                                   <td valign="top">
> > >                                     <fi:group>
> > >                                           <fi:styling type="tabs"/>
> > >                                               <fi:state>
> > >                                                   <ft:widget
> > > id="activetab" />
> > >                                               </fi:state>
> > >                                               <fi:items>
> > >                                                   <ft:widget
> > > id="captcha_code">
> > >                                                       <fi:styling
> > > listbox-size="30" type="text" class="keyinbox"/>
> > >                                                   </ft:widget>
> > >                                               </fi:items>
> > >                                     </fi:group>
> > >                                   </td>
> > >                               </tr>
> > >                               </table>
> > >                           </td>
> > >                         </tr>
> > >                       </table>
> > >                       <table width="100%" border="0" cellspacing="0"
> > > cellpadding="0">
> > >                         <tr>
> > >                           <td colspan="6" align="right"><img
> > > src="images/tool.gif" width="2" border="0" height="10" /></td>
> > >                         </tr>
> > >                         <tr>
> > >                           <td align="right">
> > >                           <table width="100%" cellpadding="0"
> > > cellspacing="0" border="0">
> > >                           <tr>
> > >                               <td align="left" valign="bottom"
> > > class="indextext"><a href="javascript:popup('sendDetailsPopUp.xml','${userGlobal}')">&#160;Forgotten
> > > your Password?</a></td>
> > >                               <td align="right"><img
> > > src="images/plus.gif" width="8" height="14" /></td>
> > >                           </tr>
> > >                           </table>
> > >                           </td>
> > >                           <td width="8" align="left"><img
> > > src="images/plus.gif" width="8" height="14" /></td>
> > >                           <td width="42" align="left"><a
> > > href="javascript:formSubmit(document.Form1)"
> > > onMouseOut="MM_swapImgRestore()"
> > > onMouseOver="MM_swapImage('sumit','','images/sumit- over.gif',1)"><img
> > > src="images/sumit-none.gif" alt="sumit" name="sumit" width="42"
> > > height="15" border="0" /></a></td>
> > >                           <td width="42" align="center"
> > > valign="middle"><a href="javascript:formReset( document.Form1)"
> > > onMouseOut="MM_swapImgRestore()"
> > > onMouseOver="MM_swapImage('cancel','','images/cancel-over.gif',1)"><img
> > > src="images/cancel-none.gif" alt="cancel" name="cancel" width="42"
> > > height="15" border="0" /></a></td>
> > >                           <td width="20" align="center"
> > > valign="middle"><img src="images/tool.gif" width="20" height="8" /></td>
> > >                         </tr>
> > >                       </table>
> > >                 </div>
> > >               </ft:form-template>
> > >             </jx:when>
> > >
> > > regards
> > >
> > > Andrew
> > >
> > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > > For additional commands, e-mail: users-help@cocoon.apache.org
> > > >
> > > >
> > >
> >
>

Re: Cocoon-Ajax issue

Posted by Andrew <an...@gmail.com>.
Hi,
I have noticed that if I place forms-sample-styling.xsl after my jxt line,
in the sitemap, that it renders the form section properly...which leads me
to believe that the issue I am having is with the ft:forms-template section
trying to be transformed twice by the 2 stylesheets!:

                <map:generate type="jx" src="jx/{2}.jx"/>
                <map:transform type="browser-update"/>
                <map:transform type="xslt-saxon" src="style/{2}.xsl"/>
                <map:transform type="cinclude"/>

ft:form-template in jx/{2}.jx, containing all widgets, is (partly?)
transformed by style/{2}.xsl

                <map:transform type="i18n">
                  <map:parameter name="locale" value="en-US"/>
                </map:transform>
                <map:transform src="template-style/forms-samples-styling.xsl
"/>
                <map:transform type="i18n">
                  <map:parameter name="locale" value="en-US"/>
                </map:transform>

A second pass is made on the already, partly?, transformed ft:forms-template
section. I say partly because all of the ft:form-template namesapce (plus
all contents of) should only take place in forms-samples-styling.xsl. Does
this make sense?

Solution:
style/{2}.xsl is my overall page design, whilst jx/{2}.jx is a subpart of
that page. So, how to transform jx/{2}.jx, form/widgets, only by the second
stylesheet transform forms-samples-styling.xsl? Is this possible? Is there a
way to specify in the jx template that the contents are to be transformed by
a specific stylesheet only?

regards

Andrew

On 19/07/06, Andrew <an...@gmail.com> wrote:
>
> Hi,
> in forms-samples-styling.xsl I came across the following comments:
>
>       <!--+ !!! If template with mode 'forms-page' adds text or elements
>           |        template with mode 'forms-field' can no longer add
> attributes!!!
>           +-->
>
> Could this have any bearing on the ft:form-template section of my page not
> processing properly?
>
> regards
>
> Andrew
>
>
> On 19/07/06, Andrew <an...@gmail.com> wrote:
> >
> > Hi Mark,
> >
> > >
> > > > Ok..,
> > > > si i've managed to get the head elements working but now I can't get
> > >
> > > > the body elements to be processed by forms-samples-styling.xsl and
> > > the
> > > > html output I get for the jx part of the body section is:
> > > > <snip...>
> > >
> > > Hi Andrew... OK, how do you know that <body> isn't being processed?
> >
> >
> > The body in itself is being processed, but as I mentioned, the JX part
> > of my page, which is the form itself, is not being processed properly at
> > all.
> >
> > Also —what is the namespace for your form template elements?  Whatever
> > > it's supposed to be, typically we use the prefix 'ft' to denote it, so
> > > I think we should not be seeing something <form-template> here... it
> > > would be <ft:form-template> if the document was somehow getting past
> > > the forms stylesheets.
> >
> >
> > The namespace I am using for the form is as per  convetion,
> > <ft:form-template>, and the  html output,. as shown, reads as
> > <form-template>. This I do not understand at all!
> >
> >  The result you posted looks as though you have
> > > HTML elements and forms template elements are both in the default
> > > namespace...?
> >
> >
> >
> > Yes I have some html  inside the form namespace. My XSL snippet is as
> > sfollows:
> >
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> >
> > <page
> > xmlns:jx=" http://apache.org/cocoon/templates/jx/1.0"
> > xmlns:cinclude=" http://apache.org/cocoon/include/1.0"
> > xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
> > xmlns:fi=" http://apache.org/cocoon/forms/1.0#instance ">
> >
> > <jx:import uri="resource://org/apache/cocoon/forms/generation/jx-
> > macros.xml"/>
> >     <login_fields>
> >         <jx:choose>
> >           <jx:when test="${userGlobal==null}">
> >               <ft:form-template action="login.kont" name="Form1"
> > method="POST" ajax="true">
> >                 <ft:continuation-id/>
> >                    <div id="output">
> >                     <table border="0" cellspacing="0" cellpadding="0">
> >                         <tr>
> >                           <td width="55" valign="bottom"><img
> > src="images/user.gif" width="55" height="16" /></td>
> >                           <td width="220" valign="top">
> >                             <fi:group>
> >                                   <fi:styling type="tabs"/>
> >                                       <fi:state>
> >                                           <ft:widget id="activetab" />
> >                                       </fi:state>
> >                                       <fi:items>
> >                                           <ft:widget id="username">
> >                                               <fi:styling size="30"
> > type="text" class="keyinbox"/>
> >                                           </ft:widget>
> >                                       </fi:items>
> >                             </fi:group>
> >                           </td>
> >                         </tr>
> >                       </table>
> >                       <table border="0" cellspacing="0" cellpadding="0">
> >
> >                         <tr>
> >                           <td width="55" valign="bottom"><img
> > src="images/passwords.gif" width="89" height="16" /></td>
> >                           <td width="220" valign="top">
> >                             <fi:group>
> >                                   <fi:styling type="tabs" />
> >                                       <fi:state>
> >                                           <ft:widget id="activetab" />
> >                                       </fi:state>
> >                                       <fi:items>
> >                                           <ft:widget id="password">
> >                                               <fi:styling size="30"
> > type="password" class="keyinbox"/>
> >                                           </ft:widget>
> >                                       </fi:items>
> >                             </fi:group>
> >                           </td>
> >                         </tr>
> >                       </table>
> >                       <table border="0" cellspacing="0" cellpadding="0">
> >
> >                         <tr>
> >                           <td colspan="6" align="right"><img
> > src="images/tool.gif" width="2" border="0" height="5" /></td>
> >                         </tr>
> >                         <tr>
> >                           <td><img src="images/tool.gif" width="3"
> > border="0" height="1" /></td>
> >                           <td width="55" valign="bottom"
> > class="indextext"><img src="captcha.jpeg" /></td>
> >                           <td width="220" valign="top">
> >                               <table border="0" cellspacing="0"
> > cellpadding="0">
> >                               <tr>
> >                                   <td><img src="images/tool.gif"
> > width="3" border="0" height="1" /></td>
> >                                   <td valign="top">
> >                                     <fi:group>
> >                                           <fi:styling type="tabs"/>
> >                                               <fi:state>
> >                                                   <ft:widget
> > id="activetab" />
> >                                               </fi:state>
> >                                               <fi:items>
> >                                                   <ft:widget
> > id="captcha_code">
> >                                                       <fi:styling
> > listbox-size="30" type="text" class="keyinbox"/>
> >                                                   </ft:widget>
> >                                               </fi:items>
> >                                     </fi:group>
> >                                   </td>
> >                               </tr>
> >                               </table>
> >                           </td>
> >                         </tr>
> >                       </table>
> >                       <table width="100%" border="0" cellspacing="0"
> > cellpadding="0">
> >                         <tr>
> >                           <td colspan="6" align="right"><img
> > src="images/tool.gif" width="2" border="0" height="10" /></td>
> >                         </tr>
> >                         <tr>
> >                           <td align="right">
> >                           <table width="100%" cellpadding="0"
> > cellspacing="0" border="0">
> >                           <tr>
> >                               <td align="left" valign="bottom"
> > class="indextext"><a href="javascript:popup('sendDetailsPopUp.xml','${userGlobal}')">&#160;Forgotten
> > your Password?</a></td>
> >                               <td align="right"><img
> > src="images/plus.gif" width="8" height="14" /></td>
> >                           </tr>
> >                           </table>
> >                           </td>
> >                           <td width="8" align="left"><img
> > src="images/plus.gif" width="8" height="14" /></td>
> >                           <td width="42" align="left"><a
> > href="javascript:formSubmit(document.Form1)"
> > onMouseOut="MM_swapImgRestore()"
> > onMouseOver="MM_swapImage('sumit','','images/sumit- over.gif',1)"><img
> > src="images/sumit-none.gif" alt="sumit" name="sumit" width="42"
> > height="15" border="0" /></a></td>
> >                           <td width="42" align="center"
> > valign="middle"><a href="javascript:formReset( document.Form1)"
> > onMouseOut="MM_swapImgRestore()"
> > onMouseOver="MM_swapImage('cancel','','images/cancel-over.gif',1)"><img
> > src="images/cancel-none.gif" alt="cancel" name="cancel" width="42"
> > height="15" border="0" /></a></td>
> >                           <td width="20" align="center"
> > valign="middle"><img src="images/tool.gif" width="20" height="8" /></td>
> >                         </tr>
> >                       </table>
> >                 </div>
> >               </ft:form-template>
> >             </jx:when>
> >
> > regards
> >
> > Andrew
> >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > For additional commands, e-mail: users-help@cocoon.apache.org
> > >
> > >
> >
>

Re: Cocoon-Ajax issue

Posted by Andrew <an...@gmail.com>.
Hi,
in forms-samples-styling.xsl I came across the following comments:

      <!--+ !!! If template with mode 'forms-page' adds text or elements
          |        template with mode 'forms-field' can no longer add
attributes!!!
          +-->

Could this have any bearing on the ft:form-template section of my page not
processing properly?

regards

Andrew

On 19/07/06, Andrew <an...@gmail.com> wrote:
>
> Hi Mark,
>
> >
> > > Ok..,
> > > si i've managed to get the head elements working but now I can't get
> > > the body elements to be processed by forms-samples-styling.xsl and the
> > > html output I get for the jx part of the body section is:
> > > <snip...>
> >
> > Hi Andrew... OK, how do you know that <body> isn't being processed?
>
>
> The body in itself is being processed, but as I mentioned, the JX part of
> my page, which is the form itself, is not being processed properly at all.
>
> Also —what is the namespace for your form template elements?  Whatever
> > it's supposed to be, typically we use the prefix 'ft' to denote it, so
> > I think we should not be seeing something <form-template> here... it
> > would be <ft:form-template> if the document was somehow getting past
> > the forms stylesheets.
>
>
> The namespace I am using for the form is as per  convetion,
> <ft:form-template>, and the  html output,. as shown, reads as
> <form-template>. This I do not understand at all!
>
>  The result you posted looks as though you have
> > HTML elements and forms template elements are both in the default
> > namespace...?
>
>
>
> Yes I have some html  inside the form namespace. My XSL snippet is as
> sfollows:
>
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <page
> xmlns:jx=" http://apache.org/cocoon/templates/jx/1.0"
> xmlns:cinclude="http://apache.org/cocoon/include/1.0"
> xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
> xmlns:fi="http://apache.org/cocoon/forms/1.0#instance ">
>
> <jx:import uri="resource://org/apache/cocoon/forms/generation/jx-
> macros.xml"/>
>     <login_fields>
>         <jx:choose>
>           <jx:when test="${userGlobal==null}">
>               <ft:form-template action="login.kont" name="Form1"
> method="POST" ajax="true">
>                 <ft:continuation-id/>
>                    <div id="output">
>                     <table border="0" cellspacing="0" cellpadding="0">
>                         <tr>
>                           <td width="55" valign="bottom"><img
> src="images/user.gif" width="55" height="16" /></td>
>                           <td width="220" valign="top">
>                             <fi:group>
>                                   <fi:styling type="tabs"/>
>                                       <fi:state>
>                                           <ft:widget id="activetab" />
>                                       </fi:state>
>                                       <fi:items>
>                                           <ft:widget id="username">
>                                               <fi:styling size="30"
> type="text" class="keyinbox"/>
>                                           </ft:widget>
>                                       </fi:items>
>                             </fi:group>
>                           </td>
>                         </tr>
>                       </table>
>                       <table border="0" cellspacing="0" cellpadding="0">
>                         <tr>
>                           <td width="55" valign="bottom"><img
> src="images/passwords.gif" width="89" height="16" /></td>
>                           <td width="220" valign="top">
>                             <fi:group>
>                                   <fi:styling type="tabs" />
>                                       <fi:state>
>                                           <ft:widget id="activetab" />
>                                       </fi:state>
>                                       <fi:items>
>                                           <ft:widget id="password">
>                                               <fi:styling size="30"
> type="password" class="keyinbox"/>
>                                           </ft:widget>
>                                       </fi:items>
>                             </fi:group>
>                           </td>
>                         </tr>
>                       </table>
>                       <table border="0" cellspacing="0" cellpadding="0">
>                         <tr>
>                           <td colspan="6" align="right"><img
> src="images/tool.gif" width="2" border="0" height="5" /></td>
>                         </tr>
>                         <tr>
>                           <td><img src="images/tool.gif" width="3"
> border="0" height="1" /></td>
>                           <td width="55" valign="bottom"
> class="indextext"><img src="captcha.jpeg" /></td>
>                           <td width="220" valign="top">
>                               <table border="0" cellspacing="0"
> cellpadding="0">
>                               <tr>
>                                   <td><img src="images/tool.gif" width="3"
> border="0" height="1" /></td>
>                                   <td valign="top">
>                                     <fi:group>
>                                           <fi:styling type="tabs"/>
>                                               <fi:state>
>                                                   <ft:widget
> id="activetab" />
>                                               </fi:state>
>                                               <fi:items>
>                                                   <ft:widget
> id="captcha_code">
>                                                       <fi:styling
> listbox-size="30" type="text" class="keyinbox"/>
>                                                   </ft:widget>
>                                               </fi:items>
>                                     </fi:group>
>                                   </td>
>                               </tr>
>                               </table>
>                           </td>
>                         </tr>
>                       </table>
>                       <table width="100%" border="0" cellspacing="0"
> cellpadding="0">
>                         <tr>
>                           <td colspan="6" align="right"><img
> src="images/tool.gif" width="2" border="0" height="10" /></td>
>                         </tr>
>                         <tr>
>                           <td align="right">
>                           <table width="100%" cellpadding="0"
> cellspacing="0" border="0">
>                           <tr>
>                               <td align="left" valign="bottom"
> class="indextext"><a href="javascript:popup('sendDetailsPopUp.xml','${userGlobal}')">&#160;Forgotten
> your Password?</a></td>
>                               <td align="right"><img src="images/plus.gif"
> width="8" height="14" /></td>
>                           </tr>
>                           </table>
>                           </td>
>                           <td width="8" align="left"><img
> src="images/plus.gif" width="8" height="14" /></td>
>                           <td width="42" align="left"><a
> href="javascript:formSubmit(document.Form1)"
> onMouseOut="MM_swapImgRestore()"
> onMouseOver="MM_swapImage('sumit','','images/sumit- over.gif',1)"><img
> src="images/sumit-none.gif" alt="sumit" name="sumit" width="42"
> height="15" border="0" /></a></td>
>                           <td width="42" align="center" valign="middle"><a
> href="javascript:formReset( document.Form1)"
> onMouseOut="MM_swapImgRestore()"
> onMouseOver="MM_swapImage('cancel','','images/cancel-over.gif',1)"><img
> src="images/cancel-none.gif" alt="cancel" name="cancel" width="42"
> height="15" border="0" /></a></td>
>                           <td width="20" align="center"
> valign="middle"><img src="images/tool.gif" width="20" height="8" /></td>
>                         </tr>
>                       </table>
>                 </div>
>               </ft:form-template>
>             </jx:when>
>
> regards
>
> Andrew
>
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>

Re: Cocoon-Ajax issue

Posted by Andrew <an...@gmail.com>.
Hi Mark,

>
> > Ok..,
> > si i've managed to get the head elements working but now I can't get
> > the body elements to be processed by forms-samples-styling.xsl and the
> > html output I get for the jx part of the body section is:
> > <snip...>
>
> Hi Andrew... OK, how do you know that <body> isn't being processed?


The body in itself is being processed, but as I mentioned, the JX part of my
page, which is the form itself, is not being processed properly at all.

Also —what is the namespace for your form template elements?  Whatever
> it's supposed to be, typically we use the prefix 'ft' to denote it, so
> I think we should not be seeing something <form-template> here... it
> would be <ft:form-template> if the document was somehow getting past
> the forms stylesheets.


The namespace I am using for the form is as per  convetion,
<ft:form-template>, and the  html output,. as shown, reads as
<form-template>. This I do not understand at all!

 The result you posted looks as though you have
> HTML elements and forms template elements are both in the default
> namespace...?



Yes I have some html  inside the form namespace. My XSL snippet is as
sfollows:

<?xml version="1.0" encoding="ISO-8859-1"?>

<page
xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
xmlns:cinclude="http://apache.org/cocoon/include/1.0"
xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
xmlns:fi="http://apache.org/cocoon/forms/1.0#instance">

<jx:import uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml
"/>
    <login_fields>
        <jx:choose>
          <jx:when test="${userGlobal==null}">
              <ft:form-template action="login.kont" name="Form1"
method="POST" ajax="true">
                <ft:continuation-id/>
                   <div id="output">
                    <table border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="55" valign="bottom"><img
src="images/user.gif" width="55" height="16" /></td>
                          <td width="220" valign="top">
                            <fi:group>
                                  <fi:styling type="tabs"/>
                                      <fi:state>
                                          <ft:widget id="activetab" />
                                      </fi:state>
                                      <fi:items>
                                          <ft:widget id="username">
                                              <fi:styling size="30"
type="text" class="keyinbox"/>
                                          </ft:widget>
                                      </fi:items>
                            </fi:group>
                          </td>
                        </tr>
                      </table>
                      <table border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="55" valign="bottom"><img
src="images/passwords.gif" width="89" height="16" /></td>
                          <td width="220" valign="top">
                            <fi:group>
                                  <fi:styling type="tabs" />
                                      <fi:state>
                                          <ft:widget id="activetab" />
                                      </fi:state>
                                      <fi:items>
                                          <ft:widget id="password">
                                              <fi:styling size="30"
type="password" class="keyinbox"/>
                                          </ft:widget>
                                      </fi:items>
                            </fi:group>
                          </td>
                        </tr>
                      </table>
                      <table border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td colspan="6" align="right"><img
src="images/tool.gif" width="2" border="0" height="5" /></td>
                        </tr>
                        <tr>
                          <td><img src="images/tool.gif" width="3"
border="0" height="1" /></td>
                          <td width="55" valign="bottom"
class="indextext"><img src="captcha.jpeg" /></td>
                          <td width="220" valign="top">
                              <table border="0" cellspacing="0"
cellpadding="0">
                              <tr>
                                  <td><img src="images/tool.gif" width="3"
border="0" height="1" /></td>
                                  <td valign="top">
                                    <fi:group>
                                          <fi:styling type="tabs"/>
                                              <fi:state>
                                                  <ft:widget id="activetab"
/>
                                              </fi:state>
                                              <fi:items>
                                                  <ft:widget
id="captcha_code">
                                                      <fi:styling
listbox-size="30" type="text" class="keyinbox"/>
                                                  </ft:widget>
                                              </fi:items>
                                    </fi:group>
                                  </td>
                              </tr>
                              </table>
                          </td>
                        </tr>
                      </table>
                      <table width="100%" border="0" cellspacing="0"
cellpadding="0">
                        <tr>
                          <td colspan="6" align="right"><img
src="images/tool.gif" width="2" border="0" height="10" /></td>
                        </tr>
                        <tr>
                          <td align="right">
                          <table width="100%" cellpadding="0"
cellspacing="0" border="0">
                          <tr>
                              <td align="left" valign="bottom"
class="indextext"><a
href="javascript:popup('sendDetailsPopUp.xml','${userGlobal}')">&#160;Forgotten
your Password?</a></td>
                              <td align="right"><img src="images/plus.gif"
width="8" height="14" /></td>
                          </tr>
                          </table>
                          </td>
                          <td width="8" align="left"><img
src="images/plus.gif" width="8" height="14" /></td>
                          <td width="42" align="left"><a
href="javascript:formSubmit(document.Form1)"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('sumit','','images/sumit-over.gif',1)"><img
src="images/sumit-none.gif" alt="sumit" name="sumit" width="42" height="15"
border="0" /></a></td>
                          <td width="42" align="center" valign="middle"><a
href="javascript:formReset(document.Form1)" onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('cancel','','images/cancel-over.gif',1)"><img
src="images/cancel-none.gif" alt="cancel" name="cancel" width="42"
height="15" border="0" /></a></td>
                          <td width="20" align="center" valign="middle"><img
src="images/tool.gif" width="20" height="8" /></td>
                        </tr>
                      </table>
                </div>
              </ft:form-template>
            </jx:when>

regards

Andrew

---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Cocoon-Ajax issue

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jul 18, 2006, at 12:11 PM, Andrew wrote:

> Ok..,
> si i've managed to get the head elements working but now I can't get 
> the body elements to be processed by forms-samples-styling.xsl and the 
> html output I get for the jx part of the body section is:
> <snip...>

Hi Andrew... OK, how do you know that <body> isn't being processed?

Also — what is the namespace for your form template elements?  Whatever 
it's supposed to be, typically we use the prefix 'ft' to denote it, so 
I think we should not be seeing something <form-template> here... it 
would be <ft:form-template> if the document was somehow getting past 
the forms stylesheets.  The result you posted looks as though you have 
HTML elements and forms template elements are both in the default 
namespace...?

peace,
—ml—


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon-Ajax issue

Posted by Andrew <an...@gmail.com>.
Ok..,
si i've managed to get the head elements working but now I can't get the
body elements to be processed by forms-samples-styling.xsl and the html
output I get for the jx part of the body section is:

<body
.........

<form-template action="login.kont" ajax="true" name="Form1" method="POST">
     <continuation-id>2f100f7a6b895a7f583278820a44736b7a7b465f</continuation-id>
       <div id="output">
	<table border="0" cellspacing="0" cellpadding="0">

	<tr>
	<td width="55" valign="bottom"><img src="images/user.gif" width="55"
height="16" /></td>
	<td width="220" valign="top">
	<group>
	<styling type="tabs" />
	<state>
        <field id="activetab" state="active"
required="false"><datatype type="integer" /></field>
         </state>

	<items>
	<field id="username" state="active" required="true"><datatype type="string" />
        <styling size="30" type="text" class="keyinbox" /></field>
        </items>
	</group>
	</td>
	</tr>
	</table>

.........

	</div>		
        </form-template>
        </body>

What is going on here?!?!

regards

Andrew

p.s. Once again, my sitemap is:

            <map:match pattern="**viewform-*">
                <map:generate type="jx" src="jx/{2}.jx"/>
                <map:transform type="browser-update"/>
                <!--<map:transform type="forms"/>-->
                <map:transform type="xslt-saxon" src="style/{2}.xsl"/>
                <map:transform type="cinclude"/>
                <map:transform type="i18n">
                  <map:parameter name="locale" value="en-US"/>
                </map:transform>
                <map:transform src="template-style/forms-samples-styling.xsl
"/>
                <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>

and my jx page is:

<page
xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
xmlns:cinclude="http://apache.org/cocoon/include/1.0"
xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
xmlns:fi="http://apache.org/cocoon/forms/1.0#instance">

<jx:import uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml
"/>
    <login_fields>
        <jx:choose>
          <jx:when test="${userGlobal==null}">
              <ft:form-template action="login.kont" name="Form1"
method="POST" ajax="true">
                <ft:continuation-id/>
                   <div id="output">
                    <table border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="55" valign="bottom"><img
src="images/user.gif" width="55" height="16" /></td>
                          <td width="220" valign="top">
                            <fi:group>
                                  <fi:styling type="tabs"/>
                                      <fi:state>
                                          <ft:widget id="activetab" />
                                      </fi:state>
                                      <fi:items>
                                          <ft:widget id="username">
                                              <fi:styling size="30"
type="text" class="keyinbox"/>
                                          </ft:widget>
                                      </fi:items>
                            </fi:group>
                          </td>
                        </tr>
                      </table>
                      <table border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="55" valign="bottom"><img
src="images/passwords.gif" width="89" height="16" /></td>
                          <td width="220" valign="top">
                            <fi:group>
                                  <fi:styling type="tabs" />
                                      <fi:state>
                                          <ft:widget id="activetab" />
                                      </fi:state>
                                      <fi:items>
                                          <ft:widget id="password">
                                              <fi:styling size="30"
type="password" class="keyinbox"/>
                                          </ft:widget>
                                      </fi:items>
                            </fi:group>
                          </td>
                        </tr>
                      </table>
                      <table border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td colspan="6" align="right"><img
src="images/tool.gif" width="2" border="0" height="5" /></td>
                        </tr>
                        <tr>
                          <td><img src="images/tool.gif" width="3"
border="0" height="1" /></td>
                          <td width="55" valign="bottom"
class="indextext"><img src="captcha.jpeg" /></td>
                          <td width="220" valign="top">
                              <table border="0" cellspacing="0"
cellpadding="0">
                              <tr>
                                  <td><img src="images/tool.gif" width="3"
border="0" height="1" /></td>
                                  <td valign="top">
                                    <fi:group>
                                          <fi:styling type="tabs"/>
                                              <fi:state>
                                                  <ft:widget id="activetab"
/>
                                              </fi:state>
                                              <fi:items>
                                                  <ft:widget
id="captcha_code">
                                                      <fi:styling
listbox-size="30" type="text" class="keyinbox"/>
                                                  </ft:widget>
                                              </fi:items>
                                    </fi:group>
                                  </td>
                              </tr>
                              </table>
                          </td>
                        </tr>
                      </table>
                      <table width="100%" border="0" cellspacing="0"
cellpadding="0">
                        <tr>
                          <td colspan="6" align="right"><img
src="images/tool.gif" width="2" border="0" height="10" /></td>
                        </tr>
                        <tr>
                          <td align="right">
                          <table width="100%" cellpadding="0"
cellspacing="0" border="0">
                          <tr>
                              <td align="left" valign="bottom"
class="indextext"><a
href="javascript:popup('sendDetailsPopUp.xml','${userGlobal}')">&#160;Forgotten
your Password?</a></td>
                              <td align="right"><img src="images/plus.gif"
width="8" height="14" /></td>
                          </tr>
                          </table>
                          </td>
                          <td width="8" align="left"><img
src="images/plus.gif" width="8" height="14" /></td>
                          <td width="42" align="left"><a
href="javascript:formSubmit(document.Form1)"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('sumit','','images/sumit-over.gif',1)"><img
src="images/sumit-none.gif" alt="sumit" name="sumit" width="42" height="15"
border="0" /></a></td>
                          <td width="42" align="center" valign="middle"><a
href="javascript:formReset(document.Form1)" onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('cancel','','images/cancel-over.gif',1)"><img
src="images/cancel-none.gif" alt="cancel" name="cancel" width="42"
height="15" border="0" /></a></td>
                          <td width="20" align="center" valign="middle"><img
src="images/tool.gif" width="20" height="8" /></td>
                        </tr>
                      </table>
                </div>
              </ft:form-template>
            </jx:when>

regards

Andrew



On 18/07/06, Andrew <an...@gmail.com> wrote:
>
> Hi Mark,
> you are understanding the question very well ;-) The head section of my
> XSLT file never matches with the head matacher in forms-samples-style.xsland as a result none of the require ajax/dojo script code is wrtten to the
> head area of my code. My sitemap pipe is as follows:
>
>
>             <map:match pattern="**viewform-*">
>                 <map:generate type="jx" src="jx/{2}.jx"/>
>                 <map:transform type="forms"/>
>                 <map:transform type="browser-update"/>
>                 <map:transform type="i18n">
>                   <map:parameter name="locale" value="en-US"/>
>                 </map:transform>
>                 <map:transform type="xslt-saxon" src="style/{2}.xsl"/>
>                 <map:transform type="cinclude"/>
>                 <map:transform src="template-style/forms-
> samples-styling.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>
>
> and my xsl file is as follows:
>
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>     <xsl:stylesheet version="1.0"
>         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>         xmlns:cinclude=" http://apache.org/cocoon/include/1.0">
>         <xsl:template match="/">
>           <page>
>                 <head>
>                     <title>beyaRecords - Home Page</title>
>                     <link rel="stylesheet" type="text/css">
>                         <xsl:attribute
> name="href">stylesheets/beya.css</xsl:attribute>
>                         <xsl:attribute name="media">all</xsl:attribute>
>                     </link>
>
>                     <link rel="stylesheet" type="text/css">
>                         <xsl:attribute
> name="href">stylesheets/style.css</xsl:attribute>
>                         <xsl:attribute name="media">all</xsl:attribute>
>                     </link>
>
>                     <script>
>                         <xsl:attribute
> name="type">text/javascript</xsl:attribute>
>                         <xsl:attribute
> name="src">js_files/upwarddownward.js</xsl:attribute>
>                     </script>
>
>                     <script>
>                         <xsl:attribute
> name="type">text/javascript</xsl:attribute>
>                         <xsl:attribute
> name="src">js_files/form.js</xsl:attribute>
>                     </script>
>
>                 </head>
>             <body leftmargin="0" marginheight="0" topmargin="0"
> marginwidth="0"
> onload="InitialiseScrollableArea();preloadImages('images/scroller_up_on.gif','images/scroller_down_on.gif');MM_swapImage('images/sumit-
> over.gif','images/cancel-over.gif','images/emaillink-over.gif')">
>             <script>
>                 <xsl:attribute name="type">text/javascript</xsl:attribute>
>                 <xsl:attribute
> name="src">js_files/reload.js</xsl:attribute>
>             </script>
>             <table width="1024" border="0" cellspacing="0"
> cellpadding="0">
>             <tr>
>               <td width="221" rowspan="3"><img src="images/bgleft1.jpg"
> width="222" height="460" /></td>
>               <td colspan="4" background="images/bg1.gif" class="bgcol"
> width="583"><xsl:apply-templates select="//menu"/></td>
>               <td width="220" rowspan="3"><img src="images/bgright1.gif"
> width="220" height="460" /></td>
>             </tr>
>             <tr>
>               <td width="18" class="bgcol"><img src="images/tool.gif"
> width="18" height="365" /></td>
>               <td width="301" valign="top" class="bgcol">
>               <table width="261" border="0" cellspacing="0"
> cellpadding="0">
>                   <tr>
>                     <td><img src="images/tool.gif" width="20" height="16"
> /></td>
>                   </tr>
>                   <xsl:apply-templates select="//new_music"/>
>                   <tr>
>                     <td><img src="images/tool.gif" width="20" height="5"
> /></td>
>                   </tr>
>                   <tr>
>                     <td valign="top"><xsl:apply-templates
> select="//login_welcome"/></td>
>                   </tr>
>                   <tr>
>                      <td colspan="2"><img src="images/tool.gif" width="20"
> height="3" /></td>
>                   </tr>
>                   <tr>
>                     <td><xsl:apply-templates
> select="//login_fields"/></td>
>                   </tr>
>                 </table></td>
>               <td width="19" class="bgcol">&#160;</td>
>               <td width="245" valign="top" class="bgcol"><table
> width="100%" border="0" cellspacing="0" cellpadding="0">
>                   <tr>
>                     <td><img src="images/tool.gif" width="20" height="16"
> /></td>
>                   </tr>
>                   <tr>
>                     <td><img src="images/newstitle.gif" width="245"
> height="27" /></td>
>                   </tr>
>                   <tr>
>                     <td><img src="images/tool.gif" width="20" height="300"
> /></td>
>                   </tr>
>                 </table></td>
>             </tr>
>             <tr>
>               <td colspan="4" class="bgcol"><a href="mailto:
> info@beyarecords.com" onMouseOut="MM_swapImgRestore()"
> onMouseOver="MM_swapImage('email','','images/bottombar-over.gif',0)"><img
> src="images/bottombar- none.gif" name="email" width="583" height="22"
> border="0" /></a></td>
>             </tr>
>           </table>
>           <table width="100%" border="0" cellspacing="0" cellpadding="0">
>             <tr>
>               <td bgcolor="B9B5AC"><img src="images/tool.gif" width="1"
> height="1" /></td>
>             </tr>
>           </table>
>           <table width="100%" border="0" cellspacing="0" cellpadding="0">
>             <tr>
>                 <td></td>
>                 <td><img src="images/tool.gif" width="1" height="5"
> /></td>
>             </tr>
>             <cinclude:include src="style/copyright.xml"
> element="included"/>
>             <cinclude:include src="style/designed-by-littleghost.xml"
> element="included"/>
>         </table>
>         <P align="center">&#160;</P>
>         <div id="divUpControl">
>           <table width="100%" border="0" cellspacing="0" cellpadding="0">
>             <tr>
>               <td>&#160;</td>
>               <td width="24">
>                 <a onmouseover="PerformScroll(-7);displayStatusMsg('Scroll
> Up');swapImage('images/scroller_up_button','','images/scroller_up_on.gif',1);return
> document.returnValue" onmouseout="CeaseScroll();swapImgRestore()"
> href="javascript:;"><img height="18" alt="godown"
> src="images/scroller_up_on.gif" width="24" border="0"
> name="scroller_up_button"/></a>
>               </td>
>             </tr>
>             <tr>
>               <td>&#160;</td>
>               <td><img src="images/scrollbg.gif" width="24"
> height="154"/></td>
>             </tr>
>           </table>
>           <p>&#160;</p>
>           <p>&#160;</p>
>           <p>&#160;</p>
>           <p>&#160;</p>
>           <p>&#160;</p>
>           <p>&#160; </p>
>         </div>
>         <div id="divDownControl">
>             <a onmouseover="PerformScroll(7);displayStatusMsg('Scroll
> Down');swapImage('images/scroller_down_button','','images/scroller_down_on.gif',1);return
> document.returnValue" onmouseout="CeaseScroll();swapImgRestore()"
> href="javascript:;"><IMG height="18" alt="goup"
> src="images/scroller_down_on.gif" width="24" border="0"
> name="scroller_down_button"/></a>
>         </div>
>         <div id="divContainer">
>           <div id="divContent">
>                 <p class="newstext">
>                         <xsl:apply-templates select="//news"/>
>
>                 </p>
>               <br/>
>              <p/>
>           </div>
>         </div>
>         <P align="center">&#160;</P>
>         <P align="center">&#160;</P>
>         <P align="center">&#160;</P>
>         <P align="center">&#160;</P>
>         <P align="center">&#160;</P>
>         <P align="center">&#160;</P>
> </body>
> </page>
> </xsl:template>
>
> regards
>
> Andrew
>
>
> On 18/07/06, Mark Lundquist < ml@wrinkledog.com> wrote:
> >
> > Hi Andrew,
> >
> > On Jul 18, 2006, at 7:44 AM, Andrew wrote:
> >
> > > what's up with these machers:
> > >
> > > <xsl:apply-templates select="." mode="forms-page"/>
> > > <xsl:apply-templates select="." mode="forms-field"/>
> > >
> > > which are never matached in forms-sample-styling.xsl or:
> > >
> > > <xsl:apply-templates select="." mode="forms-calendar"/>
> > > <xsl:apply-templates select="." mode="forms-htmlarea"/>
> > >
> > > in forms-advanced-field styling.xsl?
> >
> > Not sure I understand... those are not "matchers".  They are found in
> > templates like <xsl:template match="head"> and <xsl:template
> > match="body">.  Do you mean that those templates are never matched, and
> > if so, why? (they certainly should be matched if they are being applied
> > to HTML!)
> >
> > > Where in my design xslt page am I meant p speacify any of the above
> > > 'mode' attributes and values?
> >
> > You don't.  The modeless templates just match, and then they invoke the
> > moded templates which are found in the forms-*-stying.xsl stylesheets.
> >
> > Does this help?  Maybe I'm misunderstanding the question(s)... :-)
> >
> > cheers,
> > —ml—
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>

Re: Cocoon-Ajax issue

Posted by Andrew <an...@gmail.com>.
Hi Mark,
you are understanding the question very well ;-) The head section of my XSLT
file never matches with the head matacher in forms-samples-style.xsl and as
a result none of the require ajax/dojo script code is wrtten to the head
area of my code. My sitemap pipe is as follows:

            <map:match pattern="**viewform-*">
                <map:generate type="jx" src="jx/{2}.jx"/>
                <map:transform type="forms"/>
                <map:transform type="browser-update"/>
                <map:transform type="i18n">
                  <map:parameter name="locale" value="en-US"/>
                </map:transform>
                <map:transform type="xslt-saxon" src="style/{2}.xsl"/>
                <map:transform type="cinclude"/>
                <map:transform src="template-style/forms-samples-styling.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>

and my xsl file is as follows:

<?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:cinclude="http://apache.org/cocoon/include/1.0">
        <xsl:template match="/">
          <page>
                <head>
                    <title>beyaRecords - Home Page</title>
                    <link rel="stylesheet" type="text/css">
                        <xsl:attribute
name="href">stylesheets/beya.css</xsl:attribute>
                        <xsl:attribute name="media">all</xsl:attribute>
                    </link>

                    <link rel="stylesheet" type="text/css">
                        <xsl:attribute
name="href">stylesheets/style.css</xsl:attribute>
                        <xsl:attribute name="media">all</xsl:attribute>
                    </link>

                    <script>
                        <xsl:attribute
name="type">text/javascript</xsl:attribute>
                        <xsl:attribute
name="src">js_files/upwarddownward.js</xsl:attribute>
                    </script>

                    <script>
                        <xsl:attribute
name="type">text/javascript</xsl:attribute>
                        <xsl:attribute
name="src">js_files/form.js</xsl:attribute>
                    </script>

                </head>
            <body leftmargin="0" marginheight="0" topmargin="0"
marginwidth="0"
onload="InitialiseScrollableArea();preloadImages('images/scroller_up_on.gif','images/scroller_down_on.gif');MM_swapImage('images/sumit-
over.gif','images/cancel-over.gif','images/emaillink-over.gif')">
            <script>
                <xsl:attribute name="type">text/javascript</xsl:attribute>
                <xsl:attribute name="src">js_files/reload.js</xsl:attribute>
            </script>
            <table width="1024" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="221" rowspan="3"><img src="images/bgleft1.jpg"
width="222" height="460" /></td>
              <td colspan="4" background="images/bg1.gif" class="bgcol"
width="583"><xsl:apply-templates select="//menu"/></td>
              <td width="220" rowspan="3"><img src="images/bgright1.gif"
width="220" height="460" /></td>
            </tr>
            <tr>
              <td width="18" class="bgcol"><img src="images/tool.gif"
width="18" height="365" /></td>
              <td width="301" valign="top" class="bgcol">
              <table width="261" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><img src="images/tool.gif" width="20" height="16"
/></td>
                  </tr>
                  <xsl:apply-templates select="//new_music"/>
                  <tr>
                    <td><img src="images/tool.gif" width="20" height="5"
/></td>
                  </tr>
                  <tr>
                    <td valign="top"><xsl:apply-templates
select="//login_welcome"/></td>
                  </tr>
                  <tr>
                     <td colspan="2"><img src="images/tool.gif" width="20"
height="3" /></td>
                  </tr>
                  <tr>
                    <td><xsl:apply-templates select="//login_fields"/></td>
                  </tr>
                </table></td>
              <td width="19" class="bgcol">&#160;</td>
              <td width="245" valign="top" class="bgcol"><table width="100%"
border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><img src="images/tool.gif" width="20" height="16"
/></td>
                  </tr>
                  <tr>
                    <td><img src="images/newstitle.gif" width="245"
height="27" /></td>
                  </tr>
                  <tr>
                    <td><img src="images/tool.gif" width="20" height="300"
/></td>
                  </tr>
                </table></td>
            </tr>
            <tr>
              <td colspan="4" class="bgcol"><a href="mailto:
info@beyarecords.com" onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('email','','images/bottombar-over.gif',0)"><img
src="images/bottombar-none.gif" name="email" width="583" height="22"
border="0" /></a></td>
            </tr>
          </table>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td bgcolor="B9B5AC"><img src="images/tool.gif" width="1"
height="1" /></td>
            </tr>
          </table>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td></td>
                <td><img src="images/tool.gif" width="1" height="5" /></td>
            </tr>
            <cinclude:include src="style/copyright.xml" element="included"/>
            <cinclude:include src="style/designed-by-littleghost.xml"
element="included"/>
        </table>
        <P align="center">&#160;</P>
        <div id="divUpControl">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>&#160;</td>
              <td width="24">
                <a onmouseover="PerformScroll(-7);displayStatusMsg('Scroll
Up');swapImage('images/scroller_up_button','','images/scroller_up_on.gif',1);return
document.returnValue" onmouseout="CeaseScroll();swapImgRestore()"
href="javascript:;"><img height="18" alt="godown"
src="images/scroller_up_on.gif" width="24" border="0"
name="scroller_up_button"/></a>
              </td>
            </tr>
            <tr>
              <td>&#160;</td>
              <td><img src="images/scrollbg.gif" width="24"
height="154"/></td>
            </tr>
          </table>
          <p>&#160;</p>
          <p>&#160;</p>
          <p>&#160;</p>
          <p>&#160;</p>
          <p>&#160;</p>
          <p>&#160; </p>
        </div>
        <div id="divDownControl">
            <a onmouseover="PerformScroll(7);displayStatusMsg('Scroll
Down');swapImage('images/scroller_down_button','','images/scroller_down_on.gif',1);return
document.returnValue" onmouseout="CeaseScroll();swapImgRestore()"
href="javascript:;"><IMG height="18" alt="goup"
src="images/scroller_down_on.gif" width="24" border="0"
name="scroller_down_button"/></a>
        </div>
        <div id="divContainer">
          <div id="divContent">
                <p class="newstext">
                        <xsl:apply-templates select="//news"/>

                </p>
              <br/>
             <p/>
          </div>
        </div>
        <P align="center">&#160;</P>
        <P align="center">&#160;</P>
        <P align="center">&#160;</P>
        <P align="center">&#160;</P>
        <P align="center">&#160;</P>
        <P align="center">&#160;</P>
</body>
</page>
</xsl:template>

regards

Andrew

On 18/07/06, Mark Lundquist <ml...@wrinkledog.com> wrote:
>
> Hi Andrew,
>
> On Jul 18, 2006, at 7:44 AM, Andrew wrote:
>
> > what's up with these machers:
> >
> > <xsl:apply-templates select="." mode="forms-page"/>
> > <xsl:apply-templates select="." mode="forms-field"/>
> >
> > which are never matached in forms-sample-styling.xsl or:
> >
> > <xsl:apply-templates select="." mode="forms-calendar"/>
> > <xsl:apply-templates select="." mode="forms-htmlarea"/>
> >
> > in forms-advanced-field styling.xsl?
>
> Not sure I understand... those are not "matchers".  They are found in
> templates like <xsl:template match="head"> and <xsl:template
> match="body">.  Do you mean that those templates are never matched, and
> if so, why? (they certainly should be matched if they are being applied
> to HTML!)
>
> > Where in my design xslt page am I meant p speacify any of the above
> > 'mode' attributes and values?
>
> You don't.  The modeless templates just match, and then they invoke the
> moded templates which are found in the forms-*-stying.xsl stylesheets.
>
> Does this help?  Maybe I'm misunderstanding the question(s)... :-)
>
> cheers,
> —ml—
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Cocoon-Ajax issue

Posted by Mark Lundquist <ml...@wrinkledog.com>.
Hi Andrew,

On Jul 18, 2006, at 7:44 AM, Andrew wrote:

> what's up with these machers:
>
>       <xsl:apply-templates select="." mode="forms-page"/>
>       <xsl:apply-templates select="." mode="forms-field"/>
>
> which are never matached in forms-sample-styling.xsl or:
>
>     <xsl:apply-templates select="." mode="forms-calendar"/>
>     <xsl:apply-templates select="." mode="forms-htmlarea"/>
>
> in forms-advanced-field styling.xsl?

Not sure I understand... those are not "matchers".  They are found in 
templates like <xsl:template match="head"> and <xsl:template 
match="body">.  Do you mean that those templates are never matched, and 
if so, why? (they certainly should be matched if they are being applied 
to HTML!)

> Where in my design xslt page am I meant p speacify any of the above 
> 'mode' attributes and values?

You don't.  The modeless templates just match, and then they invoke the 
moded templates which are found in the forms-*-stying.xsl stylesheets.

Does this help?  Maybe I'm misunderstanding the question(s)... :-)

cheers,
—ml—


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon-Ajax issue

Posted by Andrew <an...@gmail.com>.
Ok Guys,
what's up with these machers:

      <xsl:apply-templates select="." mode="forms-page"/>
      <xsl:apply-templates select="." mode="forms-field"/>

which are never matached in forms-sample-styling.xsl or:

    <xsl:apply-templates select="." mode="forms-calendar"/>
    <xsl:apply-templates select="." mode="forms-htmlarea"/>

in forms-advanced-field styling.xsl? Where in my design xslt page am I meant
p speacify any of the above 'mode' attributes and values?

regards

Andrew

On 18/07/06, Andrew <an...@gmail.com> wrote:
>
> Hi,
> nothing is being written into the head tags of my xsl files:
>
> myXSL.xsl:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>     <xsl:stylesheet version="1.0"
>         xmlns:xsl=" http://www.w3.org/1999/XSL/Transform"
>         xmlns:cinclude="http://apache.org/cocoon/include/1.0">
>         <xsl:template match="/">
>           <html>
>                 <head>
>
> sitemap pipe:
>
>             <map:match pattern="**viewform-*">
>                 <map:generate type="jx" src="jx/{2}.jx"/>
>                 <map:transform type="forms"/>
>
>                 <map:transform type="browser-update"/>
>                 <map:transform type="i18n">
>                   <map:parameter name="locale" value="en-US"/>
>                 </map:transform>
>                 <map:transform src="template-style/forms-
> samples-styling.xsl"/>
>                 <map:transform type="cinclude"/>
>                 <map:transform type="xslt-saxon" src="style/{2}.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>
>
> forms-sample-styling.xsl:
>
>
>   <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
> page-styling.xsl"/>
>   <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
> advanced-field-styling.xsl"/>
>
>   <xsl:param name="resources-uri">resources</xsl:param>
>
>   <xsl:template match="head">
>     <head>
>       <xsl:apply-templates select="." mode="forms-page"/>
>       <xsl:apply-templates select="." mode="forms-field"/>
>       <xsl:apply-templates/>
>     </head>
>   </xsl:template>
>
>
> forms-advanced-field-styling.xsl:
>
>   <xsl:import href="resource://org/apache/cocoon/forms/resources/forms-
> field-styling.xsl"/>
>   <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
> calendar-styling.xsl"/>
>   <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
> htmlarea-styling.xsl"/>
>
>   <xsl:template match="head" mode="forms-field">
>     <xsl:apply-imports/>
>     <script src="{$resources-uri}/forms/mattkruse-lib/AnchorPosition.js"
> type="text/javascript"/>
>     <script src="{$resources-uri}/forms/mattkruse-lib/PopupWindow.js"
> type="text/javascript"/>
>     <script src="{$resources-uri}/forms/mattkruse-lib/OptionTransfer.js"
> type="text/javascript"/>
>     <script src="{$resources-uri}/forms/mattkruse-lib/selectbox.js"
> type="text/javascript"/>
>     <xsl:apply-templates select="." mode="forms-calendar"/>
>     <xsl:apply-templates select="." mode="forms-htmlarea"/>
>   </xsl:template>
>
> What am I overlooking here?
>
> regards
>
> Andrew
>
> On 18/07/06, Andrew <an...@gmail.com> wrote:
> >
> > Hi Jason,
> > seems you may have a winner here. I'm having a problem with where the
> > resource link is pointing to as none of the files are being picked up:
> >
> >   <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
> > page-styling.xsl"/>
> >   <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
> > advanced-field-styling.xsl"/>
> >
> > My project sits in the root.war folder of my jboss application server,
> > and my folder stucture is as follows:
> >
> > root.war - myproject/
> >             - cocoon/
> >             - resources/
> >             - samples/
> >             - slide/
> >             - stylesheets/
> >             - test-suite/
> >             - WEB-INF/
> >             - not-found.xml | sitemap.xmap | welcome.xml | welcome.xslt
> >
> > Now all the documents required are within the cocoon folder, for example
> > forms-advanced-field-styling.xsl is located at:
> >
> > root /cocoon/blocks/orms/dest/org/apache/cocoon/forms/resources/
> >
> > So my question is, and in relation to the cocoon folder, where exactly
> > are the following references being resolved to?:
> >
> >   <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
> > page-styling.xsl "/>
> >   <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
> > advanced-field-styling.xsl"/>
> > <xsl:param name="resources-uri">resources</xsl:param>
> >
> > regards
> >
> > Andrew
> >
> > On 18/07/06, Jason Johnston < cocoon@lojjic.net> wrote:
> > >
> > > Andrew wrote:
> > > > Hi Simone,
> > > > Basically my problem is that after setting ajax="true" in my
> > > > ft:form-template and defining my jx-macros line:
> > > >
> > > > <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 "/>
> > >
> > > What is the XSLT file from this above line?  Is it a copy of
> > > forms-advanced-field-styling.xsl from the Cocoon
> > > distribution?  Normally
> > > you have a separate XSLT file that includes the Cocoon-provided XSLTs,
> > >
> > > (see forms-samples-styling.xsl in the CForms samples), rather than
> > > using
> > > them directly.
> > >
> > > Using them directly will *not* insert the correct <script> references
> > > in
> > > the head of the HTML document, so anything that requires client-side
> > > JavaScript (AJAX!) will not function.
> > >
> > > Check the source of your HTML output and verify that it has all the
> > > <script> tags that are in the CForms samples; if not then this is
> > > probably your issue.
> > >
> > > >                 <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 ajax-request never resolves to true,
> > > it
> > > > always fails and picks up the xhtml serializer, 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
> > > >
> > > > regards
> > > >
> > > > Andrew
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > For additional commands, e-mail: users-help@cocoon.apache.org
> > >
> > >
> >
>

Re: Cocoon-Ajax issue

Posted by Andrew <an...@gmail.com>.
Hi,
nothing is being written into the head tags of my xsl files:

myXSL.xsl:

<?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:cinclude="http://apache.org/cocoon/include/1.0">
        <xsl:template match="/">
          <html>
                <head>

sitemap pipe:
            <map:match pattern="**viewform-*">
                <map:generate type="jx" src="jx/{2}.jx"/>
                <map:transform type="forms"/>
                <map:transform type="browser-update"/>
                <map:transform type="i18n">
                  <map:parameter name="locale" value="en-US"/>
                </map:transform>
                <map:transform src="template-style/forms-samples-styling.xsl
"/>
                <map:transform type="cinclude"/>
                <map:transform type="xslt-saxon" src="style/{2}.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>

forms-sample-styling.xsl:

  <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
page-styling.xsl"/>
  <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
advanced-field-styling.xsl"/>

  <xsl:param name="resources-uri">resources</xsl:param>

  <xsl:template match="head">
    <head>
      <xsl:apply-templates select="." mode="forms-page"/>
      <xsl:apply-templates select="." mode="forms-field"/>
      <xsl:apply-templates/>
    </head>
  </xsl:template>

forms-advanced-field-styling.xsl:

  <xsl:import href="resource://org/apache/cocoon/forms/resources/forms-
field-styling.xsl"/>
  <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
calendar-styling.xsl"/>
  <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
htmlarea-styling.xsl"/>

  <xsl:template match="head" mode="forms-field">
    <xsl:apply-imports/>
    <script src="{$resources-uri}/forms/mattkruse-lib/AnchorPosition.js"
type="text/javascript"/>
    <script src="{$resources-uri}/forms/mattkruse-lib/PopupWindow.js"
type="text/javascript"/>
    <script src="{$resources-uri}/forms/mattkruse-lib/OptionTransfer.js"
type="text/javascript"/>
    <script src="{$resources-uri}/forms/mattkruse-lib/selectbox.js"
type="text/javascript"/>
    <xsl:apply-templates select="." mode="forms-calendar"/>
    <xsl:apply-templates select="." mode="forms-htmlarea"/>
  </xsl:template>

What am I overlooking here?

regards

Andrew
On 18/07/06, Andrew <an...@gmail.com> wrote:
>
> Hi Jason,
> seems you may have a winner here. I'm having a problem with where the
> resource link is pointing to as none of the files are being picked up:
>
>   <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
> page-styling.xsl"/>
>   <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
> advanced-field-styling.xsl"/>
>
> My project sits in the root.war folder of my jboss application server, and
> my folder stucture is as follows:
>
> root.war - myproject/
>             - cocoon/
>             - resources/
>             - samples/
>             - slide/
>             - stylesheets/
>             - test-suite/
>             - WEB-INF/
>             - not-found.xml | sitemap.xmap | welcome.xml | welcome.xslt
>
> Now all the documents required are within the cocoon folder, for example
> forms-advanced-field-styling.xsl is located at:
>
> root /cocoon/blocks/orms/dest/org/apache/cocoon/forms/resources/
>
> So my question is, and in relation to the cocoon folder, where exactly are
> the following references being resolved to?:
>
>   <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
> page-styling.xsl "/>
>   <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
> advanced-field-styling.xsl"/>
> <xsl:param name="resources-uri">resources</xsl:param>
>
> regards
>
> Andrew
>
> On 18/07/06, Jason Johnston <co...@lojjic.net> wrote:
> >
> > Andrew wrote:
> > > Hi Simone,
> > > Basically my problem is that after setting ajax="true" in my
> > > ft:form-template and defining my jx-macros line:
> > >
> > > <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 "/>
> >
> > What is the XSLT file from this above line?  Is it a copy of
> > forms-advanced-field-styling.xsl from the Cocoon distribution?  Normally
> > you have a separate XSLT file that includes the Cocoon-provided XSLTs,
> > (see forms-samples-styling.xsl in the CForms samples), rather than using
> > them directly.
> >
> > Using them directly will *not* insert the correct <script> references in
> > the head of the HTML document, so anything that requires client-side
> > JavaScript (AJAX!) will not function.
> >
> > Check the source of your HTML output and verify that it has all the
> > <script> tags that are in the CForms samples; if not then this is
> > probably your issue.
> >
> > >                 <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 ajax-request never resolves to true, it
> >
> > > always fails and picks up the xhtml serializer, 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
> > >
> > > regards
> > >
> > > Andrew
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>

Re: Cocoon-Ajax issue

Posted by Andrew <an...@gmail.com>.
Hi Jason,
seems you may have a winner here. I'm having a problem with where the
resource link is pointing to as none of the files are being picked up:

  <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
page-styling.xsl"/>
  <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
advanced-field-styling.xsl"/>

My project sits in the root.war folder of my jboss application server, and
my folder stucture is as follows:

root.war - myproject/
            - cocoon/
            - resources/
            - samples/
            - slide/
            - stylesheets/
            - test-suite/
            - WEB-INF/
            - not-found.xml | sitemap.xmap | welcome.xml | welcome.xslt

Now all the documents required are within the cocoon folder, for example
forms-advanced-field-styling.xsl is located at:

root /cocoon/blocks/orms/dest/org/apache/cocoon/forms/resources/

So my question is, and in relation to the cocoon folder, where exactly are
the following references being resolved to?:

  <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
page-styling.xsl"/>
  <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-
advanced-field-styling.xsl"/>
<xsl:param name="resources-uri">resources</xsl:param>

regards

Andrew
On 18/07/06, Jason Johnston <co...@lojjic.net> wrote:
>
> Andrew wrote:
> > Hi Simone,
> > Basically my problem is that after setting ajax="true" in my
> > ft:form-template and defining my jx-macros line:
> >
> > <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"/>
>
> What is the XSLT file from this above line?  Is it a copy of
> forms-advanced-field-styling.xsl from the Cocoon distribution?  Normally
> you have a separate XSLT file that includes the Cocoon-provided XSLTs,
> (see forms-samples-styling.xsl in the CForms samples), rather than using
> them directly.
>
> Using them directly will *not* insert the correct <script> references in
> the head of the HTML document, so anything that requires client-side
> JavaScript (AJAX!) will not function.
>
> Check the source of your HTML output and verify that it has all the
> <script> tags that are in the CForms samples; if not then this is
> probably your issue.
>
> >                 <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 ajax-request never resolves to true, it
> > always fails and picks up the xhtml serializer, 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
> >
> > regards
> >
> > Andrew
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Cocoon-Ajax issue

Posted by Jason Johnston <co...@lojjic.net>.
Andrew wrote:
> Hi Simone,
> Basically my problem is that after setting ajax="true" in my 
> ft:form-template and defining my jx-macros line:
> 
> <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"/>

What is the XSLT file from this above line?  Is it a copy of 
forms-advanced-field-styling.xsl from the Cocoon distribution?  Normally 
you have a separate XSLT file that includes the Cocoon-provided XSLTs, 
(see forms-samples-styling.xsl in the CForms samples), rather than using 
them directly.

Using them directly will *not* insert the correct <script> references in 
the head of the HTML document, so anything that requires client-side 
JavaScript (AJAX!) will not function.

Check the source of your HTML output and verify that it has all the 
<script> tags that are in the CForms samples; if not then this is 
probably your issue.

>                 <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 ajax-request never resolves to true, it 
> always fails and picks up the xhtml serializer, 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
> 
> regards
> 
> Andrew


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon-Ajax issue

Posted by Andrew <an...@gmail.com>.
Hi Toby,

creditCard.kont  !=  **viewform-*



Yes that is correct. It points to my continuation pipe for which I have a
hidden continuation id:

 <ft:form-template action="login.kont" name="Form1" method="POST"
ajax="true">
   <ft:continuation-id/>

in the form definition, my continuation pipe being:

            <map:match pattern="**.kont">
               <map:select type="request-method">
                 <map:when test="POST">
                   <map:call
continuation="{request-param:continuation-id}"/>
                 </map:when>
                 <map:otherwise>
                     <map:call continuation="{1}"/>
                 </map:otherwise>
               </map:select>
            </map:match>

In my flow I call the ajax pipe as:

    var form2 = new Form("forms/CreditCardDetails.xml");
    form2.showForm("viewform-CreditCardDetails", {"userGlobal":userGlobal});

Hoepfully we can resolve this issue today!

regards

Andrew


I'm having trouble getting Ajax to work myself, but this is one piece of
> the Ajax puzzle I think I understand.
>
> You should either add an ajax-action[1] attribute to form-template
> (http://tinyurl.com/ok4ky), containing the **viewform-* target you want
> Ajax to use, or you should add the browser-update machinery to the
> creditCard.kont pipeline.
>
>
> Toby
>
> --
> Signed/encrypted mail welcome.  GPG/PGP Key-Id: 0x15C5C2EA
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Cocoon-Ajax issue

Posted by Toby <to...@linux.it>.
Andrew wrote:
> <ft:form-template action="creditCard.kont" id="Form1" method="POST"
> ajax="true">
...
> <map:match pattern="**viewform-*">

creditCard.kont  !=  **viewform-*

I'm having trouble getting Ajax to work myself, but this is one piece of
the Ajax puzzle I think I understand.

You should either add an ajax-action[1] attribute to form-template
(http://tinyurl.com/ok4ky), containing the **viewform-* target you want
Ajax to use, or you should add the browser-update machinery to the
creditCard.kont pipeline.


Toby

-- 
Signed/encrypted mail welcome.  GPG/PGP Key-Id: 0x15C5C2EA

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org