You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "cocoon.erard" <co...@besonet.ch> on 2007/09/21 16:08:27 UTC

forms with ajax and cinclude

Hi, 

I've another problem in my application.

I've extracted a piece of my form template in a separate xml to have a module that can be reused.

With this include Iinclude the commented part into my template.

In the form I enabled ajax, and when I have Errors while the validation this errors aren't shown in browser for the included part. The rest is working.

Regards, 

Mike

<include:include src="cocoon:/part/checkCustomerData" />
    
<!-- div class="columns4">    
   <span class="title"><dbI18n:text>CUSTOMER_DATA</dbI18n:text></span>
        <table>
          <tr>
            <td class="label"><ft:widget-help-label id="bcNr"/></td>
            <td class="field"><ft:widget id="bcNr"><fi:styling maxlength="5"/></ft:widget></td>
            <td class="label"><ft:widget-label id="type"/></td>
            <td class="field"><ft:widget id="type" /></td>
          </tr>
          <tr class="alt">
            <td class="label"><ft:widget-label id="accountNo"/></td>
            <td class="field"><ft:widget id="accountNo"><fi:styling maxlength="16"/></ft:widget></td>
            <td class="label"><ft:widget-label id="branchNo"/></td>
            <td class="field"><ft:widget id="branchNo"><fi:styling maxlength="3"/></ft:widget></td>
          </tr>
        </table>
      </div-->


<map:otherwise>
            <map:generate type="jx" src="pages/forms/{1}_template.xml"/>
            <map:transform type="cinclude" />   
            <map:transform type="browser-update"/>
            <map:transform src="stylesheets/forms-style.xsl">
              <map:parameter name="dojo-resources" value="{servlet:ajax:/resource/external/dojo}" />
              <map:parameter name="forms-resources" value="{servlet:forms:/resource/external/forms}" />
            </map:transform>
            <map:transform type="dbi18n">
              <map:parameter name="locale" value="{../locale}" />
            </map:transform>
            <map:serialize type="xml" />
          </map:otherwise> 


____________________________________________
QuickLine WebMail - http://www.QuickLine.com

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


Re: forms with ajax and cinclude

Posted by Jason Johnston <co...@lojjic.net>.
cocoon.erard wrote:
> Hi, 
> 
> I've another problem in my application.
> 
> I've extracted a piece of my form template in a separate xml to have a module that can be reused.
> 
> With this include Iinclude the commented part into my template.
> 
> In the form I enabled ajax, and when I have Errors while the validation this errors aren't shown 
 > in browser for the included part. The rest is working.
> 
> Regards, 
> 
> Mike
> 
> <include:include src="cocoon:/part/checkCustomerData" />
>     
>
...
> 
> 
> <map:otherwise>
>             <map:generate type="jx" src="pages/forms/{1}_template.xml"/>
>             <map:transform type="cinclude" />   

So looking at the order of execution here... first you have your JX 
generator, which processes all the ft:* elements.  And then you cinclude 
another set of ft:* elements, but it's too late for them to be 
processed!  I think that explains what you're seeing.

You might be able to achieve what you want by removing the cinclude step 
and using a jx:import of the same URI in your template.  That should 
pull in the external content and process it as JX at the same time.


>             <map:transform type="browser-update"/>
>             <map:transform src="stylesheets/forms-style.xsl">
>               <map:parameter name="dojo-resources" value="{servlet:ajax:/resource/external/dojo}" />
>               <map:parameter name="forms-resources" value="{servlet:forms:/resource/external/forms}" />
>             </map:transform>
>             <map:transform type="dbi18n">
>               <map:parameter name="locale" value="{../locale}" />
>             </map:transform>
>             <map:serialize type="xml" />
>           </map:otherwise> 
> 
> 
> ____________________________________________
> QuickLine WebMail - http://www.QuickLine.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


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


Re: forms with ajax and cinclude

Posted by Grzegorz Kossakowski <gk...@apache.org>.
cocoon.erard pisze:
> Hi, 

Hi Mike,

> I've another problem in my application.
> 
> I've extracted a piece of my form template in a separate xml to have a module that can be reused.
> 
> With this include Iinclude the commented part into my template.
> 
> In the form I enabled ajax, and when I have Errors while the validation this errors aren't shown in browser for the included part. The rest is working.
> 
> Regards, 
> 
> Mike
> 
> <include:include src="cocoon:/part/checkCustomerData" />

What kind of XML does this include produces? Is it wrapped by bu:* elements?

-- 
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/

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