Introduction
============
ATReferenceBrowserWidget is an add-on to Archtetypes. It adds a new reference
widget that allows you to search or browse the portal when creating
references. This new widget inherits from the standard reference widget so you
can use all it's properties.
When you use this widget, there are two buttons presented for each widget. One
that opens a popup-window that let's you do the search/browsing and one that
let's you clear the reference or selected references (will be in effect after
the form's Save).
The popop window basically consists of two parts. The top half is a search form
and the bottom half is the browser/search results part. Both parts can be
turned off or on using the widget's properties.
The search part has additional configuration in the widget (see properties below).
Properties
----------
The popup window can be configured using the following widget properties:
This add-on comes with an example content type that uses this widget. You can
enable the installation of the type by uncommenting the appropriate line in
Install.py under Extension. See ATReferenceBrowserDemo.py.
Design notes
------------
Both the templates (widget and popup) are prototypes. There are still some
inline styles, especially in the popup because I didn't want to tweak with
plone's css stuff and I didn't want to do hacking and tricking to incorporate
a stylesheet myself.So, that's still a point of interest.
Furthermore I made some design decisions. Right now, in the popup window, all
objects are shown (when browsing) and objects that may be referenced to are
bold and the other objects are greyed out. I chose to show the
non-referenceable objects too because they may be an important part of the
context that help the user search for the desired objects to browse to.
Another thing that I chose for is that in case of a multi-value widget, the
popup remains open so that you can continue to add references without having to
reopen the popup over and over again. Problem is that you have to close the
window yourself. This may change if it turns out to be an annoyance.
A thing that is more related to forms in general is that the items in the
multiselect listbox need to be selected before Save is clicked otherwise only
the selected items are submitted. That kinda sucks usability-wise because now
the user basically has to make two selections: first by choosing the items in
the popup and secondly by selecting them again in the listbox. Right now I made
it so that the items are selected by default but if the user starts clicking in
the list, then there might be an issue. Btw, the inandout widget has the same
problem. Best would be to select all the items in a script just before the
form is submitted so that the complete list is submitted. But that requires
changes in the base_edit form I think. But it's something to think about since
there are now already two widgets that needs to be prepared like this (inandout
and this one, haven't looked at picklist though, could have the same problem).
Anyway, have fun with it and if you have suggestions please let me know. If you
see problems, please fix them when you can.
|