I just went through a battle with intake, what does your intake.xml file
look like?

-warner

----- Original Message -----
From: "Britta Ladwig-Attinger" <[EMAIL PROTECTED]>
To: "Turbine-User@Jakarta. Apache. Org" <[EMAIL PROTECTED]>
Sent: Monday, July 09, 2001 6:15 AM
Subject: Intake problem


> TDK version: 2.1
>
> Intake problem: method 'isAllValid()' always returns true
>
> I had a very deep look in the Scarab code but can't see any difference to
my
> code.
>
> If someone could please give me an idea of what I do wrong,
> I would depply appreciate!!!
>
>
> Code:
>
> 1. in Turbine Resources:
>
services.IntakeService.classname=org.apache.turbine.services.intake.TurbineI
> ntakeService
> tool.request.intake=org.apache.turbine.services.intake.IntakeTool
> # Intake Service
> services.IntakeService.xml.path=WEB-INF/conf/intake.xml
>
> 2. in web-inf/conf/intake.xml
>
> <input-data basePackage="com.mmi.site.">
> <group name="Enterfields" key="enterfields">
> <field name="Emailadr" key="emailadr" type="String">
> <rule name="required" value="true">Please enter an
> email address
> </rule>
> </field>
> </group>
>  </input-data>
>
> 3. the template where the field is used in:
>
> <form method="post"
>
action="$link.setPage("ticket,ConfirmTicketOrder.vm").setAction("ticket.Orde
> rTicketAction")">
> ....
> #set ( $enterfields = $intake.Enterfields.Default )
>
> #if ( !$enterfields.Emailadr.isValid() )
> $enterfields.Emailadr.Message<br>
> #end
>       <td>
>        <input name="$enterfields.Emailadr.Key" value="" type="text"
> size="40" >
>   </td>
> ...
> $intake.declareGroups()
> </form>
>
> 4. The java code in form's action OrderTicketAction.java:
>
>  public class OrderTicketAction extends VelocityAction
> ....
> public void doPerform(RunData data, Context context)
>         throws Exception
>  {
> IntakeTool intake = (IntakeTool)context.get("intake");
> if ( intake.isAllValid())
> {
>     Group g=(Group)intake.get("Enterfields",IntakeTool.DEFAULT_KEY);
>     String s=g.get("Emailadr").toString();
> }
>
> else
> {
>   setTemplate(data, "TicketOrder.vm");
> }
> ....
>
> in this code inatke.isAllValid() always returns TRUE,
> even if nothing had been entered in the email field.
>
> Thanks,
>
> Britta
>


----------------------------------------------------------------------------
----


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


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

Reply via email to