You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nicolas Maisonneuve <n....@gmail.com> on 2005/05/12 21:19:29 UTC

Display a CForm Repeater in JXTemplate

hy, 

i have a repeater :

 <fd:repeater id="fields" >
	  <fd:widgets>
           <fd:field id="name" >
          <fd:datatype base="string"/>
	</fd:widgets>
  </fd:repeater>

and i would like display the result with a JX.

the flowscript is:

 form.showForm( ..)
 model=form.getModel();
 cocoon.sendPage("config-sucess-pipeline.jx", {model: model} );


the jx file : 
<jx:forEach var="field" items="${model.fields}">
     <jx:out value="${field.name}" />
</jx:forEach>


but it doesn't work. Someone can help me ?

nicolas

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


Re: CForm model to POJO with a "natural" binding [RE: was Display a CForm Repeater in JXTemplate]

Posted by Sylvain Wallez <sy...@apache.org>.
Nicolas Maisonneuve wrote:

>ok maybe i'm not very clear:
>
>the binding framework is good but useless for simple/natural binding.
>Exemple of a form:
>
><form>
><field name="title"/>
><booleanfield name"field"/>
>
><repeater name="contacts">
>  <field name="name" />
>...</repeater>
>...
>a useful tool/feature would be:
>
>var my bean = form.modelToPojo() 
>
>the bean will have this structure 
>bean.title
>bean.field
>bean.contacts[i].name
>etc...
>
>and form.pojoTomodel(bean)
>-----------------
>
>It's possible to do this ? if yes how do you this ?
>  
>

Two solutions come to mind:
- a new <fb:bean> binding, that would bind a full widget subtree to a POJO.
- a new form.createBeanBinding() that would essentially do the same as a 
binding file with a single <fb:bean> instructions, thus avoiding to 
write a seperate file when there's only a bean to bind.

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Re: CForm model to POJO with a "natural" binding [RE: was Display a CForm Repeater in JXTemplate]

Posted by Nicolas Maisonneuve <n....@gmail.com>.
ok maybe i'm not very clear:

the binding framework is good but useless for simple/natural binding.
Exemple of a form:

<form>
<field name="title"/>
<booleanfield name"field"/>

<repeater name="contacts">
  <field name="name" />
...</repeater>
...
a useful tool/feature would be:

var my bean = form.modelToPojo() 

the bean will have this structure 
bean.title
bean.field
bean.contacts[i].name
etc...

and form.pojoTomodel(bean)
-----------------

It's possible to do this ? if yes how do you this ?

because the form.getModel() is not POJO and when you use it somewhere
outside to the flowscript , we can't use it as easily as in
flowscript, so why not create directly the real object ?

nicolas 






On 5/14/05, nicolas maisonneuve <n....@gmail.com> wrote:
> It doesn't work in JX but works in flowscript because model is not POJO but
> a scriptableWidget.
> Ok ,  so I must manually transform the model in a POJO in the flowscript.. a
> dumb task
> 
> Var Mymodel= new Object();
> Mymodel.simplewidgetID = model.simplewidgetID
> Mymodel.repeaterwidgetID= new Array(model.repeaterwigetID.length);
> For (var i=0; i<i ; i++) {
> Mymodel.repeaterwidgetID[i]=model.repeaterwidgetID[i];
> }
> Etc..
> Ok but is there any way to create/bind a POJO automatically, with reflection
> code or a tool ?
> 
> 
> Nicolas
> 
> > -----Message d'origine-----
> > De: news [mailto:news@sea.gmane.org] De la part de oceatoon
> > Envoyé: samedi 14 mai 2005 13:39
> > À: users@cocoon.apache.org
> > Objet: Re: Display a CForm Repeater in JXTemplate
> >
> > Nicolas Maisonneuve wrote:
> >
> > > In pratice I would like transform the data of the form , so I use JX
> > > as the generator of the pipeline where the data are injected. My first
> > > step is just to display the results of the JX generator.
> > >
> > > But it's really strange that anybody find a simple solution for this
> > > simple problem.
> > > 1 Is there a simple way to access to the data in a repeater in a JX ?
> > > 2- Why in flowscript the access "model.field[0].name"  works but not in
> > JX
> > > ? (it would be interessing to develop ths kind of access in JX , no ?)
> > By experience JX is full of little bugs (that's why devers are
> > restructuring
> > it) so you have go step by step and be patient ;-) and the solution is
> > certainly there to be found:
> >
> > if things don't work with JEXL then also try the Xpath syntax, especially
> > in
> > the forEach tags and variables , they don't work exactly alike (PLS, don't
> > ask me you????).
> > You probably tried
> > <jx:out value="${model.field[0].name}"/>
> > or maybe something like
> > <jx:out value="#{model.getRow(0).getChild("name").value}"/> does it work ?
> > then go from there
> >
> > Tibor
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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: CForm model to POJO with a "natural" binding [RE: was Display a CForm Repeater in JXTemplate]

