Not really sure with turbine-intake. I'm using that with xingu-exintake,
but I think the advice works for both.

Build a macro the knows how to display _one_ field. Something like
this :

#macro(showIntakeField $field $data $bean $erase)
  #set($value = "")
  #if($erase)
    #set($value = $field.DefaultValue)
  #else
    #set($value = $intakeTool.getPreferredValue($field,$data,$bean))
  #end
  #set($prop = $field.Name)
  #intakeFieldName($field $value $bean)
  #intakeField($field $value)
#end

Then, on your template :

#set($fieldNames = ["name","lastName"])
#foreach($fieldName in $fieldNames)
  #set($field = $intakeTool.get($fieldName))
  #showIntakeField($field $data $bean $erase)
#end

Where $bean is the object you pulled from the db, or something else.
I got this working on esqueleto, an turbine app skeleton that I have. 
Esqueleto has some modules (Actions,Screens) that creates beans from
form fields, etc !

Cheers !



On Mon, 2005-02-14 at 09:55 +0100, Michael Kunze wrote:
> > <field name="Name" key="Name" type="String" defaultValue="John Doe"
> > displayName="Name please *">
> >     <rule name="required" value="true">Please enter the name</rule>
> > </field>
> 
> Hi,
> 
> thanks for your answer. I should have clearified myself before. I want
> to build an edit screen (edit person or whatever) for that reason i
> want to present the form with inital values from the database.
> I'm almost certain now, that i need to use the BusinessObject. I found
> an old E-Mail on this list mentioning this. What i'm not sure about is
> the interaction between the BO and Intake.
> 
> That E-Mail states that i need to map the group object from intake to an
> OM layer object in the screen class of my form. But wouldn't that reset
> the form fields to there initial state (from database) each time the
> intake form validation fails?
> 
> Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to