You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Baptiste Placé <bp...@jouve.fr> on 2007/05/03 14:45:08 UTC

Dynamic suggestion list

Hello,

I would like to have a dynamic suggestion list, e.g. the content of the 
list would be recovered from a database when the other fields of the 
CForms are changed.
Using fd:union looks complicated as I would have about 32 different cases !

Is it possible for a widget to fire an event to the suggestion list and 
then changing the content of the list ?

I just want to know if this is would take too much time for such a feature.
Any advice would be appreciated :)

- Baptiste Placé

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Dynamic suggestion list

Posted by Dev at weitling <de...@weitling.net>.
> Hi Florian,
>
> Thanks for your answer !
Never mind - just help others when you have upgraded to a cocoon Jedi* :-)

> About updating the list, do you mean using something like
> <fd:selection-list src="cocoon:/mychoices.xml" dynamic="true"/> ?
Yesno. I think the data delivered by cocoon:/mychoices.xml could be dynamic.

> Or is it about changing the <map:match
> pattern="_cocoon/forms/suggest"> part ?
:-?

> I'm quite interested about this, as the only information I've found is
> Christofer Dutz' idea
> (http://marc.info/?l=xml-cocoon-users&m=115649772124493&q=p3).
Thanks for the link. Will have a look at it tomorrow.

> You are certainly right about the tricky part, I am querying my
> database with java objects using Hibernate. Sessions are managed by
> the flowscript and a servlet filter so I don't see any solution here :-(
Yes, that might look difficult, too. But what I'm thinking of is how to
invoke the "form on hold" (via showForm) to redisplay it in the browser.
I have problems to call the form from withing the
fd:on-value-changed/fd:javascript part in the form definition file. :-?

Good night,
Florian

> ---------------------------------------------------------------------
> * No, sorry, I'm not yet even a Cocoon knight ;-)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Dynamic suggestion list

Posted by Baptiste Placé <bp...@jouve.fr>.
Hi Christofer,

Thanks for your feedback, but at the moment I am not working on this. I 
may mail you if I need some informations on your solution ;)

Baptiste

Christofer Dutz a écrit :
> Hi Baptiste,
>
> Just saw that the main part of my solution was a custom generator I 
> wrote, that simply gets a form instance curently shown and outputs 
> it's current content in xml form. I use this to transform it to any 
> individual suggestion-list output.
>
> Unfortunately you have to tweak the dojo code a litte to make the 
> suggestion lists "onvaluechangeable" ... I will gladly share my code.
>
> Christofer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Dynamic suggestion list

Posted by Christofer Dutz <ma...@c-ware.de>.
Hi Baptiste,

Just saw that the main part of my solution was a custom generator I 
wrote, that simply gets a form instance curently shown and outputs it's 
current content in xml form. I use this to transform it to any 
individual suggestion-list output.

Unfortunately you have to tweak the dojo code a litte to make the 
suggestion lists "onvaluechangeable" ... I will gladly share my code.

Christofer


