Printable version XML version
Login
Name

Password


Join
Forgot your password?
erp5.org => wiki.erp5.org !

erp5.org has permanently moved to wiki.erp5.org !

Current status of ERP5 community websites:

  • www.erp5.org should redirect to wiki.erp5.org automaticcaly.
  • wiki.erp5.org is the place where fresh news and documentation are published.
  • cps.erp5.org is the old erp5 community website.

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 ListBox. You must set the id has listbox or you will get many errors with ERP5.

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 : portal_catalog. Indeed, with this keyword, the ListBox will use the portal_catalog tool to find objects. We use this one as much as we can because it is the fastest one.

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 portal_catalog, then it will return automatically all objects with the given portal types. You have to specify Portal types like this :

      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.


(c) 2001-2004 ERP5 Foundation
www.erp5.org
All Content Published Under Free Licenses
Powered by ERP5 Open Source ERP, Zope, CPS and Nexedi