cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Portier <...@outerthought.org>
Subject Re: Fill woody repeater from flow
Date Fri, 24 Oct 2003 20:05:24 GMT
Tim,

looks good

however, this got me thinking:

maybe we should get ourselves into making (declarative) binding support 
on java.sql.ResultSets, no?

The biggest catch however is the lack of symmetry in connecting to JDBC 
stuff: binding-back for the 'save is not to be done by handing over a 
resulset back to the jdbc connection :-(

Thoughts like these always kinda set me back on th etrack of just using 
some OR/mapping tool and stopping to think about it...

Still, making cforms (aka woody) easier for the jdbc-fans is a goal we 
should go for, and given the fact that the current implicit symmetry of 
the binding is limiting our thoughts we should maybe just set it asside 
and think allong other paths?

so, any thoughts on the subject dwelling out there?
-marc=


Timothy Larson wrote:

> --- Timothy Larson <timlarsonwork@yahoo.com> wrote:
> 
>>I guess I still do not completely grasp JavaScript.
>>It is easy enough from Java, but how would you
>>populate a repeater from a flowscript?
>>The context is I am trying to make a database query
>>by example person search form.
> 
> 
> Never mind.  Why do I figure things out right after I
> break down and ask about them? For posterity here is one,
> not necessarily efficient, way:
> 
> // Perform query and get results in ResultSet "result"
> //   Left as exercise for the reader.
> 
> // Clear the repeater
> while (0 in model.somewidget) { // While model.somewidget[0] exists
>   delete model.somewidget[0];
> }
> 
> // Populate the repeater
> while(result.next()) {
>   var field1 = result.getString("field1");
>   var field2 = result.getString("field2");
>   var max = model.people.length;
>   var row = model.people[max]; // Magically creates a new row
>   row.field1 = field1;
>   row.field2 = field2;
> }
> 
> --Tim Larson
> 
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping.yahoo.com
> 

-- 
Marc Portier                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at              http://radio.weblogs.com/0116284/
mpo@outerthought.org                              mpo@apache.org


Mime
View raw message