On Mon, Feb 23, 2009 at 3:13 PM, Jean Couteau <[email protected]> wrote:
> Guillaume Lerouge a écrit : > > Hi, > > > > On Mon, Feb 23, 2009 at 2:51 PM, Jean Couteau <[email protected]> > wrote: > > > > > >> Dear all, > >> > >> I am trying to render strings using velocity while i am in inline mode, > >> but every time, i got an input form with my value inside. > >> > >> How can i get my variable well displayed ? > >> > >> Here is my piece of code (with different tries): > >> > >> $context.setDisplayMode("view") > >> > >> #set($a="${backlogId},${domainId},${topicId},${epicId},${temp}") > >> > >> $doc.display($a) > >> > >> $a > >> > >> <a href ="/xwiki2/bin/view/Project/addActor?usId=${a}">Add an actor</a> > >> > >> > >> (Note, a is not rendered when using $doc.display($a) and is always > >> replaced by : > >> > >> <input size='30' id='XWiki.USClass_0_id' value='1,0,0,1,2' > >> name='XWiki.USClass_0_id' type='text'/> instead of '1,0,0,1,2' ) > >> > >> Thanks in advance for your help > >> > > > > If I remember well you can get around this by using $property.getValue() > > instead of $doc.display since in inline mode $doc.display is turned into > an > > input field by default. > > > I tried to get around this using the $context.setDisplayMode("view") > (that should put my rendering in view mode when using $doc.display > (according to the javadoc), but it displays nothing (quite weird though) > > I have to use $property.getValue() ? but my variable is not a property > or how can I transform it into a property ? Isn't "XWiki.USClass_0_id" a field in a XWiki object? If it is, then it's a property :-) I think you need to do something like: #set($a="${backlogId.getValue()},${domainId.getValue()},${topicId.getValue()},${epicId.getValue()},${temp.getValue()}") Guillaume > > I remember doing this in the bulletin board application a while ago, I'd > > need to check its code to find the exact API call to use. > > > I'll have a look into it. > > Thanks for your help. > > > -- > ---- > Jean Couteau > Code Lutin - http://www.codelutin.com > 44 Bd des Pas Enchantés - 44230 St-Sébastien/Loire > Tél : 02 40 50 29 28 - Fax : 09 59 92 29 28 > > _______________________________________________ > users mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/users > -- Guillaume Lerouge Product Manager - XWiki Skype ID : wikibc http://guillaumelerouge.com/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