Posted by Nicolas Maisonneuve <n....@gmail.com>.
ok maybe i'm not very clear:

the binding framework is good but useless for simple/natural binding.
Exemple of a form:

<form>
<field name="title"/>
<booleanfield name"field"/>

<repeater name="contacts">
  <field name="name" />
...</repeater>
...
a useful tool/feature would be:

var my bean = form.modelToPojo() 

the bean will have this structure 
bean.title
bean.field
bean.contacts[i].name
etc...

and form.pojoTomodel(bean)
-----------------

It's possible to do this ? if yes how do you this ?

because the form.getModel() is not POJO and when you use it somewhere
outside to the flowscript , we can't use it as easily as in
flowscript, so why not create directly the real object ?

nicolas 






On 5/14/05, nicolas maisonneuve <n....@gmail.com> wrote:
> It doesn't work in JX but works in flowscript because model is not POJO but
> a scriptableWidget.
> Ok ,  so I must manually transform the model in a POJO in the flowscript.. a
> dumb task
> 
> Var Mymodel= new Object();
> Mymodel.simplewidgetID = model.simplewidgetID
> Mymodel.repeaterwidgetID= new Array(model.repeaterwigetID.length);
> For (var i=0; i<i ; i++) {
> Mymodel.repeaterwidgetID[i]=model.repeaterwidgetID[i];
> }
> Etc..
> Ok but is there any way to create/bind a POJO automatically, with reflection
> code or a tool ?
> 
> 
> Nicolas
> 
> > -----Message d'origine-----
> > De: news [mailto:news@sea.gmane.org] De la part de oceatoon
> > Envoyé: samedi 14 mai 2005 13:39
> > À: users@cocoon.apache.org
> > Objet: Re: Display a CForm Repeater in JXTemplate
> >
> > Nicolas Maisonneuve wrote:
> >
> > > In pratice I would like transform the data of the form , so I use JX
> > > as the generator of the pipeline where the data are injected. My first
> > > step is just to display the results of the JX generator.
> > >
> > > But it's really strange that anybody find a simple solution for this
> > > simple problem.
> > > 1 Is there a simple way to access to the data in a repeater in a JX ?
> > > 2- Why in flowscript the access "model.field[0].name"  works but not in
> > JX
> > > ? (it would be interessing to develop ths kind of access in JX , no ?)
> > By experience JX is full of little bugs (that's why devers are
> > restructuring
> > it) so you have go step by step and be patient ;-) and the solution is
> > certainly there to be found:
> >
> > if things don't work with JEXL then also try the Xpath syntax, especially
> > in
> > the forEach tags and variables , they don't work exactly alike (PLS, don't
> > ask me you????).
> > You probably tried
> > <jx:out value="${model.field[0].name}"/>
> > or maybe something like
> > <jx:out value="#{model.getRow(0).getChild("name").value}"/> does it work ?
> > then go from there
> >
> > Tibor
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> 
>

Re: Display a CForm Repeater in JXTemplate

Posted by Leszek Gawron <lg...@mobilebox.pl>.
Nicolas Maisonneuve wrote:
> Sorry to not be clear.. :)
> i would like access to the repeater rows and for each row print all
> the widget values in JX ?
take a look at forms samples that use JXTG to generate form content. 
These are the ones that use jx-macrox.xml file.

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

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


Re: Display a CForm Repeater in JXTemplate

