On Feb 8, 2010, at 9:34 PM, Valdis Vītoliņš wrote:
I'd like to show different links in panel
depending on Xwiki user's
Company field.
Following code does this
#set($myCompany='')
#set($obj=$xcontext.getUser())
#set($objdoc = $xwiki.getDocument($obj))
#set($myCompany = $objdoc.company)
$myCompany
Though when wiki document is opened in inline editing mode,
variable is shown in input text field.
To test this, put code in document then open it in inline mode.
This seems related to standard xwiki behavior.
How it could be solved in different way?
$objdoc.company is the same as $objdoc.get("company") which is the same as
$objdoc.display("company).
You need to use $objdoc.getValue() instead.
It's one of the bad APIs we have inherited from xwiki's history...
Thanks
-Vincent