Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 88732 invoked from network); 8 Nov 2005 10:49:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Nov 2005 10:49:24 -0000 Received: (qmail 27285 invoked by uid 500); 8 Nov 2005 10:49:21 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 27034 invoked by uid 500); 8 Nov 2005 10:49:20 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 27023 invoked by uid 99); 8 Nov 2005 10:49:20 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Nov 2005 02:49:20 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [84.96.21.10] (HELO mail.anyware-tech.com) (84.96.21.10) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Nov 2005 02:49:13 -0800 Received: from localhost (localhost [127.0.0.1]) by mail.anyware-tech.com (Postfix) with ESMTP id 0C07833A6D for ; Tue, 8 Nov 2005 11:49:02 +0100 (CET) Received: from mail.anyware-tech.com ([127.0.0.1]) by localhost (trinity [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 06555-03 for ; Tue, 8 Nov 2005 11:48:58 +0100 (CET) Received: from [10.0.0.43] (homer.anyware [10.0.0.43]) by mail.anyware-tech.com (Postfix) with ESMTP id A32CA33A6A for ; Tue, 8 Nov 2005 11:48:58 +0100 (CET) Message-ID: <437082BF.5070308@anyware-tech.com> Date: Tue, 08 Nov 2005 11:49:35 +0100 From: Philippe Gassmann User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050728) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: portal+cform+ajax problem in 2.1.8 rc1 References: <436F969E.6010900@apache.org> In-Reply-To: <436F969E.6010900@apache.org> Content-Type: multipart/alternative; boundary="------------080907080007070009090105" X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at anyware-tech.com X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. --------------080907080007070009090105 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 8bit Sylvain Wallez wrote: >�� ���� wrote: > > >>Hi,all >>I try to combine portal+form(with ajax) in 2.1.8 rc1,all is fine but >>one problem,I don't know if is a bug,and just show my step here: >> >> > > > > > >>Now I run the server and enter portal block sample,it works fine only >>when finally I click "ok" button. >>If it is not a ajax form or run the form seperatly,I should see the >>result information,but now I see the form restart. >>I check the aceess log and add some debug code in js file,the >>flowscript did't run after >>form.showForm("datasource_chooser-display-pipeline.jx"); >>and the seperate form sample will run continue twice when I click "ok" >>but only once under this condition. >>I guess the ajax code missing one click to make showForm complete in >>this situation,so it may be a bug. >> >> > >Well, my colleagues that succeeded in using CForms+Ajax in the portal >told me this is much more complicated than that, and I shamely admit >that I haven't understood their explanations. > >So it's not really a bug: the CForms+Ajax coplets must be written in a >very special way. I'll try to have a better answer tomorrow, as we're >here past the work hours now. > >Sylvain > > > Hi, I will try to give you an explanation of how it can be done : 1. the pipeline called by the coplet containing the form is something like this : 2. the pipeline showing the form is somewhat like this : 3. In the template : Note : - I assume that these pipeline are in the portal sitemap. If not, just modify ajax-action - We do not use the temporary attribute "application-uri". (the uri of the coplet is always cocoon://portal/myForm in this case) I think that's all. Good luck ! -- Philippe GASSMANN ANYWARE TECHNOLOGIES http://www.anyware-tech.com/ --------------080907080007070009090105 Content-Type: text/html; charset=GB2312 Content-Transfer-Encoding: 8bit Sylvain Wallez wrote:
�� ���� wrote:
  
Hi,all
I try to combine portal+form(with ajax) in 2.1.8 rc1,all is fine but
one problem,I don't know if is a bug,and just show my step here:
    

<snip/>

  
Now I run the server and enter portal block sample,it works fine only
when finally I click "ok" button.
If it is not a ajax form or run the form seperatly,I should see the
result information,but now I see the form restart.
I check the aceess log and add some debug code in js file,the
flowscript did't run after
form.showForm("datasource_chooser-display-pipeline.jx");
and the seperate form sample will run continue twice when I click "ok"
but only once under this condition.
I guess the ajax code missing one click to make showForm complete in
this situation,so it may be a bug.
    

Well, my colleagues that succeeded in using CForms+Ajax in the portal
told me this is much more complicated than that, and I shamely admit
that I haven't understood their explanations.

So it's not really a bug: the CForms+Ajax coplets must be written in a
very special way. I'll try to have a better answer tomorrow, as we're
here past the work hours now.

Sylvain

  
Hi, I will try to give you an explanation of how it can be done :
 1. the pipeline called by the coplet containing the form is something like this :

<map:match pattern="myForm">
    <map:select type="request-method">
            <map:when test="GET">
                <map:call function="MyFlowFunctionThatCreateAndDisplayTheForm">
             </map:when>
             <map:otherwise>
                <map:call continuation="{request-param:continuation-id}"/>
             </map:otherwise>
    </map:select
</map:select>

 2. the pipeline showing the form is somewhat like this :
    <map:patch pattern="showMyForm">
        <map:generate type="jx" src="..."/>
        <map:transform type="browser-update"/>
         
        <map:transform type="i18n" label='i18n'>
            <map:parameter name="locale" value="{session-context:authentication/authentication/data/lang}"/>
        </map:transform>
   
        <map:transform src="somewhere/cocoon forms xsl.xsl" label='forms-xsl'>
            <map:parameter name="contextPath" value="{request:contextPath}"/>
            <map:parameter name="lang" value="{session-context:authentication/authentication/data/lang}"/>
       </map:transform>

     <map:select type="request-parameter">
        <map:parameter name="parameter-name" value="cocoon-ajax"/>
        <map:when test="true">
            <map:serialize type="xml"/>
        </map:when>
        <map:otherwise>
            <map:serialize type='xhtml'/>
        </map:otherwise>
    </map:select>
   </map:match>

3. In the template :
    <ft:form-template action="portal"  enctype="multipart/form-data" method="POST" ajax="true"
          ajax-action="myForm"/>


Note :
 - I assume that these pipeline are in the portal sitemap. If not, just modify ajax-action
 - We do not use the temporary attribute "application-uri". (the uri of the coplet is always cocoon://portal/myForm in this case)

I think that's all.

Good luck !

-- 
Philippe GASSMANN
ANYWARE TECHNOLOGIES
http://www.anyware-tech.com/
--------------080907080007070009090105--