Hi

I have read this howto many times...Maybe I wrote something not
clearly but Intake returns null always even if the form fields are full
or empty and even if the requeried role is not set...

Next, problem:
In the the Intake service howto we have got group tag with attribute
'name' but in the example XML file we have 'class' attribute. This
attribute is not explain in the howto. ???


JM> Where are you getting your syntax for rules from? Please read the
JM> service howto:

JM> http://jakarta.apache.org/turbine/turbine-2/services/intake-service.html

JM> Also you are not setting the rule required=true anywhere, so intake
JM> would not report a null field as invalid.

JM> john mcnally

JM> Maciej Leks wrote:
>> 
>> Hi!
>> 
>> Thanks for help and explanations...But I have still some problems...In the Intake 
>XML
>> file I have one group with two fields. Fields have rules i.e a field
>> can not be empty, etc.
>> 
>> <group name="Person" key="p" mapToObject="om.Person">
>>   <field name="Name" key="name" type="String" mapToProperty="Name">
>>     <rule maxLength="5">Name length cannot be &gt; 5</rule>
>>     <required-message>This module requires data for this 
>attribute.</required-message>
>>   </field>
>> 
>>   <field name="CityId" key="cityid" type="NumberKey" mapToProperty="CityId">
>>     <rule mask="[0-9]+">badIdMessage</rule>
>>   </field>
>> </group>
>> 
>> In the HTML form I have:
>> 
>> <form method="post" 
>action="$link.setPage("InsertPersonIntake.vm").setAction("InsertPersonIntake")">
>> ...
>> #formCell ("First and Last Name" "$personGroup.Name.Key" "$!personGroup.Name")
>> ...
>> <select name="$personGroup.CityId.Key" size="1">
>>   #foreach($city in $cities)
>>     #if ( $!personGroup.CityId == $city.CityId )
>>       <option value="$city.CityId" selected>$city.name</option>
>>     #else
>>       <option value="$city.CityId">$city.name</option>
>>     #end
>>   #end
>>  </slect>
>>  ...
>>  <input type="submit" name="eventSubmit_doInsert" value="Insert"/>
>>  ...
>> 
>> InsertPersonIntake screen class is resonsible for preparing iterator
>> with cities names and ids.
>> 
>> The java action code looks like this:
>> 
>>  public void doInsert(RunData data, Context context) throws Exception
>>  {
>>         IntakeTool intake = (IntakeTool) context.get("intake");
>> 
>>         if ( intake.isAllValid() )
>>         {
>>            String template = data.getParameters().getString("nextTemplate", 
>TurbineResources.getString("template.homepage", "Index.vm") );
>> 
>>            setTemplate(data, template);
>>         }
>>         else
>>         {
>>            setTemplate(data, "InsertPersonIntake.vm");
>>         }
>>   } //
>> ...almost like how-to example.
>> 
>> But, it is not working...After handling the form action always I am
>> redirected to the Insert.vm page (intake.isAllValid() returns always
>> true), though the form was not full, what is not accordancing with the
>> rules! And the form data are always null!!!
>> 
>> My question is: What is going on?
>> Help me....:-(
>> 
>> --
>> 
>>  Leksiu                          mailto:[EMAIL PROTECTED]
>> 
>> --
>> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

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




-- 
Best regards,
 Maciej                            mailto:[EMAIL PROTECTED]


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

Reply via email to