Posted by Nicolas Maisonneuve <n....@gmail.com>.
On 5/16/05, Leszek Gawron <lg...@mobilebox.pl> wrote:
> Nicolas Maisonneuve wrote:
> > On 5/16/05, Leszek Gawron <lg...@mobilebox.pl> wrote:
> >
> >>oceatoon wrote:
> >>
> >>>Nicolas Maisonneuve wrote:
> >>>
> >>>
> >>>
> >>>>In pratice I would like transform the data of the form , so I use JX
> >>>>as the generator of the pipeline where the data are injected. My first
> >>>>step is just to display the results of the JX generator.
> >>>>
> >>>>But it's really strange that anybody find a simple solution for this
> >>>>simple problem.
> >>>>1 Is there a simple way to access to the data in a repeater in a JX ?
> >>>>2- Why in flowscript the access "model.field[0].name"  works but not in JX
> >>>>? (it would be interessing to develop ths kind of access in JX , no ?)
> >>>
> >>>By experience JX is full of little bugs (that's why devers are restructuring
> >>>it) so you have go step by step and be patient ;-) and the solution is
> >>>certainly there to be found:
> >>>
> >>>if things don't work with JEXL then also try the Xpath syntax, especially in
> >>>the forEach tags and variables , they don't work exactly alike (PLS, don't
> >>>ask me you????).
> >>>You probably tried
> >>><jx:out value="${model.field[0].name}"/>
> >>>or maybe something like
> >>><jx:out value="#{model.getRow(0).getChild("name").value}"/> does it work ?
> >>
> >>do you need to access a "static" path like ${model.field[0].name} or
> >>would you rather have access to current repeater row?
> >
> >
> > the ideal would be:
> >
> > <jx:forEach var="field" items="${model.fields}">
> >     <jx:out value="${field.name}" />
> > </jx:forEach>
> Still .. what do you need it for? I do not quite get it.
> 
> --
> Leszek Gawron                                      lgawron@mobilebox.pl
> IT Manager                                         MobileBox sp. z o.o.
> +48 (61) 855 06 67                              http://www.mobilebox.pl
> mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

Sorry to not be clear.. :)
i would like access to the repeater rows and for each row print all
the widget values in JX ?

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


Re: Display a CForm Repeater in JXTemplate

Posted by Leszek Gawron <lg...@mobilebox.pl>.
Nicolas Maisonneuve wrote:
> On 5/16/05, Leszek Gawron <lg...@mobilebox.pl> wrote:
> 
>>oceatoon wrote:
>>
>>>Nicolas Maisonneuve wrote:
>>>
>>>
>>>
>>>>In pratice I would like transform the data of the form , so I use JX
>>>>as the generator of the pipeline where the data are injected. My first
>>>>step is just to display the results of the JX generator.
>>>>
>>>>But it's really strange that anybody find a simple solution for this
>>>>simple problem.
>>>>1 Is there a simple way to access to the data in a repeater in a JX ?
>>>>2- Why in flowscript the access "model.field[0].name"  works but not in JX
>>>>? (it would be interessing to develop ths kind of access in JX , no ?)
>>>
>>>By experience JX is full of little bugs (that's why devers are restructuring
>>>it) so you have go step by step and be patient ;-) and the solution is
>>>certainly there to be found:
>>>
>>>if things don't work with JEXL then also try the Xpath syntax, especially in
>>>the forEach tags and variables , they don't work exactly alike (PLS, don't
>>>ask me you????).
>>>You probably tried
>>><jx:out value="${model.field[0].name}"/>
>>>or maybe something like
>>><jx:out value="#{model.getRow(0).getChild("name").value}"/> does it work ?
>>
>>do you need to access a "static" path like ${model.field[0].name} or
>>would you rather have access to current repeater row?
> 
> 
> the ideal would be:
> 
> <jx:forEach var="field" items="${model.fields}">
>     <jx:out value="${field.name}" />
> </jx:forEach>
Still .. what do you need it for? I do not quite get it.

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

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


Re: Display a CForm Repeater in JXTemplate

