Hi,

Thanks for your reply.

On 14 Feb 2009, at 16:12, David Zülke wrote:
> any previous rules), error_messages is used again, but with the form  
> itself as the context node for the XPath query. Again, the comments  
> in the sample app's global_filters.xml explain it very well, so have  
> a look at that 
> (http://trac.agavi.org/browser/tags/1.0.0beta9/samples/app/config/global_filters.xml#L15
>  
> ).

I've had a look, but I still can't get it to work. In fact, I've cut  
down the sample app's filter to a bare minimum (attached at bottom of  
this post). In the sample app, this still resulted in class="error" on  
the invalid fields. However, when this is used for the comments in my  
blog, no error class is added (but the fields are filled with the  
correct values). Could this be a configuration issue somewhere? Maybe  
an issue with the form? I'm not sure where to look.


> You really should consider redirecting after the comment was  
> inserted. The Action for adding a comment should do just that,  
> insert the comment, and then perform an external redirect back to  
> the page that shows the blog post (maybe with an anchor link to the  
> comment that was just added).

I changed the setup so the comment form is submitted to the same url  
as it originally appears: the page with the blog entry and the  
comments. I assumed this was the only (simple) way to get validation  
errors appear in the form. Am I wrong? Otherwise, if the form submits  
to another url then

- There will be an external redirect to the original page in all  
cases: valid & invalid input. This seems a bit unnecessary

- In the case of invalid input, as in my previous point, there will be  
a redirect to the original post page. However, this page then needs to  
access the original submitted values. I would think this requires the  
original submitted values to be saved in some sort of session  
variable, and then retrieved after the redirect. Again this seems a  
bit unnecessary.

So having the comment submitted to another page, and then redirecting  
back in all cases seems to add complication. Can I ask what the  
justification is?

*or*

Did you mean to keep the submission url as the same page as the blog  
entry + comments, but upon successful comment insertion, send a  
redirect to the *same page*, forcing the browser to request the same  
url (but as a GET with no extra data sent). Is this essentially the  
"Post/Redirect/Get" pattern to avoid resubmission? In this case I  
agree and see why it's a good idea.


(Sorry if I'm misunderstanding)


Michal.



**** global_filters.xml ******

<?xml version="1.0" encoding="UTF-8"?>
<ae:configurations xmlns:ae="http://agavi.org/agavi/config/global/envelope/1.0 
" xmlns="http://agavi.org/agavi/config/parts/filters/1.0";>
        <ae:configuration context="web">
                <filters>
                        <filter name="FormPopulationFilter"  
class="AgaviFormPopulationFilter">
                                <ae:parameter name="methods">
                                        <ae:parameter>write</ae:parameter>
                                </ae:parameter>
                                <ae:parameter name="output_types">
                                        <ae:parameter>html</ae:parameter>
                                </ae:parameter>
                        </filter>
                </filters>
        </ae:configuration>
</ae:configurations>


_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

Reply via email to