cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Re: CForms: where and how to specify the suggestion-list?
Date Thu, 22 Sep 2005 10:12:28 GMT
Sylvain Wallez wrote:
> Hi all,
> 
> I'm currently working on adding a "Cocoon suggest" feature to CForms 
> fields based on Scriptaculous [1]. This requires to associate an URL to 
> the field to fetch the suggestion list using Ajax requests when the user 
> inputs something.
> 
> Question is: where and how do we specify this? Is this a concern of the 
> form definition, or a particular styling of the field?
> 
> Concretely, should it be
>  <fd:field id="foo">
>    <fd:suggestion-list url="foo-suggest">
>  </fd:field>
To be consistent with current selection-list functionality I would opt 
for this one.

> Another solution would be for the suggestion list in the definition to 
> be given using the same syntax as <fd:selection-list> and have a 
> system-provided default pipeline to render the list:
> 
>  <fd:field id="foo">
>    <fd:suggestion-list src="cocoon:/foo-suggestion-list"/>
>    <!-- or use whatever implementation of selection list you want -->
>  </fd:field>
> 
> This will automatically generate a
>  <fi:styling suggest-href="_cforms-suggest-foo"/>
> 
> which will be answered to in the sitemap with something like:
>  <map:match pattern="_cforms-suggest-*">
>    <map:generate type="jx" 
> src="resource://org/apache/cocoon/forms/system/generate-suggest-list.xml"/>
>    <map:transform 
> src="resource://org/apache/cocoon/forms/system/list2html.xsl"/>
>    <map:serialize type="xml"/>
>  </map:match>
> 
> This approach still allows to specify the suggest-href only in the view 
> for cases where it's considered as being a view-only concern, and it 
> also allows to specify different renderings of the suggestion list by 
> catching the "_cforms-suggest-xxxx" pattern before the generic 
> "_cforms-suggest-*".
> 
> WDYT?
are you taking a "picker patter" into account? I mean just as with 
selection list you have a value and label you should be able to filter 
the by labels (i.e. username) but get value as the result (i.e. user id).

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Mime
View raw message