Posted by Nicolas Maisonneuve <n....@gmail.com>.
On 5/16/05, Leszek Gawron <lg...@mobilebox.pl> wrote:
> oceatoon wrote:
> > Nicolas Maisonneuve wrote:
> >
> >
> >>In pratice I would like transform the data of the form , so I use JX
> >>as the generator of the pipeline where the data are injected. My first
> >>step is just to display the results of the JX generator.
> >>
> >>But it's really strange that anybody find a simple solution for this
> >>simple problem.
> >>1 Is there a simple way to access to the data in a repeater in a JX ?
> >>2- Why in flowscript the access "model.field[0].name"  works but not in JX
> >>? (it would be interessing to develop ths kind of access in JX , no ?)
> >
> > By experience JX is full of little bugs (that's why devers are restructuring
> > it) so you have go step by step and be patient ;-) and the solution is
> > certainly there to be found:
> >
> > if things don't work with JEXL then also try the Xpath syntax, especially in
> > the forEach tags and variables , they don't work exactly alike (PLS, don't
> > ask me you????).
> > You probably tried
> > <jx:out value="${model.field[0].name}"/>
> > or maybe something like
> > <jx:out value="#{model.getRow(0).getChild("name").value}"/> does it work ?
> do you need to access a "static" path like ${model.field[0].name} or
> would you rather have access to current repeater row?

the ideal would be:

<jx:forEach var="field" items="${model.fields}">
    <jx:out value="${field.name}" />
</jx:forEach>

but as it doesn't work , i tried  alternative things
> > <jx:out value="${model.field[0].name}"/>


but the model is not a POJO so it can't work  (this kind of access
work only in the flowscript because the model is scriptableWidget)

but if you find a solution..,  i'll take it !

> 
> --
> Leszek Gawron                                      lgawron@mobilebox.pl
> IT Manager                                         MobileBox sp. z o.o.
> +48 (61) 855 06 67                              http://www.mobilebox.pl
> mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65
> 
> ---------------------------------------------------------------------
> 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: Display a CForm Repeater in JXTemplate

Posted by Leszek Gawron <lg...@mobilebox.pl>.
oceatoon wrote:
> Nicolas Maisonneuve wrote:
> 
> 
>>In pratice I would like transform the data of the form , so I use JX
>>as the generator of the pipeline where the data are injected. My first
>>step is just to display the results of the JX generator.
>>
>>But it's really strange that anybody find a simple solution for this
>>simple problem.
>>1 Is there a simple way to access to the data in a repeater in a JX ?
>>2- Why in flowscript the access "model.field[0].name"  works but not in JX
>>? (it would be interessing to develop ths kind of access in JX , no ?)
> 
> By experience JX is full of little bugs (that's why devers are restructuring
> it) so you have go step by step and be patient ;-) and the solution is
> certainly there to be found:
> 
> if things don't work with JEXL then also try the Xpath syntax, especially in
> the forEach tags and variables , they don't work exactly alike (PLS, don't
> ask me you????).
> You probably tried 
> <jx:out value="${model.field[0].name}"/>
> or maybe something like
> <jx:out value="#{model.getRow(0).getChild("name").value}"/> does it work ?
do you need to access a "static" path like ${model.field[0].name} or 
would you rather have access to current repeater row?

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

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


CForm model to POJO with a "natural" binding [RE: was Display a CForm Repeater in JXTemplate]

Posted by nicolas maisonneuve <n....@gmail.com>.
It doesn't work in JX but works in flowscript because model is not POJO but
a scriptableWidget. 
Ok ,  so I must manually transform the model in a POJO in the flowscript.. a
dumb task

Var Mymodel= new Object();
Mymodel.simplewidgetID = model.simplewidgetID
Mymodel.repeaterwidgetID= new Array(model.repeaterwigetID.length);
For (var i=0; i<i ; i++) {
Mymodel.repeaterwidgetID[i]=model.repeaterwidgetID[i];
}
Etc..
Ok but is there any way to create/bind a POJO automatically, with reflection
code or a tool ? 


Nicolas

