On Tue, May 19, 2009 at 14:03, Thomas Mortagne
<thomas.mortagne(a)xwiki.com> wrote:
On Tue, May 19, 2009 at 13:57, Anca Paula Luca
<ancapaula.luca(a)xwiki.com> wrote:
Thomas Mortagne wrote:
Hi devs,
For 2.0 syntax we make XWikiDocument.display() enclose the result in
{{html}}{{/html}} since it's supposed to generate html and that we
should not have to use {{html}}{{/html}} in the syntax when we call
$doc.display("somefield").
Now the issue is that public api Object and Document get() methods
does not return the value but call display. But users (and us) used to
access string value using $object.somefield instead of
$object.getProperty("somefield").getValue() which is the correct form
to access an object field value.
I feel that
$object.fieldName is way more natural as
$object.getProperty("somefield").getValue()
than as
$object.display().
Otherwise put, why can't we change getters to return
$object.getProperty("somefield").getValue()?
Because if we do that we
break all code using $object.fieldName to
display the field like most of the code to edit a form in inline mode
(like the default content we generate in the class manager in XE). As
i said in a previous mail when Thomas raised the issue, i would prefer
that $object.fieldName does not call display but whatever the change
you make to the API it will break it for users.
The only thing we can do is keep the old model working as it always
worked and take care of all theses problems found for the new model.