Jason Johnston wrote:
Sylvain Wallez wrote:
Jason Johnston wrote:
The only AJAX-related code I can find in the Widget (formmodel)
classes is in AbstractWidget.generateSaxFragment(), where it creates
an fi:placeholder if the widget is invisible. It seems odd to me to
have this here, perhaps it would better belong in the template layer
as well.
Hmm... the idea behind this is to ensure that the view layer,
whatever it is, has no possibility to produce the XML representation
of a widget if that widget's state prevents it to be displayed.
And that would still be the case, but the production of fi:placeholder
(which is an AJAX-only implementation detail, right?) would be moved
into the view layer. Keep the "if", move the "else".
Yes, you're right, the placeholder is only useful when in Ajax mode. Now
having it in at the widget level was a way to avoid to re-test again the
widget's state in the template, which requires to crawl up the ancestors
to combine their states. Efficiency for the server and lazyness for the
code writer ;-)
Sylvain
--
Sylvain Wallez Anyware Technologies
http://people.apache.org/~sylvain http://www.anyware-tech.com
Apache Software Foundation Member Research & Technology Director