> -----Message d'origine-----
> De : news [mailto:news@sea.gmane.org] De la part de oceatoon
> Envoyé : samedi 14 mai 2005 13:39
> À : users@cocoon.apache.org
> Objet : Re: Display a CForm Repeater in JXTemplate
> 
> Nicolas Maisonneuve wrote:
> 
> > In pratice I would like transform the data of the form , so I use JX
> > as the generator of the pipeline where the data are injected. My first
> > step is just to display the results of the JX generator.
> >
> > But it's really strange that anybody find a simple solution for this
> > simple problem.
> > 1 Is there a simple way to access to the data in a repeater in a JX ?
> > 2- Why in flowscript the access "model.field[0].name"  works but not in
> JX
> > ? (it would be interessing to develop ths kind of access in JX , no ?)
> By experience JX is full of little bugs (that's why devers are
> restructuring
> it) so you have go step by step and be patient ;-) and the solution is
> certainly there to be found:
> 
> if things don't work with JEXL then also try the Xpath syntax, especially
> in
> the forEach tags and variables , they don't work exactly alike (PLS, don't
> ask me you????).
> You probably tried
> <jx:out value="${model.field[0].name}"/>
> or maybe something like
> <jx:out value="#{model.getRow(0).getChild("name").value}"/> does it work ?
> then go from there
> 
> Tibor
> 
> 
> 
> ---------------------------------------------------------------------
> 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


CForm model to POJO with a "natural" binding [RE: was Display a CForm Repeater in JXTemplate]

Posted by nicolas maisonneuve <n....@gmail.com>.
It doesn't work in JX but works in flowscript because model is not POJO but
a scriptableWidget. 
Ok ,  so I must manually transform the model in a POJO in the flowscript.. a
dumb task

Var Mymodel= new Object();
Mymodel.simplewidgetID = model.simplewidgetID
Mymodel.repeaterwidgetID= new Array(model.repeaterwigetID.length);
For (var i=0; i<i ; i++) {
Mymodel.repeaterwidgetID[i]=model.repeaterwidgetID[i];
}
Etc..
Ok but is there any way to create/bind a POJO automatically, with reflection
code or a tool ? 


Nicolas

> -----Message d'origine-----
> De : news [mailto:news@sea.gmane.org] De la part de oceatoon
> Envoyé : samedi 14 mai 2005 13:39
> À : users@cocoon.apache.org
> Objet : Re: Display a CForm Repeater in JXTemplate
> 
> Nicolas Maisonneuve wrote:
> 
> > In pratice I would like transform the data of the form , so I use JX
> > as the generator of the pipeline where the data are injected. My first
> > step is just to display the results of the JX generator.
> >
> > But it's really strange that anybody find a simple solution for this
> > simple problem.
> > 1 Is there a simple way to access to the data in a repeater in a JX ?
> > 2- Why in flowscript the access "model.field[0].name"  works but not in
> JX
> > ? (it would be interessing to develop ths kind of access in JX , no ?)
> By experience JX is full of little bugs (that's why devers are
> restructuring
> it) so you have go step by step and be patient ;-) and the solution is
> certainly there to be found:
> 
> if things don't work with JEXL then also try the Xpath syntax, especially
> in
> the forEach tags and variables , they don't work exactly alike (PLS, don't
> ask me you????).
> You probably tried
> <jx:out value="${model.field[0].name}"/>
> or maybe something like
> <jx:out value="#{model.getRow(0).getChild("name").value}"/> does it work ?
> then go from there
> 
> Tibor
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


Re: Display a CForm Repeater in JXTemplate

Posted by oceatoon <t....@systheo.com>.
Nicolas Maisonneuve wrote:

> In pratice I would like transform the data of the form , so I use JX
> as the generator of the pipeline where the data are injected. My first
> step is just to display the results of the JX generator.
> 
> But it's really strange that anybody find a simple solution for this
> simple problem.
> 1 Is there a simple way to access to the data in a repeater in a JX ?
> 2- Why in flowscript the access "model.field[0].name"  works but not in JX
> ? (it would be interessing to develop ths kind of access in JX , no ?)
By experience JX is full of little bugs (that's why devers are restructuring
it) so you have go step by step and be patient ;-) and the solution is
certainly there to be found:

if things don't work with JEXL then also try the Xpath syntax, especially in
the forEach tags and variables , they don't work exactly alike (PLS, don't
ask me you????).
You probably tried 
<jx:out value="${model.field[0].name}"/>
or maybe something like
<jx:out value="#{model.getRow(0).getChild("name").value}"/> does it work ?
then go from there

Tibor



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


Re: Display a CForm Repeater in JXTemplate

Posted by Nicolas Maisonneuve <n....@gmail.com>.
In pratice I would like transform the data of the form , so I use JX
as the generator of the pipeline where the data are injected. My first
step is just to display the results of the JX generator.

