The peer system is great! After doing something like this:

  Criteria c = new Criteria();
  c.add(InfoPeer.NAME, name);
  Vector v = InfoPeer.doSelect(c);
  context.put("infos", v);

I get a Vector with Info objects; from Velocity, I can then do:

  #foreach ($info in $infos)
   <tr>
    <td>$info.getCode()</td>
    <td>$info.getFullName()</td>
  #end

Now, I was thinking whether it would be possible to access the
columns within an Info object by name, not by explicitly calling
a Java method. For example, I would like to rewrite the Velocity
code above as:

  #foreach ($info in $infos)
   <tr>
    <td>$info.getFieldByName("code")</td>
    <td>$info.getFieldByName("fullName")</td>
  #end

Is this possible with the current peer model? Or maybe as a
Velocity "hack"? In any case, how? If not possible at present,
would you think it a worthwhile addition? If yes, I would be
more than happy to implement this, but I would need some gentle
guidance to get me started...

Thanks,


-- 
Gonzalo A. Diethelm
[EMAIL PROTECTED]


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to