cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "nicolas maisonneuve" <n.maisonne...@gmail.com>
Subject CForm model to POJO with a "natural" binding [RE: was Display a CForm Repeater in JXTemplate]
Date Sat, 14 May 2005 12:18:21 GMT
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


Mime
View raw message