[xwiki-dev] Get the class
Sergiu Dumitriu
sergiu.dumitriu at gmail.com
Fri Jun 1 17:59:38 CEST 2007
Hi,
You could just send the classname and the property name as GET parameters, like:
?xpage=process&className=${obj.className}&fieldName=${prop.name}&input=aaa
Because you don't have specific class in a document, the suggest can
be used for any kind of objects, like access rights, comments, tags.
On 6/1/07, evelyne24 at gmail.com <evelyne24 at gmail.com> wrote:
> Hello,
>
> I have a tricky question. For my ajax suggest, I need to know the class a document belongs to. To be more precise: the user makes a class, let's say TryClass, and then a new document of that class. The class has a property (String let's say) that is displayed as an input. When the user writes something in the input field, my ajax sends a request to a velocity template (something like ?xpage=process&input=aaa).
>
> In process.vm I need to know the class (the USER's class) the document from which the request was made belongs to. I modified the java code like that
>
> BaseClass bclass = getxWikiClass();
> String classname;
> if(bclass == null) classname = "";
> else classname = bclass.getName();
>
> but the classname is actually StringClass (the class of the property) so I thought there might me a way to find out the user class in the velocity template, by using $context or something like that....I don't really know.
>
> Please help.
> Thank you,
> Evelina Slatineanu
>
--
http://purl.org/net/sergiu
More information about the devs
mailing list