You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Bill Mulert <wd...@zygno.org> on 2004/02/01 22:20:04 UTC

Can I use Intake on a form with default values?

I'm successfully using Intake on forms that are initially empty. Now I 
want to use it on a form that has default values. I don't see a way to 
prepopulate the default value of a Field because Field.setDefaultValue() 
is protected and unaccessable to me.

What am I missing?

regards --
-- bill


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Can I use Intake on a form with default values?

Posted by Daniel <da...@yorku.ca>.
Hi,

In your .vm file:

## This is on one line..
#set($editComputer = \
$intake.get('EditComputerInfoGroup').mapTo($mytool.getComputer($data)))
## The above sets $editComputer to be mapped to a data object returned
## from calling $mytool.getComputer($data) which has fields like
## Description, MacAddress, etc. with the fields set (from db call or
## whatever).

## Then you have this in your form:
<input type="text" name="$editComputer.Description.Key" size="20"
value="$editComputer.Description" maxlength="10">
## And voila, it'll have the pre-populated data!

Regards,
Daniel

On Sun, 1 Feb 2004, Oron Ogdan Adam wrote:

> Hi bill
>
> you can set the default value in intake.xml file with the DefaultValue
> property of the field tag,
> the other option is in the template
>
> $group = $intakeTool.SomeGroup.Default
> $group.SomeField.setDefaultValue("some default value")
>
> Oron
>
> http://netada.co.uk
>
>
>
> -----Original Message-----
> From: Bill Mulert [mailto:wdm@zygno.org]
> Sent: Sunday, February 01, 2004 9:20 PM
> To: turbine-user@jakarta.apache.org
> Subject: Can I use Intake on a form with default values?
>
>
> I'm successfully using Intake on forms that are initially empty. Now I
> want to use it on a form that has default values. I don't see a way to
> prepopulate the default value of a Field because Field.setDefaultValue()
> is protected and unaccessable to me.
>
> What am I missing?
>
> regards --
> -- bill
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Can I use Intake on a form with default values?

Posted by Oron Ogdan Adam <or...@netada.co.uk>.
Hi bill

you can set the default value in intake.xml file with the DefaultValue
property of the field tag,
the other option is in the template

$group = $intakeTool.SomeGroup.Default
$group.SomeField.setDefaultValue("some default value")

Oron

http://netada.co.uk



-----Original Message-----
From: Bill Mulert [mailto:wdm@zygno.org]
Sent: Sunday, February 01, 2004 9:20 PM
To: turbine-user@jakarta.apache.org
Subject: Can I use Intake on a form with default values?


I'm successfully using Intake on forms that are initially empty. Now I
want to use it on a form that has default values. I don't see a way to
prepopulate the default value of a Field because Field.setDefaultValue()
is protected and unaccessable to me.

What am I missing?

regards --
-- bill


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org