On Tue, 2003-11-25 at 22:32, Steve Steinitz wrote: > Hello, > > We have prototyped some forms with Woody and Flow. It is impressive > technology, particularly the binding framework. > > We use Cayenne (similar to OJB) as our object layer to access our > postgres database. > > It is not obvious to us how to use woody to implement a 'clickable > list' of objects -- meaning a list of objects (actually object > attributes) where clicking one of them takes the user to a form to > edit that object. We've now realized that this 'clickable list' > may not really be a job for woody. Even so, we would still like to > take advantage of woody's powerful bindings. Moreover, while we > could implement a 'clickable list' using the wd:action widgets > inside a wd:repeater we would rather use hyperlinks than buttons -- > which even more, we suppose, begs the question: why even use woody? > (But, we would like to use one technique for all our dynamic data.)
You're quite right, I wouldn't use Woody for that (in some cases it might make sense, but in general I wouldn't do it). Normally the only reason to load data into a form is to allow the user to edit it. Are you aware of the existance of the JXTemplateGenerator? It uses the same JXPath library as the binding does, allowing to easily generate XML or HTML from Java object structures. The documentation can be found here: http://cocoon.apache.org/2.1/userdocs/flow/jxtemplate.html You can pass your object to the view layer by specifying an additional argument to the showForm function: var myObject = ...; var bizdata = { mydata: myObject }; form.showForm("the-pipeline", bizdata); the object referenced by myObject will then be available using the name 'mydata' in the JXTemplateGenerator. If you need more information, just ask. > We would be interested in suggestions on implementing a 'clickable > list' and also on techniques for identifying the clicked object. > We had intended to use, as part of the solution, Cayenne's > DataObject.objectid() method which (I believe) is guaranteed to be > unique among objects in a given DataContext (simliar to OJB's > Broker). Now however, looking at frameworks like struts, we > wonder if we even need to use the objectid -- that there might be > a more elegant way to identify the clicked object. No special opinion here. You'll need _something_ to identify the selected option, either that objectid() or some other primary key, and simply pass that as a request parameter or as part of the path. -- Bruno Dumon http://outerthought.org/ Outerthought - Open Source, Java & XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
