Formulator with lookup windows
Samuel Schluep <[email protected]>
| Newsgroups | gmane.comp.web.zope.silva.devel |
|---|---|
| Message-ID | <[email protected]> |
Dear Developers As Silva still hasn't a more general way to embed other Assets than images in to a Silva Document, most people use Code Sources to embed Flash or Quicktime movies into their pages. This method has one major drawback: the user has to enter the reference to the Asset into a StringField by hand. This is admittedly not very user-friendly. The easiest and most flexible way to overcome this problem I can imagine would be the possibility to include a button together with another input field (e.g. a StringField) in the Formulator forms. Such a button could be used to open a special lookup window similar to the "get image reference..." button in the Kupu- and Forms-Editor. I tried to do something similar using Formulator’s TALES fields. With TALES I added a button and some JavaScript code to the Title field. This did work together with the add-forms of my customized content type. Then I tried this approach with Code Sources, but here it did not work: 1. The HTML and JavaScript code is rendered in a HTML-encoded way and thus does not add any functionality Forms-Editor’s Code Source edit widget. 2. In Kupu the HTML and JavaScript code in not encoded and thus should be functional. But it seems that JavaScript is for some reason not executed when pressing the button - well nothing happens. As another approach, I added an 'onclick'-attribute with TALES using the 'Extra' field of a 'StringField'. The problems were as follows: 1. In the Forms-Editor the StringField could be clicked and the JavaScript command did open a lookup window. However I could not find a way to provide a hook for the lookup window to insert some string back into the StringField. 2. Again, in Kupu the JavaScript was not executed when clicking the StringField. However, both approaches are not very clean. Therefore, I think a more general method to provide a way to integrate a lookup window using Formulator would be very handy and would greatly enhance the functional potential of Silva. Such a feature must include a hook for the lookup window to write the lookup data back into the form which has been generated by Formulator. I can also imagine other valuable ways to use such a feature. For example it would be useful to create more advanced metadata items. The lookup (or data entry) window should help users to enter metadata correctly (in this case the HTML input element may be disabled - the only way to enter data is though the lookup or data entry window).. Together with some appropriate CodeSources, this feature would enable user-friendly lookup of Flash and Quicktime Assets! No new content types would be needed and the Silva Document XML Schema does not need to be changed. Maybe someone has already faced similar problems, and knows a nice workaround? Best regards and have a nice-week Sam -- Samuel Schluep | ETH Zürich Center for Organizational and Occupational Sciences (ZOA) Unit Man-Machine Interaction +41 1 632 74 24 | [email protected] | http://www.zoa.ethz.ch