Customise the edit page of an existing object

Hello to all,

I have created an object with the following attributes:

image

I want to use the default Wiki editor when creating pages, simply by clicking the ‘Edit’ button on a page (for users without special permissions, just simple users).
This button:
image

When I press that button I can modify the content of my page and it looks like this:
image

Where Category and Level are another class within the Wiki, which contain internally their own objects, that’s why I created them as ‘Page’ type.

Question:
Is there a way to display a list of objects created with the Category and Level classes instead of a checkbox and text?

I would like to show a List of the created objects, so when the user clicks on ‘Edit’, it can change the attribute based on the created objects.

Please help,
Thanks for your time

Hello.

You control what is displayed through the class sheet so nothing prevents you from listing pages having Category or Level xobjects in them, possibly using a LiveData (for example).

If I understand correctly, you’d like a Page xproperty type but restricted to pages containing some xobject. Right now the Page type is generic and doesn’t support such restrictions. You’d need to implement a custom xproperty type (see https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/CreatingNewXClassPropertyTypes/).

What already exists though is to use a DB List xproperty type and it allows to do a query so you can only return pages having specific xobjects. See https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/DataModel/DatabaseList/

Hope it helps

1 Like

Thanks for your response, I will give them a try! :slight_smile:

I appreciate your time, thanks again.

Hello again :slight_smile:

I managed to edit my template sheet and now the content looks just as I want, thank you very much for your help!

But I still have a doubt:
The idea is that when the user activates the edit mode of an object, the user will be able to see a list containing all the objects created from Categories and Levels, currently this already works and it looks like this:

image

The idea is as follows:
The user creates a question and assigns a category to that question, but if the user wants, he could change this category according to the categories listed in the object view with edit mode active.

My question is:
How could I get so that when the user selects some option from the list and if the user clicks the ‘Save’ button it is actually saved to the Wiki?

I have already tried many ways, but it doesn’t save what the user selects, I have already tried many ways, but it doesn’t save what the user selects, I appreciate any help :smiley: