cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Messing, Elad" <elad.mess...@eml-d.villa-bosch.de>
Subject AW: WG: CFORMS validation unexplained behavior - call for help!
Date Mon, 06 Jun 2005 09:09:55 GMT
Thank you, Reinhard for your reply.
Here are my answers :

> The getValue() method of the widget
> only returns the value if there are *no* validation errors. I'm not sure if this is the
correct or if we should make 
> this configureable. Feel free to move the discussion over to dev@cocoon.apache.org to
get opinions of other developers.

In my opinion this is natural. I will move the discussion to the dev mailing list to hear
other views.

> How often are you hitting the back button?
Just once. First page is a form. Second page is Form results. So 1 press on the "Back" button
- and I am in the Form page again - with the "validation errors" still showing.

> which controller are you using? It seems to me that the controller isn't initializing
your form correctly.
What do you mean by controller ? 
In general the link to the form page is actually a mapped in the sitemap to a FlowScript function,
and in the function I am calling the form. Classic behavior. You can see the exact FlowScript
in my previous message - at the bottom.


Thanks again !!

Elad

Maybe your form level validation should check if the two widgets have set validation errors.
-----Urspr√ľngliche Nachricht-----
Von: Reinhard Poetz [mailto:reinhard@apache.org] 
Gesendet: Montag, 6. Juni 2005 09:55
An: users@cocoon.apache.org
Betreff: Re: WG: CFORMS validation unexplained behavior - call for help!

Messing, Elad wrote:

[snip the second mail]

>         With the help of Sylvain and Thorsten I have managed to come 
> up with a form.
>         Now - when all data is valid, all works fine.
>         The problem starts when the data is not valid.
> 
>         I have 3 widgets in my form - text field and a select list. 
> (See definition below)
>         On the text field there is a validation of length, and on the 
> select list there is no validation, but the first "item" of it is a 
> null record - to show an empty slot.
> 
>         On the "form" there is a validation so that either of the 2 
> fields must contain value. (See definition below)
> 
>         When I first show the form all is fine.
> 
>         When I enter a too-short string in the text field, I get a 
> strange behavior: I can see the error message stating it is too short, 
> but I can also see the error message stating that either of the fields 
> should be entered (coming from the "form level" validation function) - 
> like nothing was entered in the text field. I added a "print" line 
> into the form validation, to see that even though I have entered a 
> value in the text field (it was too short - but it was there) the 
> widget value is actually null. (see the "print" in the flow below).


This is the intended behaviour. The getValue() method of the widget

     public Object getValue() {
         ...
         return this.validationError == null ? this.value : null;
     }

only returns the value if there are *no* validation errors. I'm not sure if this is the correct
or if we should make this configureable. Feel free to move the discussion over to dev@cocoon.apache.org
to get opinions of other developers.

Maybe your form level validation should check if the two widgets have set validation errors.

> 
>         Also - I would expect the validation to stop after it was 
> failing on the "too-short" text field widget validation. Why has it 
> continued to the "Form level" validation at all ?

because the complete widget tree is validated

> 
>         Another strange behavior was, that after I submitted the form 
> with valid data, I could see the results. When I pressed "Back" button 
> of the browser - I got back to the form page, with all the error 
> messages still showing. The fields are showing the valid data which I 
> put in, but the errors from the first trail are still there. Why is that ?


How often are you hitting the back button?

> 
>         And the third issue - When I am not using the "Back" button, 
> but instead using the original "link" to the form page, I get other 
> results
> - I can see the form in the state it was after I entered a "too-short" 
> string in the text field !! This is after I have already changed the 
> data to valid, submitted, got my results, and return to the form page 
> using its link 1 minute after.. I even get the results opening a new 
> browser window, in a different process. Only "restart" to the web 
> server removes it.

which controller are you using? It seems to me that the controller isn't initializing your
form correctly.

> 
>         Is this the normal behavior ? Should I reset the form in some 
> manner ?
> 
>         I am attaching down the needed text from the flow and form 
> description - maybe it can help you understand my problems.
> 
>         Thank you very much for reading my long post :)
> 

[snip the sample]

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

	

	
		
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message