cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject Re: [CFORMS] dynamic binding
Date Fri, 20 Jan 2006 08:51:28 GMT
On Fri, 2006-01-20 at 08:21 +0100, werner wrote:
> Am Donnerstag, den 19.01.2006, 11:27 -0700 schrieb Jason Johnston: 
> > > Does anybody know a clean approach for dynamic binding. For example it
> > > would be nice to use a JXTemplate for the binding and pass it some vars
> > > like it works with showForm:
> > >
> > > form.createBinding("binding.jx", {"param1": somevalue, "param2":
> > > somevalue});
> > >
> > > I know it's possible to solve this with a special pipline and call the
> > > binding with /binding.jx/param1/param2
> > > But that's ugly IMO.
> 
> Thanks for your answer Jason.
> 
> > 
> > Looks like somebody posted a patch for this feature:
> > https://issues.apache.org/jira/browse/COCOON-1418
> > 
> > In the meantime you can use request attributes or parameters as a
> > transport for your data.
> 
> That's how I'm doing it right now. But in some cases that is not
> enough. Especially when you want to pass more than 3 parameters to the
> binding.
> 

I'm not sure what kind of dynamism you need, but if it is in the JXPath
expressions you can pass parameters to the binding along with your
'bussiness object':

form.load({"data": dataObject, "param1" : "value1", "param2" :
"value2"});

In the binding you'll then need to adjust the fb:context to start form
"/data". The parameters are accessible in JXPath expressions using e.g.
"/param1".

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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


Mime
View raw message