Baptiste Placé schrieb:
> Dev at weitling a écrit :
>> Hi Baptiste,
>>
>>  
>>> I would like to have a dynamic suggestion list, e.g. the content of
>>> the list would be recovered from a database when the other fields of
>>> the CForms are changed.
>>> Is it possible for a widget to fire an event to the suggestion list
>>> and then changing the content of the list ?
>>> I just want to know if this is would take too much time for such a
>>> feature.
>>>     
>>
>> First please have a look at:
>> http://cocoon.apache.org/2.1/userdocs/widgetconcepts/selectionlists.html
>> According to the book "Cocoon 2 und Tomcat" from Stephan Niedermeier
>> there is another way via a Java class extending
>> org.apache.cocoon.forms.datatype.AbstractJavaSelectionList.
>> Anyway, updating the selection list dynamically is not the problem. The
>> tricky part is getting access to the underlying model.
>>
>> Any elegant ideas out there? (I need it, too :-)
>>
>> Florian
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>   
> Hi Florian,
>
> Thanks for your answer !
> About updating the list, do you mean using something like 
> <fd:selection-list src="cocoon:/mychoices.xml" dynamic="true"/> ?
> Or is it about changing the <map:match 
> pattern="_cocoon/forms/suggest"> part ?
> I'm quite interested about this, as the only information I've found is 
> Christofer Dutz' idea 
> (http://marc.info/?l=xml-cocoon-users&m=115649772124493&q=p3).
>
> You are certainly right about the tricky part, I am querying my 
> database with java objects using Hibernate. Sessions are managed by 
> the flowscript and a servlet filter so I don't see any solution here :-(
>
> - Baptiste Placé.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Dynamic suggestion list

Posted by Baptiste Placé <bp...@jouve.fr>.
Dev at weitling a écrit :
> Hi Baptiste,
>
>   
>> I would like to have a dynamic suggestion list, e.g. the content of
>> the list would be recovered from a database when the other fields of
>> the CForms are changed.
>> Is it possible for a widget to fire an event to the suggestion list
>> and then changing the content of the list ?
>> I just want to know if this is would take too much time for such a
>> feature.
>>     
>
> First please have a look at:
> http://cocoon.apache.org/2.1/userdocs/widgetconcepts/selectionlists.html
> According to the book "Cocoon 2 und Tomcat" from Stephan Niedermeier
> there is another way via a Java class extending
> org.apache.cocoon.forms.datatype.AbstractJavaSelectionList.
> Anyway, updating the selection list dynamically is not the problem. The
> tricky part is getting access to the underlying model.
>
> Any elegant ideas out there? (I need it, too :-)
>
> Florian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>   
Hi Florian,

Thanks for your answer !
About updating the list, do you mean using something like 
<fd:selection-list src="cocoon:/mychoices.xml" dynamic="true"/> ?
Or is it about changing the <map:match pattern="_cocoon/forms/suggest"> 
part ?
I'm quite interested about this, as the only information I've found is 
Christofer Dutz' idea 
(http://marc.info/?l=xml-cocoon-users&m=115649772124493&q=p3).

You are certainly right about the tricky part, I am querying my database 
with java objects using Hibernate. Sessions are managed by the 
flowscript and a servlet filter so I don't see any solution here :-(

- Baptiste Placé.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Dynamic suggestion list

Posted by Dev at weitling <de...@weitling.net>.
Hi Baptiste,

> I would like to have a dynamic suggestion list, e.g. the content of
> the list would be recovered from a database when the other fields of
> the CForms are changed.
> Is it possible for a widget to fire an event to the suggestion list
> and then changing the content of the list ?
> I just want to know if this is would take too much time for such a
> feature.

First please have a look at:
http://cocoon.apache.org/2.1/userdocs/widgetconcepts/selectionlists.html
According to the book "Cocoon 2 und Tomcat" from Stephan Niedermeier
there is another way via a Java class extending
org.apache.cocoon.forms.datatype.AbstractJavaSelectionList.
Anyway, updating the selection list dynamically is not the problem. The
tricky part is getting access to the underlying model.

Any elegant ideas out there? (I need it, too :-)

Florian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Dynamic suggestion list

Posted by Derek Hohls <DH...@csir.co.za>.
Specifcically:
 
[host]/samples/blocks/forms/carselector

>>> Olivier Billard <ol...@laposte.net> 2007/05/16 04:28:45 PM >>>

Hi Baptiste,

You may find what you are looking for by looking at the "Cocoon suggests" sample, that uses Ajax to dynamically updates the selection list, depending 
on what is being entered.

HTH
--
Olivier Billard



Baptiste Placé wrote:
> Hello,
> 
> I would like to have a dynamic suggestion list, e.g. the content of the 
> list would be recovered from a database when the other fields of the 
> CForms are changed.
> Using fd:union looks complicated as I would have about 32 different cases !
> 
> Is it possible for a widget to fire an event to the suggestion list and 
> then changing the content of the list ?
> 
> I just want to know if this is would take too much time for such a feature.
> Any advice would be appreciated :)
> 
> - Baptiste Placé


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org




-- 
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
 
CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html 
 
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html 
 
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
CallCentre@csir.co.za.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.


Re: Dynamic suggestion list

Posted by Olivier Billard <ol...@laposte.net>.
Hi Baptiste,

You may find what you are looking for by looking at the "Cocoon suggests" sample, that uses Ajax to dynamically updates the selection list, depending 
on what is being entered.

HTH
--
Olivier Billard



Baptiste Placé wrote:
> Hello,
> 
> I would like to have a dynamic suggestion list, e.g. the content of the 
> list would be recovered from a database when the other fields of the 
> CForms are changed.
> Using fd:union looks complicated as I would have about 32 different cases !
> 
> Is it possible for a widget to fire an event to the suggestion list and 
> then changing the content of the list ?
> 
> I just want to know if this is would take too much time for such a feature.
> Any advice would be appreciated :)
> 
> - Baptiste Placé


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org