|
|
|
|
|
|
Login
|
erp5.org has permanently moved to wiki.erp5.org ! Current status of ERP5 community websites:
Note: if you created content in this ancient portal, please migrate it to the wiki. The old website will stay online as long as all contents are not mograted to the wiki.
Customize ListBox
This document explains all features provided by the ListBox.
What is a ListBox :The ListBox allows to display many informations on a list of objects. The listbox is used everywhere in ERP5. When in erp5 you see the full list of objects from a module, you have a listbox in front of your eyes. Add a new ListBox : Usually, a listbox widget is added in ERP5 Forms. You have to select one ERP5 Form
in the Zope Management Interface (ZMI). Then you have on the top right a list
of widget that you might add. Please, select a Minimum configuration :Here we will define only a few fields, then strict necessary in order to get a working listbox with default parameters. Title :It will be displayed on the top of the listbox. You can put any string, it is intended to explain to the user what is the content of your listbox. Lines :It is simply the list of lines you want to display, 30 is usually quite nice. Columns :This describes what are the columns of your listBox. It should be entered like this :
id | Number
title | Title
description | Comment
getTotalQuantity | Qantity
This is of the form : [property or method] | [Label displayed to the user] You can put as many columns as you want. List method :This is the method used in order to get displayed objects. This can a script, a method or a specific keyword. An example of method could be : "objectValues', This method will return all objects in the current directory. You can also write a script and then you can enter the id of this script. We usually use the keyword : Selection Name :This is the name used in order to retrieve all parameters of the listbox. Indeed, in ERP5, when you set some parameters (like a research in a column), then if you go to another listbox, and come back, you will still have the same research selected. A good name for the selection is like this :
[Form Name]_selection
For example : PersonModule_selection Portal Types :This will be a parameter given to the method (or script) used with List Method. So you can write a script with parameters like this :
portal_types=[], **kw
Then you will receive the list of Portal Types that you have entered in your listbox.
Also, if you have used
Person | Person
Organisation | Organisation
You don't need to specify the second part here, it has no meaning. So you can let it empty, so you can enter it like this :
Person
Organisation
Then the second part will be automatically added, but you don't need to care. List Action :This is the form used when you click on the title of the listbox. There is already an existing default one often used with ERP5. You can put :
Folder_viewContentList
So, that's all. You have all the minimum required in order to get a working listbox. There is many more parameters, so we will see all them right now. Full Configuration :We will see now the non required part. |
|
|