But it's really strange that anybody find a simple solution for this
simple problem.
1 Is there a simple way to access to the data in a repeater in a JX ?
2- Why in flowscript the access "model.field[0].name"  works but not in JX ? 
(it would be interessing to develop ths kind of access in JX , no ?)


On 5/14/05, Sebastien Arbogast <se...@gmail.com> wrote:
> Maybe you could use just another CForm to display the result of the
> first one, except instead of field's you could use output's to make
> the content static.

create 2 forms. yes, but it's really not the solution that i expected 

But thanks anyway ;-)
> --
> Sebastien ARBOGAST
> 
> ---------------------------------------------------------------------
> 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: Display a CForm Repeater in JXTemplate

Posted by Sebastien Arbogast <se...@gmail.com>.
Maybe you could use just another CForm to display the result of the
first one, except instead of field's you could use output's to make
the content static.

-- 
Sebastien ARBOGAST

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


RE: Display a CForm Repeater in JXTemplate

Posted by nicolas maisonneuve <n....@gmail.com>.
Actually I would like display the result of a CFORM. So  I use the normal
way: the JX.
But how do you code the JX to display the data of a repeater.
This instruction in the flowscript work: 

print(model.fiels[0].name )

but when I put the model in the JX;
 
cocoon.sendPage("config-sucess-pipeline.jx", {model: model} );

with this JX.
> > test: <jx:out value="${model.fields[0].name}">
> > <jx:forEach var="field" items="${model.fields}">
> >      <jx:out value="${field.name}" />
> > </jx:forEach>
> >

It doesn't work and I don't know why 


> -----Message d'origine-----
> De : news [mailto:news@sea.gmane.org] De la part de Peter Kröpfl
> Envoyé : vendredi 13 mai 2005 23:44
> À : users@cocoon.apache.org
> Objet : Re: Display a CForm Repeater in JXTemplate
> 
> >
> > hy,
> >
> > i have a repeater :
> >
> >  <fd:repeater id="fields" >
> > 	  <fd:widgets>
> >            <fd:field id="name" >
> >           <fd:datatype base="string"/>
> > 	</fd:widgets>
> >   </fd:repeater>
> >
> > and i would like display the result with a JX.
> >
> > the flowscript is:
> >
> >  form.showForm( ..)
> >  model=form.getModel();
> >  cocoon.sendPage("config-sucess-pipeline.jx", {model: model} );
> >
> > the jx file :
> > <jx:forEach var="field" items="${model.fields}">
> >      <jx:out value="${field.name}" />
> > </jx:forEach>
> >
> 
> 
> Hi,
> 
> do you really need the jx?
> if not you could simply do something like that:
> you "fill" your fields in flow first and then show them.
> 
> ---code---
> 
> var model = form.getModel();
> 
> 
> 
> for (var i=0; i < number_of_fields; i++) {
> 
>  model.fields[i].name = "show_the_name";
> }
> 
> 
> form.showForm("repeater-display-pipeline");
> 
> ---end code----
> 
> btw, there is </fd:field> missing in your form definition
> 
> 
> hth
> Peter Kröpfl
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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: Display a CForm Repeater in JXTemplate

Posted by Peter Kröpfl <pe...@groebi.com>.
> 
> hy, 
> 
> i have a repeater :
> 
>  <fd:repeater id="fields" >
> 	  <fd:widgets>
>            <fd:field id="name" >
>           <fd:datatype base="string"/>
> 	</fd:widgets>
>   </fd:repeater>
> 
> and i would like display the result with a JX.
> 
> the flowscript is:
> 
>  form.showForm( ..)
>  model=form.getModel();
>  cocoon.sendPage("config-sucess-pipeline.jx", {model: model} );
> 
> the jx file : 
> <jx:forEach var="field" items="${model.fields}">
>      <jx:out value="${field.name}" />
> </jx:forEach>
> 


Hi,

do you really need the jx?
if not you could simply do something like that:
you "fill" your fields in flow first and then show them.

---code---

var model = form.getModel();



for (var i=0; i < number_of_fields; i++) {

 model.fields[i].name = "show_the_name";
}


form.showForm("repeater-display-pipeline");

---end code----

btw, there is </fd:field> missing in your form definition


hth
Peter Kröpfl





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