You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Derek Stevenson <de...@retrocode.com> on 2002/08/18 03:45:23 UTC

intake service - uppercase required for Field names?

I'm using TDK 2.1 with turbine-2.1, velocity-1.2-dev and have been trying 
to get the intake service to work.  I was having problems getting field 
keys to display properly in my templates, I kept getting this error in my 
velocity log:

Error rendering Velocity template: screens/mochamap/sbsample/bequiz.vm: 
Invocation of method 'get("q1")' in  class 
org.apache.turbine.services.intake.model.Group threw exception class 
org.apache.turbine.util.TurbineException

Here's the relevant snippet from the vm file:

...
<INPUT NAME="$bequiz.q1.Key" TYPE="radio" VALUE="0"> Choice 1
...

I had the following defined in my intake.xml file:

...
                 <field key="q1" name="q1" type="int">
                         <required-message>Please answer all of the 
questions so we can evaluate your responses.</required-message>
                 </field>
...

I thought I'd followed all the instructions in the intake service howto and 
the intake-service docs on the turbine website, so I tried playing around 
with the name and key of the field.  It turns out if I change the vm and 
intake.xml files, respectively, to:

...
<INPUT NAME="$bequiz.Q1.Key" TYPE="radio" VALUE="0"> Choice 1
...

...
                 <field key="q1" name="Q1" type="int">
                         <required-message>Please answer all of the 
questions so we can evaluate your responses.</required-message>
                 </field>
...

I no longer get the method invocation error.  So, I deduced the first 
letter of the name attribute in <field> must be uppercase.  Has anyone else 
seen this?  Is this a bug or by design?  Can anyone else confirm this problem?

To help others avoid the same problem, I'd like to add a note about this to 
the docs on the website, but I'd need some help since I'm not a very 
advanced CVS user, and I take it the way to add to the web docs is via CVS...?

Cheers,
Derek


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: intake service - uppercase required for Field names?

Posted by Scott Eade <se...@backstagetech.com.au>.
> From: Derek Stevenson <de...@retrocode.com>
> 
Snip
> ...
> <INPUT NAME="$bequiz.Q1.Key" TYPE="radio" VALUE="0"> Choice 1
> ...
> 
> ...
>                <field key="q1" name="Q1" type="int">
>                        <required-message>Please answer all of the
> questions so we can evaluate your responses.</required-message>
>                </field>
> ...
> 
> I no longer get the method invocation error.  So, I deduced the first
> letter of the name attribute in <field> must be uppercase.  Has anyone else
> seen this?  Is this a bug or by design?  Can anyone else confirm this problem?

This is the same as retrieving pretty much anything from an object in the
context - as reflection is used to find the getQ1() method the upper case
'Q' is required.
> 
> To help others avoid the same problem, I'd like to add a note about this to
> the docs on the website, but I'd need some help since I'm not a very
> advanced CVS user, and I take it the way to add to the web docs is via CVS...?

I think this is actually reasonably clear (although I have not looked at the
docs).  Someone may have also broken the rules and have a method getq1().
If you did want to amend the docs you would checkout the relevant cvs
module, update the xdoc and then submit a patch in unidiff format (cvs diff
-u) back to either this list or the relevant dev list with "[patch]" at the
beginning of the subject.
> 
> Cheers,
> Derek
> 

Cheers,

Scott
-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>