{{{
#!text/html
<form id="search" action="/search"><input type="text" name="q" /><input
type="submit" value="Search" />
<form id="blah" action="/blah/15/burp"><input type="text" name="yay"
/><input type="submit" value="Save" />
}}}
And you want, in BlahBurpErrorView, to re-populate form "blah", but also
pre-populate form "search" for user's convenience like so:
{{{
#!php
<?php
$rq->setAttribute(
'populate',
array(
'search' => new AgaviParameterHolder(array('q' => 'laser beams')),
'blah' => true,
),
'org.agavi.filter.FormPopulationFilter'
);
}}}
then any error on the "blah" form will be populated onto form "search",
even if you change the order in the "populate" array so "blah" is listed
first.
The reason for this is that the XPath node set does not have any
guaranteed order, so the code needs to be changed so it fetches each form
separately to preserve the order.
But for that to be any useful, we need to put keys with a value of
{{{true}}} into the first position, so they're always populated before
others regardless of their position in the "populate" array, since it's
unlikely that the other forms need any error messages inserted on them.
Saves users from big "WTF" moments.
--
Ticket URL: <http://trac.agavi.org/ticket/1461>
Agavi <http://www.agavi.org/>
An MVC Framework for PHP5
_______________________________________________
Agavi Tickets Mailing List
tic...@lists.agavi.org
http://lists.agavi.org/mailman/listinfo/tickets
* status: new => closed
* resolution: => fixed
Comment:
(In [4886]) Guarantee order of form population and give preferential
treatment to automatically re-populated forms, closes #1461
--
Ticket URL: <http://trac.agavi.org/ticket/1461#comment:1>